Files
padelnomics/transform/sqlmesh_padelnomics/models/serving/city_venue_locations.sql
Deeman edf678ac4e 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>
2026-03-04 15:07:06 +01:00

27 lines
657 B
SQL

-- 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