#DuckDB

5 posts

Line chart from 2017 to 2026 of radar backscatter over the Homewood and Chicago Chatham Walmart car parks relative to the open stores, both falling by about 1.5 to 2 dB after the stores closed in spring 2023

Tutorial Python Part 2 of 3

Car-park occupancy from Sentinel-1 radar in Python: Walmart store closures as a natural experiment

Measure how busy retail car parks are from free Sentinel-1 radar. Draw 45 Walmart Supercenter car parks in Chicagoland from Overture Maps, mask them to paved ground with NAIP aerial imagery, read every ascending pass since 2017, and test the signal on the 2023 store closures with a difference-in-differences and a placebo test.

Advanced 12 min read

Two maps of Glasgow with HDBSCAN clusters drawn as translucent coloured polygons over their points and grey noise points between them

Tutorial Python

DBSCAN and HDBSCAN spatial clustering in Python: finding Glasgow's dining districts

Cluster GPS and point-of-interest data in Python with DBSCAN and HDBSCAN: use the haversine metric on latitude and longitude or plain metres on a projected grid, choose eps with a k-distance plot, handle variable density with HDBSCAN, draw convex and concave hull polygons, treat noise properly, read silhouette and DBCV with care, and scale up with a BallTree. Uses 3,950 real Overture Maps restaurants, cafés and bars in Glasgow.

Intermediate 18 min read

Two maps of annual solar irradiation on roofs over a hillshade, from blue at 300 kWh/m² to red at 1,100 kWh/m² on south-facing slopes

Tutorial Python

Rooftop solar potential from LiDAR in Python: pvlib, PVGIS and shading for every roof

Estimate rooftop solar potential in Python for 2,148 buildings in Manchester: take a 1 m Environment Agency LiDAR DSM and Overture Maps footprints, compute roof slope and aspect, trace horizon angles for shading from neighbours and trees, build a sun map from a PVGIS typical year with pvlib, check it against pvlib's Perez model and PVGIS, then estimate kWp and kWh per year per roof and rank the best roofs.

Advanced 14 min read

Map of central Bristol with 144,965 Overture building footprints coloured by subtype, most of them residential, and the River Avon in blue

Tutorial Python Part 1 of 2

Query Overture Maps with DuckDB spatial and GeoParquet in Python

Pull Bristol's 144,965 buildings and 20,727 places straight from the Overture Maps GeoParquet release with DuckDB, run spatial SQL joins and H3 aggregation, load the result into GeoPandas, write GeoParquet 1.1, and time it against Shapefile, GeoPackage and FlatGeobuf.

Intermediate 13 min read