feat(maps): Phase 4 — city venue dot map
New serving model: city_venue_locations joins dim_venues + dim_cities to expose lat/lon/court_count per venue for the city dot map endpoint. pseo_city_costs_de.sql: add c.lat, c.lon so city-cost articles have city coordinates for the #city-map data attributes. city-cost-de.md.jinja: add #city-map div (both DE and EN sections) after the stats strip. Leaflet init handled by article_detail.html. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
-- Per-venue lat/lon for the city detail dot map.
|
||||
-- Joins dim_venues to dim_cities to attach country_slug and city_slug
|
||||
-- (needed by the /api/markets/<country>/<city>/venues.json endpoint).
|
||||
-- Only rows with valid coordinates are included.
|
||||
|
||||
MODEL (
|
||||
name serving.city_venue_locations,
|
||||
kind FULL,
|
||||
cron '@daily',
|
||||
grain venue_id
|
||||
);
|
||||
|
||||
SELECT
|
||||
v.venue_id,
|
||||
v.name,
|
||||
v.lat,
|
||||
v.lon,
|
||||
v.court_count,
|
||||
v.indoor_court_count,
|
||||
v.outdoor_court_count,
|
||||
v.city_slug,
|
||||
c.country_slug
|
||||
FROM foundation.dim_venues v
|
||||
JOIN foundation.dim_cities c
|
||||
ON v.country_code = c.country_code AND v.city_slug = c.city_slug
|
||||
WHERE v.lat IS NOT NULL AND v.lon IS NOT NULL
|
||||
@@ -22,6 +22,9 @@ SELECT
|
||||
c.country_code,
|
||||
c.country_name_en,
|
||||
c.country_slug,
|
||||
-- City coordinates (for the city venue dot map)
|
||||
c.lat,
|
||||
c.lon,
|
||||
-- Market metrics
|
||||
c.population,
|
||||
c.padel_venue_count,
|
||||
|
||||
Reference in New Issue
Block a user