Swiss amenity access

Straight-line distance from every built-up H3 cell (resolution 9, about 0.1 km²) in Switzerland to the nearest grocery store, public transport stop, school, health service, restaurant or café, and park. Computed from OpenStreetMap in PostGIS; the map reads one PMTiles file.

Score

050100

Each category gives full points within 250 m of the cell centre and none beyond 1,500 m, linear in between. The score is the mean of the six. Zoomed out: building-weighted mean per municipality.

Point lookup

Click the map. The panel calls /api/score and /api/nearest.

Pipeline

Geofabrik extract → osm2pgsql (flex, EPSG:2056) → PostGIS: GiST and partial GiST indexes, KNN (<->), ST_DWithin, ST_Subdivide → ogr2ogr → tippecanoe / tile-join → PMTiles. Orchestrated as a Dagster asset graph; the same steps run with make all.

Loading measured numbers…

API

GET /api/score?lat=47.3769&lon=8.5417

GET /api/nearest?lat=47.3769&lon=8.5417&category=transit&limit=5

Both read precomputed JSON shards keyed by H3 res-5 parent. No database runs at request time.

Data

swiss.pmtiles · zurich_cells.fgb · zurich_cells.geojson

Map data © OpenStreetMap contributors, ODbL. Basemap: OpenFreeMap, OpenMapTiles, © OpenStreetMap contributors. Distances are straight-line, not walking routes, and depend on how complete OSM is in each place.