#OpenStreetMap

15 posts

QGIS 3.40 with the Browser panel listing XYZ Tiles connections from basemap.at to IGN Plan IGN v2, and the map showing Esri World Imagery of Keswick and Derwentwater in the Lake District with Esri road and place-name overlays on top.

Tutorial QGIS

XYZ tile URLs for QGIS: 27 free basemaps, checked and ready to load

A checked list of XYZ tile URLs for QGIS: OpenStreetMap styles, Esri imagery and overlays, Sentinel-2 cloudless, and national basemaps for the US, the Netherlands, France, Austria, Switzerland and Germany. Each has its max zoom, attribution and terms, plus a connections file that adds all 27 at once and an open satellite hybrid.

Beginner 13 min read

Situation map of L'Horta Sud south-west of Valencia on 2 November 2024, showing the blue flood extent and affected towns

Tutorial Python Part 1 of 6

Rapid situational mapping from open data in Python: the Valencia floods of 29 October 2024

Build a first situation map of a disaster from open data in Python. For the Valencia DANA floods of October 2024, read the Copernicus EMS activation and its first flood delineation, add municipalities, modelled rainfall from Open-Meteo and OpenStreetMap hospitals, schools, fire stations and bridges as they were on the morning of the flood, then make a one-page map, an interactive Folium map and a 'what we know' table.

Beginner 16 min read

Chart of cumulative geocoding error on a log distance scale for five methods, with name search and the combined rule most accurate

Tutorial Python

Geocoding in Python: batch and reverse geocoding with geopy, Nominatim and postcodes.io

Batch geocode all 192 open schools in Sheffield in Python with geopy and OpenStreetMap Nominatim (1 request per second, a custom user agent and an on-disk cache) and with postcodes.io bulk postcode lookups, reverse geocode a sample, and measure every method honestly against the Department for Education's own coordinates. Covers free text against structured queries, failure modes, cross-checking two geocoders, and the licensing of geocoded results.

Beginner 14 min read

Two maps of walking time from Pen-y-Pass on Yr Wyddfa, shaded purple to red with 30-minute contours, comparing isotropic and slope-aware cost

Tutorial Python

Least-cost path analysis in Python: cost surfaces and walking routes up Yr Wyddfa

Build a walking cost surface from real slope (Copernicus GLO-30) and land cover (ESA WorldCover), compute the accumulated cost surface and the least-cost path with scikit-image's MCP_Geometric, add a direction-aware Dijkstra version with SciPy, and compare the routes with the straight line and the OpenStreetMap footpaths from Pen-y-Pass to the summit of Yr Wyddfa (Snowdon).

Intermediate 14 min read

Choropleth of Greater Manchester's 215 wards coloured by bus stops per square kilometre, from purple to dark red, with borough boundaries

Tutorial Python Part 2 of 3

Spatial joins in GeoPandas: sjoin, predicates, sjoin_nearest and point in polygon

A practical guide to spatial joins in GeoPandas with real Greater Manchester data: 13,187 NaPTAN bus stops, 1,386 OpenStreetMap schools, 215 ONS wards and 1,702 LSOAs. Covers point in polygon with sjoin, predicates, counts per polygon, how='left'/'inner'/'right', sjoin_nearest with max_distance, clip and overlay, and a timing comparison of a naive loop against the spatial index.

Beginner 12 min read

Two hillshaded maps of a 30 km circle round a wind farm, showing the cumulative zone of theoretical visibility by number of turbines seen

Tutorial Python

Viewshed analysis in Python: line of sight and a wind farm ZTV with GDAL and numpy

Run a viewshed analysis in Python on a real DEM: compute what one wind turbine can see with gdal.ViewshedGenerate, rebuild the same line-of-sight algorithm in numpy, correct for earth curvature and refraction, build a cumulative zone of theoretical visibility (ZTV) from 26 turbines, draw line-of-sight profiles, and measure how much trees and buildings in a LiDAR DSM shrink a bare-earth viewshed.

Intermediate 16 min read

3D block model of downtown Madison with buildings extruded to their lidar heights, coloured blue to dark red by height around the Capitol dome

Tutorial Python

Extract building footprints and heights from LiDAR in Python (USGS 3DEP, downtown Madison)

Turn classified LiDAR into building footprints with heights in Python: stream USGS 3DEP COPC tiles, build a DTM and a building nDSM from ASPRS class 6 points, polygonise and regularise the mask, split roofs at height steps, compute height statistics per building, score the result against OpenStreetMap with IoU, and export a GeoPackage and a 3D view.

Intermediate 15 min read

An aerial image of a housing estate covered in 306 coloured Segment Anything masks beside the same image without masks

Tutorial Python Part 1 of 11

Segment Anything on satellite and aerial imagery in Python: a samgeo tutorial

Run Meta's Segment Anything Model on high-resolution aerial imagery with segment-geospatial (samgeo), on a CPU. Generate masks automatically, vectorise them to a GeoPackage, filter them by area, shape and NDVI to find buildings, and prompt SAM with points and boxes, checked against OpenStreetMap.

Intermediate 14 min read

Landsat 9 true-colour image of Greater London beside its land surface temperature map, with the city markedly hotter than the surrounding fields

Tutorial Python

Land surface temperature from Landsat in Python: mapping London's urban heat island

Calculate land surface temperature from Landsat 8 and 9 Collection 2 Level-2 data in Python: ST_B10 scale and offset, QA_PIXEL cloud masking, LST by land cover and NDVI, an urban-rural transect, hotspots with OpenStreetMap and an honest comparison with air temperature, for London in the July 2022 heatwave.

Intermediate 17 min read