feat(transform): H3 catchment index for Marktpotenzial-Score v3
Add H3 res-4 regional catchment metrics (~15-18km radius, cell + 6 neighbours) to both the addressable market (25pts) and supply gap (30pts) components of location_opportunity_profile. Changes: - config.yaml: add h3 to DuckDB extensions (requires one-time INSTALL h3 FROM community on each machine) - dim_locations: add h3_cell_res4 column via h3_latlng_to_cell() - location_opportunity_profile: add hex_stats + catchment CTEs; update score formula to use catchment_population and catchment_padel_courts; expose catchment_population, catchment_padel_courts, catchment_venues_per_100k as output cols Motivation: local population underestimates functional market for mid-size cities (e.g. Oldenburg ~170K misses surrounding Gemeinden). H3 k_ring(1) captures the realistic driving-distance catchment (~462km²) consistently across both score components. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -215,6 +215,7 @@ SELECT
|
||||
l.location_slug,
|
||||
l.lat,
|
||||
l.lon,
|
||||
h3_latlng_to_cell(l.lat, l.lon, 4) AS h3_cell_res4,
|
||||
l.admin1_code,
|
||||
l.admin2_code,
|
||||
l.population,
|
||||
|
||||
Reference in New Issue
Block a user