Remote Sensing, GIS and Urban Analytics: Imagery, Photogrammetry, Spatial Data, SQL, Python and Machine Learning
2. Satellites, sensors, orbits and coverage
| Feature | Sun-synchronous (near-polar) | Geostationary |
|---|---|---|
| Altitude | Several hundred km (low Earth orbit) | About 36,000 km above the equator |
| Motion | Passes near the poles, Earth turns beneath it | Period equals Earth’s rotation, so it hangs over one point |
| Key property | Crosses a latitude at the same local solar time each pass: comparable illumination | Continuous view of one large disc |
| Typical use | Land cover, urban mapping, change detection (fine pixels) | Weather, cyclones, communication (coarse pixels) |
The swath is the width of the ground strip a satellite images in one pass. A pushbroom sensor has a line of detectors across the track, so swath = number of detectors × GSD (6,000 detectors at 10 m give 60 km); a whiskbroom sensor sweeps a mirror across the track with few detectors. The revisit time is how long before the same area is imaged again. A wide swath gives frequent revisit but coarse pixels; a narrow swath gives fine pixels but slow revisit, which sensors offset by pointing off-nadir or by flying constellations.
| System | Spatial detail | Revisit and remark |
|---|---|---|
| Landsat 8 and 9 | 30 m multispectral, 15 m panchromatic | 16 days each; the longest archive |
| Sentinel-2 | 10 m in visible and NIR bands | 5 days with two satellites; free data |
| Sentinel-1 | C-band radar (SAR) | Imaging through cloud, day and night |
| MODIS | 250 m to 1 km | About daily; regional monitoring |
| Indian systems | IRS and Resourcesat multispectral sensors; Cartosat high-resolution panchromatic | INSAT series in geostationary orbit for weather |
3. Digital image processing, NDVI and accuracy assessment
An image is a raster of digital numbers (DN) per band. Pre-processing removes defects: radiometric correction (DN to radiance and reflectance), atmospheric correction (for example dark-object subtraction for haze) and geometric correction (georeferencing). Enhancement improves interpretation: a linear contrast stretch maps DN to (DN − min)/(max − min) × 255; histogram equalisation spreads frequent values; low-pass filters smooth and high-pass filters sharpen edges; principal components compress correlated bands. A false-colour composite showing NIR, red and green as red, green and blue displays healthy vegetation in red.
| Aspect | Supervised | Unsupervised |
|---|---|---|
| Training | Analyst first supplies labelled samples of each class | No samples; the algorithm groups pixels by spectral similarity |
| Methods | Minimum distance, maximum likelihood, support vector machine, random forest | K-means, ISODATA |
| Classes | Information classes fixed in advance | Spectral clusters, labelled by the analyst afterwards |
| Best when | Reliable ground data and a clear class scheme exist | Little prior knowledge; exploratory work |
Indices. NDVI = (NIR − Red)/(NIR + Red) lies between −1 and +1: water, cloud and snow are negative or near zero, bare soil and built-up are low positive, dense healthy vegetation is high (indicatively above 0.5). With NIR reflectance 0.52 and red 0.08, NDVI = 0.44/0.60 = 0.73. Similar normalised ratios exist for built-up land, NDBI = (SWIR − NIR)/(SWIR + NIR), and for water, NDWI = (Green − NIR)/(Green + NIR).
| Map class | Ref. built-up | Ref. vegetation | Ref. water | Row total |
|---|---|---|---|---|
| Built-up | 45 | 3 | 2 | 50 |
| Vegetation | 4 | 38 | 8 | 50 |
| Water | 1 | 2 | 47 | 50 |
| Column total | 50 | 43 | 57 | 150 |
Overall accuracy = Σ diagonal/N = (45 + 38 + 47)/150 = 130/150 = 86.7 %. User’s accuracy (diagonal/row total) says how reliable a mapped class is: vegetation 38/50 = 76 %. Producer’s accuracy (diagonal/column total) says how much of the reference class was captured: vegetation 38/43 = 88 %. Kappa corrects for chance agreement: κ = (po − pe)/(1 − pe), where po is the overall accuracy and pe = Σ(row total × column total)/N² = (2,500 + 2,150 + 2,850)/22,500 = 0.333, so κ = (0.867 − 0.333)/0.667 = 0.80.
4. Satellite data products, aerial photography and photogrammetry
| Product | What it is | Planning use |
|---|---|---|
| Corrected multispectral imagery | Radiometrically and geometrically corrected scenes in several bands | Land cover and urban extent mapping |
| High-resolution panchromatic imagery | Sharp single-band images, often fused with colour bands | Base maps, building and slum mapping |
| Derived layers | Surface reflectance, NDVI, land surface temperature, composites | Greenness trends, heat-island studies |
| Elevation models | DEM and DSM from stereo imagery or radar | Terrain, drainage, flood modelling |
| Radar and night-light products | SAR scenes; night-time radiance | Flood extent, subsidence; urban activity proxy |
Aerial photographs are vertical (camera axis within a few degrees of the plumb line), low oblique (horizon not visible) or high oblique (horizon visible). For a vertical photograph the scale is S = f/H = photo distance/ground distance, f being the focal length and H the flying height above ground; on rising ground it becomes f/(H − h) and so increases. With f = 150 mm and H = 3,000 m, S = 0.15/3,000 = 1:20,000, and 62 mm on the photograph is 62 mm × 20,000 = 1,240 m on the ground. Survey flights give about 60 % forward overlap and 20 to 30 % side overlap.
Relief displacement. On a vertical photograph, features standing above the datum are shifted radially outward from the nadir (the point directly below the camera): d = r·h/H, where r is the radial distance of the top of the feature from the nadir, h the feature’s height and H the flying height above the feature’s base. It is zero at the nadir and grows with distance from it and with height, and it falls as H rises. For r = 90 mm, h = 40 m and H = 2,000 m, d = 90 × 40/2,000 = 1.8 mm. The same relation gives a feature’s height from its measured displacement.
Stereoscopy and photogrammetry. Two overlapping photographs taken from different exposure stations, viewed so that each eye sees one, give a three-dimensional model. Higher points show larger parallax, and the difference in parallax gives height: h = H·Δp/(p + Δp), with p the parallax at the base and Δp the extra parallax at the top (H = 1,800 m, p = 88 mm, Δp = 2 mm give h = 1,800 × 2/90 = 40 m). Photogrammetry thus produces contours, DEMs, 3D city models and orthophotos, in which relief displacement and tilt have been removed so that distances can be measured as on a map. Drone photographs are processed the same way by structure-from-motion software, and lidar yields a surface model (tops of trees and roofs) and a terrain model (bare earth).
5. Remote sensing in urban and regional studies
| Planning question | Data | Method and output |
|---|---|---|
| How fast and in which direction is the city growing? | Multi-date multispectral imagery | Classify built-up land on each date; compare |
| What is the existing land cover for the master plan? | High-resolution imagery with ground truth | Supervised or object-based classification |
| Where are the urban heat islands? | Thermal band: land surface temperature | Relate temperature to green cover and density |
| Where are informal settlements? | Very-high-resolution imagery | Roof size, density and irregular pattern; manual or ML detection |
| Are lakes and green areas being lost? | NDVI, NDWI time series | Track shrinking water and tree cover; flag encroachment |
| Which areas flood? | Radar scenes, before-and-after optical, DEM | Flood extent and flood-prone zones |
| What is happening in the region? | Coarse time series (MODIS, Landsat), DEM | Crop and forest mapping, watersheds, drought monitoring |
| Which properties and assets exist? | Drone and aerial imagery | Property-tax mapping, utility asset mapping, village settlement mapping |
Change detection compares dates, either by classifying each date and cross-tabulating the results into a from–to matrix (post-classification comparison) or by differencing the images. It needs images that are co-registered, of the same season and ideally the same sensor. Errors in each classified map compound in the comparison, and clouds, shadows and mixed pixels (a coarse pixel straddling several covers) create false change.
In regional studies the same imagery supports resource inventories (crops, forests, wetlands), watershed and drainage delineation, agro-climatic and drought assessment and corridor selection, while at city scale it supplies the up-to-date base map on which a master plan, a utility network or a property register is built.
6. GIS in planning: georeferencing and storage of spatial data
A GIS captures, stores, manages, analyses and displays spatially referenced data; its parts are hardware, software, data, people and procedures. In planning it serves land-suitability and master-plan base maps, land-use monitoring, utility and asset mapping, property-tax records, transport accessibility, disaster-risk zoning and public web maps. Its distinctive strength is the overlay of many layers on one coordinate frame, so that a question about location can be answered across all of them.
Georeferencing assigns real-world coordinates to an image or map. A coordinate reference system combines a datum (the reference ellipsoid) with a coordinate system, either geographic (latitude and longitude in degrees; WGS 84 is the datum used by GPS) or projected (planar metres, as in UTM). Every projection distorts: conformal ones keep shape and angles, equal-area ones keep area, so use an equal-area projection to compute areas. The steps are: pick ground control points (GCPs) identifiable in both image and reference, such as road intersections; fit a transformation (an affine one has six parameters, so three non-collinear GCPs are the minimum, and more are used to estimate error); check the RMSE = √(mean of dx² + dy²), ideally below one pixel; and resample. Nearest-neighbour resampling keeps original values, so use it for classified maps; bilinear or cubic resampling smooths and suits continuous imagery.
| Feature | Raster | Vector |
|---|---|---|
| Model | Grid of equal cells, each with one value | Points, lines and polygons from coordinates, with an attribute table |
| Best for | Continuous surfaces (elevation, temperature) and imagery | Discrete features: parcels, roads, wards, utilities |
| Precision | Limited by cell size; halving it gives four times the cells | Exact coordinates; crisp boundaries |
| Size | Rows × columns × bits/8 bytes; grows fast | Compact when features are few |
| Analysis | Map algebra, surface analysis | Network analysis, topology, exact length and area |
Topology stores spatial relationships explicitly: connectivity (lines meet at nodes), adjacency (the polygon on the left and right of each arc) and containment (islands and holes). It lets a GIS detect gaps, overlaps and dangling lines, find neighbours and route along a network. Plain shapefiles carry no topology, which has to be checked by rules. Raster arithmetic: a 12 km × 9 km area at 30 m cells has (12,000/30) × (9,000/30) = 400 × 300 = 120,000 cells; at 16 bits (2 bytes) the file holds 240,000 bytes, and at 15 m cells there would be 480,000 cells.
7. Processing tools, and 2D, 3D and 4D analysis
| Tool | What it does | Planning example |
|---|---|---|
| Buffer | Zone within a set distance of points, lines or polygons | 500 m around transit stations; noise or setback zones |
| Overlay (intersect, union, clip, erase) | Combines layers; intersect keeps only the overlap with attributes of both; union keeps all | Parcels inside a flood zone; weighted suitability |
| Network analysis | Shortest path, service area, closest facility on a connected network with a cost such as time | Area reached by an ambulance in 8 minutes |
| Thiessen polygons | Polygons of points nearer to one site than any other | Nearest-facility catchments |
| Interpolation (IDW, kriging) | Estimates a surface from sample points | Air quality or land-value surfaces |
| Spatial join, zonal statistics | Moves or summarises attributes by location | Population per ward from a raster |
Areas of buffers follow geometry: a point buffer of radius r has area πr² (1 km radius: 3.14 km²); a line of length L buffered by r on each side has area 2rL + πr² with round ends; overlapping buffers are merged by dissolving. To list parcels within 500 m of a metro line, buffer the line first, then intersect with the parcels; intersecting the bare line with parcels returns only those it crosses.
2D analysis works on planimetric x, y data with attributes. 3D adds elevation. A DEM is a raster of ground heights; a TIN joins irregularly spaced points (x, y, z) into non-overlapping triangles, dense where terrain is complex and sparse where it is flat. A DSM includes trees and roofs, a DTM is bare ground. From a DEM come slope (rise/run: 9 m over a 30 m cell is 30 %), aspect, contours, hillshade, viewshed, watersheds and cut-and-fill volumes. Truly 3D city models carry building heights for sunlight, shadow, view and noise studies.
4D means 3D plus time: time series of imagery and sensor feeds that show how a place changes. Urban growth models such as cellular automata and Markov chains use past change to simulate future land cover (a Markov model takes a transition matrix, so the next state is the current state times that matrix); a digital twin keeps a 3D city model updated by live data.
8. Databases, SQL and spatial queries
A database management system (DBMS) defines, stores, retrieves and protects data for many users. In the relational model data sit in tables: a row is a record and a column a field. A primary key identifies each row uniquely; a foreign key holds another table’s primary key and so links tables (a ward_id in a school table points to the ward). Normalisation removes repeated data. A GIS layer is such a table with a geometry column, and spatial DBMSs such as PostgreSQL with PostGIS add geometry types and spatial indexes.
SQL reads as SELECT columns FROM table WHERE row-condition GROUP BY column HAVING group-condition ORDER BY column. Aggregates are COUNT, SUM, AVG, MIN and MAX. The logical order is FROM and JOIN, then WHERE, then GROUP BY, then HAVING, then SELECT: WHERE filters rows before grouping, HAVING filters groups after it. COUNT(*) counts rows, while COUNT(column) skips NULLs. An INNER JOIN keeps only matching rows; a LEFT JOIN keeps every left row and fills NULL where there is no match.
Trace on this data. Table wards(ward_id, zone, pop): (1, N, 12000), (2, N, 8000), (3, S, 15000), (4, S, 5000), (5, E, 9000). Table schools(school_id, ward_id): (1, 1), (2, 1), (3, 3), (4, 3), (5, 3), (6, 5).
| Query | Result |
|---|---|
| Query 1: SELECT COUNT(*) FROM wards WHERE pop > 8000 | 3 (wards 1, 3 and 5; ward 2 has exactly 8000) |
| Query 2: SELECT zone, SUM(pop) FROM wards GROUP BY zone | N 20000; S 20000; E 9000 |
| Query 3: SELECT zone, COUNT() FROM wards WHERE pop >= 8000 GROUP BY zone HAVING COUNT() >= 2 | One row: N 2 (WHERE leaves wards 1, 2, 3, 5, so S has 1 and E has 1) |
| Query 4: SELECT COUNT(*) FROM wards w JOIN schools s ON w.ward_id = s.ward_id | 6 (one row per school; wards 2 and 4 drop out) |
| Query 5: query 4 again, with LEFT JOIN | 8 (6 matches plus one NULL row each for wards 2 and 4) |
Spatial queries ask about location relations rather than attribute values: does a parcel intersect, lie within or touch a zone; what lies within 500 m; which facility is nearest. In spatial SQL these are predicates and functions such as ST_Intersects, ST_Within, ST_Distance and ST_Buffer; for example, parcels inside a flood zone are selected with WHERE ST_Intersects(parcels.geom, flood.geom). A spatial join transfers attributes by location, and a spatial index (R-tree on bounding boxes) keeps such queries fast.
9. Machine learning and smart-city IoT
Supervised learning trains on labelled examples (inputs with known outputs): classification predicts a category (land-cover class, building or not) and regression a number (rent, travel time); methods include decision trees, random forests, support vector machines and neural networks. Unsupervised learning finds structure without labels: clustering (k-means) to group neighbourhoods into types, or principal components to compress bands. Data are split into training and test sets (for example 70:30 or 80:20); the test set must stay unseen until the final check, and cross-validation repeats the split. Overfitting is a model that memorises noise: high training accuracy, much lower test accuracy; remedies are more data, a simpler model, regularisation and cross-validation. Because neighbouring pixels are alike, a random split lets test pixels sit beside training pixels and inflates accuracy, so test on spatially separate areas.
For a yes/no detector the confusion matrix counts true positives (TP), false positives (FP), false negatives (FN) and true negatives (TN). Accuracy = (TP + TN)/N; precision = TP/(TP + FP), the share of flagged items that are right; recall = TP/(TP + FN), the share of real items found; F1 = 2PR/(P + R). Example: TP = 40, FP = 10, FN = 20, TN = 130 give precision 40/50 = 0.80, recall 40/60 = 0.67, accuracy 170/200 = 0.85 and F1 = 0.73. When the target is rare, accuracy misleads: a model that finds no informal settlement at all is 98 % accurate if they cover 2 % of the area.
- Uses in planning: land-cover classification and building-footprint extraction from imagery; informal-settlement detection; traffic and demand forecasting; rent and land-price prediction; urban-growth simulation.
- Cautions: biased or sparse training data, poor transfer to other cities, spatial leakage, and models that cannot explain their output when a planner must justify a decision.
Smart-city IoT links networked sensors and actuators to a data platform. Its layers are sensing (air-quality and noise sensors, water-flow and pressure sensors, smart meters, traffic counters, parking and bin-fill sensors, street-lighting controllers), connectivity (cellular, Wi-Fi, low-power wide-area networks such as LoRaWAN and NB-IoT), a platform (edge and cloud storage, data standards, analytics) and applications (dashboards and alerts at a command-and-control centre, as in the Integrated Command and Control Centres of India’s Smart Cities Mission). Examples: adaptive traffic signals, leak detection in water mains, route optimisation of waste collection and pollution hot-spot alerts. The difficulties are interoperability, sensor calibration and siting bias, privacy, cyber-security and maintenance cost.
10. Python basics, urban analytics and Spatial Data Infrastructure
Python basics. A variable is a name bound to a value (int, float, str, bool, list, tuple, dict). Operators: + − * and (power); / always gives a float (7 / 2 = 3.5); // is floor division (7 // 2 = 3) and % the remainder (7 % 2 = 1). Lists are indexed from 0, a negative index counts from the end, and a slice a[i:j] includes i but excludes j; range(start, stop, step) also excludes stop. Indentation marks blocks; if, elif and else choose; for loops over a list or a range; def defines a function and return sends back a value (a function without return gives None).
| Code | Output |
|---|---|
| Code 1: print(7 // 2, 7 % 2, 2 3) | 3 1 8 |
| Code 2: a = [10, 20, 30, 40, 50]; print(a[1:4], a[-1]) | [20, 30, 40] 50 |
| Code 3: print(list(range(2, 10, 3))) | [2, 5, 8] |
| Code 4: pop = [12, 8, 15, 5, 9]; total = 0; then for p in pop: if p > 8: total += p; then print(total) | 36 (12 + 15 + 9) |
In planning work Python is used through libraries: NumPy for arrays (NDVI of a whole image in one line, (nir − red)/(nir + red)), pandas for tables, GeoPandas for vector layers, Rasterio for rasters, Matplotlib for charts and scikit-learn for machine learning. Expect questions to give a short loop or function and ask for its printed value, so trace it line by line and keep a running table of the variables.
Urban analytics applies data, models and visualisation to understand and plan cities. It moves through descriptive (dashboards of density and land use), diagnostic (why: regression, spatial autocorrelation by Moran’s I, which lies roughly between −1 and +1, and hot-spot analysis), predictive (machine learning, growth models) and prescriptive (scenarios, optimisation, location–allocation) steps. Typical tools are accessibility isochrones, kernel-density maps and space syntax, which measures how connected and integrated each street is in the network and relates it to movement. New sources (mobile traces, smart cards, GPS, social media) are rich but biased towards device owners and raise privacy issues.
A Spatial Data Infrastructure (SDI) is the framework of policies, institutions, standards, technology, data and people that lets geospatial data be found, shared and reused. Its components are framework data (boundaries, transport, hydrography, elevation, imagery, cadastre), metadata (data about the data, so that datasets can be discovered), interoperability standards (such as the Open Geospatial Consortium web services: WMS for maps, WFS for features, WCS for coverages), a geoportal or clearinghouse for access, and the policy and institutional arrangements covering custodianship, licensing, pricing and privacy. India’s National Spatial Data Infrastructure (NSDI) and the Bhuvan geoportal are national examples. An SDI avoids duplicated surveys and gives every department, from master planning to utilities, one consistent base.
Key takeaways
- Spatial resolution is pixel size (GSD = H × IFOV), radiometric resolution is 2ⁿ levels, and finer pixels cost swath and revisit. Sun-synchronous orbits give comparable illumination; geostationary orbits give continuous coarse views.
- NDVI = (NIR − Red)/(NIR + Red). Overall accuracy = diagonal/N; kappa = (po − pe)/(1 − pe) removes chance agreement; accuracy must be tested on independent samples.
- Photo scale S = f/H; relief displacement d = r·h/H (radially outward, zero at nadir, falls with flying height); stereo parallax gives height; orthophotos remove displacement.
- Remote sensing gives land cover, not land use. Georeferencing needs GCPs, an RMSE check and a resampling choice; raster size = rows × columns × bits/8, and halving the cell size quadruples cells.
- Vector stores exact features with topology; raster stores surfaces. DEM is a raster, TIN is triangles; DSM includes roofs, DTM is bare earth. Buffer first, then intersect. WHERE filters rows, HAVING filters groups, LEFT JOIN keeps unmatched left rows.
- Supervised learning needs labels, unsupervised does not; overfitting shows as training accuracy far above test accuracy. Precision = TP/(TP + FP), recall = TP/(TP + FN). Trace Python line by line; SDI means shared data, metadata and standards.
Practice questions (20)
Attempt each one before opening the answer. Every explanation names the tempting wrong option as well as the right one, because that is where marks are lost.
Why are most land-observation satellites placed in sun-synchronous orbits?
Show answer
Answer: C — They cross a latitude at about the same local solar time on each pass, so illumination is comparable
A sun-synchronous orbit makes the satellite cross each latitude at about the same local solar time, so shadows and brightness are comparable when images of different dates are compared. Fixed position above the equator and an altitude of about 36,000 km describe a geostationary satellite, which gives continuous but coarse views, not fine pixels.Healthy green vegetation has low reflectance in the red band but high reflectance in the near-infrared because
Show answer
Answer: A — chlorophyll absorbs red strongly, while the internal structure of the leaf scatters near-infrared strongly
Chlorophyll absorbs blue and red light for photosynthesis and the spongy cell structure of the leaf scatters near-infrared strongly, giving the sharp rise at about 0.7 µm. Leaf water absorbs mainly in the shortwave infrared, not in the near-infrared, so the water-based explanation is wrong; the atmosphere is not opaque in red.A city wants to reduce losses of treated water in its distribution network. Which smart-city IoT deployment fits this aim best?
Show answer
Answer: D — Flow and pressure sensors on pipes in metered districts, raising leak alerts at a control centre
Comparing inflow and outflow, and watching pressure, in each metered district shows where water is leaking, so the alert can be sent to a control centre. The other deployments are sound smart-city uses (air and noise monitoring, traffic management, waste logistics), but none measures the water network.A land-cover map of a region that is 90 per cent vegetation has an overall accuracy of 92 per cent but a kappa of only 0.45. The best explanation is that
Show answer
Answer: B — kappa removes chance agreement, which is high when one class dominates, so the map is weaker than 92 per cent suggests
If 90 % of the area is vegetation, a map that labelled nearly everything vegetation would already agree with the reference most of the time by chance (pe of about 0.85 here, since 0.45 = (0.92 − pe)/(1 − pe) gives pe = 0.85). Kappa = (po − pe)/(1 − pe) discounts that, so a 92 % overall accuracy can correspond to a modest kappa. Kappa uses the whole error matrix, not just the dominant class.A study area of 12 km × 9 km is stored as a single-band raster with 30 m cells and 16 bits per cell, uncompressed. Taking 1 KB = 1,000 bytes, the file size is about
Show answer
Answer: C — 240 KB
Rows × columns = (9,000/30) × (12,000/30) = 300 × 400 = 120,000 cells. At 16 bits = 2 bytes each, the file holds 240,000 bytes = 240 KB. The figure 120 KB forgets the second byte, 480 KB is the size at 15 m cells with 8 bits or the 30 m case at 32 bits, and 1,920 KB treats 16 bits as 16 bytes.A planner needs the parcels within 500 m of a proposed metro alignment, with each parcel cut at the 500 m limit and the attributes of both layers kept. The appropriate sequence is to
Show answer
Answer: D — buffer the alignment by 500 m and then intersect the buffer polygon with the parcel layer
A buffer turns the line into a 500 m wide zone, and intersecting that zone with the parcels keeps the part of each parcel inside it with the attributes of both layers. Intersecting the bare line with the parcels returns only the parcels it crosses, because a line has no width: this is the tempting shortcut.Which statement about terrain models is correct?
Show answer
Answer: A — A TIN joins irregularly spaced elevation points into triangles, so points can be dense on rugged ground and sparse on flat
A TIN is a vector surface of non-overlapping triangles whose vertices are the sampled (x, y, z) points, which can be placed densely where the terrain is complex. A DEM is the raster of uniform cells, and slope and aspect are derived from it routinely. The DSM/DTM statement is reversed: the DSM includes roofs and trees, the DTM is bare ground.Table wards(ward_id, zone, pop) holds (1, N, 12000), (2, N, 8000), (3, S, 15000), (4, S, 5000), (5, E, 9000). The query
SELECT zone, COUNT(*) FROM wards WHERE pop >= 8000 GROUP BY zone HAVING COUNT(*) >= 2;
returnsShow answer
Answer: B — one row: N with 2
WHERE runs first and drops ward 4 (5000 is below 8000), leaving wards 1, 2, 3 and 5. Grouping by zone gives N 2, S 1, E 1, and HAVING COUNT(*) >= 2 then keeps only N. Counting S as 2 forgets that WHERE removed ward 4 before the grouping; showing all three groups forgets the HAVING.A model flags 50 buildings as unauthorised. On inspection 40 of them are unauthorised, and a further 20 unauthorised buildings were not flagged. Because every field inspection is costly, the planner wants fewer false alarms. Which statement is correct?
Show answer
Answer: D — Precision is 0.80 and recall is 0.67, and the planner should aim to raise precision
TP = 40 and FP = 10 (50 flagged), FN = 20. Precision = 40/50 = 0.80 and recall = 40/60 = 0.67. False alarms lower precision, not recall, so when inspections are costly the target is higher precision. Swapping the two ratios, or tying false alarms to recall, are the usual errors.Which description best fits a Spatial Data Infrastructure (SDI)?
Show answer
Answer: A — A framework of policies, standards, institutions and metadata that lets geospatial data be found and shared
An SDI is the enabling framework (policy, standards, institutional arrangements, metadata, access technology and people), not any single product. A GIS package or a satellite programme may feed an SDI, and a land register may be one of its datasets, but none of them is the infrastructure itself.Which of the following statements about energy sources, sensors and the atmosphere are correct?
Show answer
Answer: A — Synthetic aperture radar can image the ground through cloud and at night; B — The thermal infrared window at about 8 to 14 µm is used to estimate land surface temperature; D — A passive sensor records reflected sunlight or emitted radiation instead of supplying its own energy
Radar uses microwaves that pass through cloud and carries its own illumination; the 8 to 14 µm window records emitted heat, hence surface temperature; and passive sensors rely on the Sun or on the surface’s own emission. Rayleigh scattering is stronger at shorter wavelengths, so blue is scattered more than red, which is why the sky is blue.Which of the following statements about vertical aerial photographs are correct?
Show answer
Answer: A — The image of a tall building is displaced radially outward from the nadir; B — For the same object and radial distance, a greater flying height gives a smaller relief displacement; D — Stereoscopic viewing needs two overlapping photographs taken from different exposure stations
Relief displacement d = r·h/H is outward from the nadir for features above the datum and falls as H increases; stereo models need two overlapping exposures. The scale S = f/(H − h) changes with ground elevation, so it is not uniform over hilly terrain; only over flat ground is it constant.Which of the following statements about spatial data storage and georeferencing are correct?
Show answer
Answer: A — Vector topology records connectivity and adjacency, which makes network routing and neighbour queries possible; B — Halving the cell size of a raster multiplies the number of cells by four; C — Nearest-neighbour resampling keeps the original class codes, so it suits classified rasters
Topology stores connectivity and adjacency; halving the cell size doubles rows and columns, so cells quadruple; and nearest-neighbour resampling does not invent new values, so class codes survive. Parcels with exact boundaries, lengths and areas are the natural job of the vector model, as a raster only approximates edges by its cell size.Which of the following statements about machine learning in urban planning are correct?
Show answer
Answer: A — Training accuracy far above test accuracy points to overfitting; B — K-means clustering is an unsupervised method because it needs no labelled examples; D — Supervised land-cover classification needs labelled training samples such as ground-truth polygons
A large gap between training and test accuracy is the signature of overfitting; k-means groups unlabelled data; supervised classification needs labelled samples. Using the test set repeatedly to tune the model leaks information from it into the model, so its score is no longer an honest estimate for unseen data. A separate validation set or cross-validation should be used for tuning.A vertical aerial photograph is taken with a camera of focal length 150 mm from a flying height of 3,000 m above flat ground. Two points are 62 mm apart on the photograph. Their ground distance, in metres, is ____.
Numerical answer — type the value.
Show answer
Answer: 1240
Scale S = f/H = 0.150/3,000 = 1/20,000. Ground distance = photo distance × 20,000 = 62 mm × 20,000 = 1,240,000 mm = 1,240 m. Check: 62 mm = 0.062 m, and 0.062 × 20,000 = 1,240 m.On a vertical photograph the image of the top of a 50 m tall tower is displaced radially by 4.0 mm. The top of the tower lies 80 mm from the nadir on the photograph. The flying height above the base of the tower, in metres, is ____.
Numerical answer — type the value.
Show answer
Answer: 1000
Relief displacement d = r·h/H, so H = r·h/d = 80 mm × 50 m / 4.0 mm = 1,000 m. The units of r and d cancel, leaving metres from h. Check: with H = 1,000 m, d = 80 × 50/1,000 = 4.0 mm.An accuracy assessment of a two-class map (urban, non-urban) uses 100 independent samples. Of the 60 samples the map calls urban, 50 are urban in the reference and 10 are not. Of the 40 samples the map calls non-urban, 20 are urban in the reference and 20 are not. Cohen’s kappa, correct to two decimal places, is ____.
Numerical answer — type the value.
Show answer
Answer: 0.35
Observed agreement po = (50 + 20)/100 = 0.70. Row totals (map): urban 60, non-urban 40. Column totals (reference): urban 50 + 20 = 70, non-urban 10 + 20 = 30. Chance agreement pe = (60 × 70 + 40 × 30)/100² = (4,200 + 1,200)/10,000 = 0.54. κ = (0.70 − 0.54)/(1 − 0.54) = 0.16/0.46 = 0.348, i.e. 0.35.A pixel has surface reflectance 0.52 in the near-infrared band and 0.08 in the red band. Its NDVI, correct to two decimal places, is ____.
Numerical answer — type the value.
Show answer
Answer: 0.73
NDVI = (NIR − Red)/(NIR + Red) = (0.52 − 0.08)/(0.52 + 0.08) = 0.44/0.60 = 0.733, i.e. 0.73. A value this high indicates dense, healthy vegetation. Using the simple ratio NIR/Red instead gives 6.5, far outside the −1 to +1 range that NDVI always lies in.Table wards(ward_id) holds the five ward ids 1, 2, 3, 4, 5. Table schools(school_id, ward_id) holds (1, 1), (2, 1), (3, 3), (4, 3), (5, 3), (6, 5). The query
SELECT COUNT(*) FROM wards w LEFT JOIN schools s ON w.ward_id = s.ward_id;
returns the value ____.Numerical answer — type the value.
Show answer
Answer: 8
Rows per ward in the LEFT JOIN: ward 1 has 2 schools (2 rows), ward 2 has none (1 row with NULLs), ward 3 has 3 (3 rows), ward 4 has none (1 row), ward 5 has 1 (1 row). Total = 2 + 1 + 3 + 1 + 1 = 8. An INNER JOIN would give only the 6 matching rows; COUNT(*) counts the NULL-padded rows too.What does this Python code print?
def f(n):s = 0for i in range(1, n + 1):if i % 3 != 0:s += ireturn sprint(f(7))Numerical answer — type the value.
Show answer
Answer: 19
range(1, 8) gives i = 1 to 7. The condition i % 3 != 0 skips the multiples of 3 (3 and 6). The loop adds 1 + 2 + 4 + 5 + 7 = 19, and the function returns 19. A total of 28 would be the sum of all seven values, forgetting the filter.