OnceDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/danizd/urbanviable/llms.txt
Use this file to discover all available pages before exploring further.
process_data.py has written galicia_scouting.geojson, the final ETL step converts it into a binary MBTiles file that TileServer GL can serve as a Mapbox Vector Tile (MVT) endpoint. This conversion is done by Tippecanoe, a CLI tool by Felt (formerly Mapbox) that tiles GeoJSON into a spatially indexed, multi-zoom-level binary format. The whole step takes under two minutes for a typical Galicia GeoJSON.
Command
From the project root:galicia_scouting.geojson exists and exits with an error message if it does not, preventing accidental overwrite of a previously valid MBTiles file.
generate_tiles.sh (full source)
Tippecanoe parameter reference
| Parameter | Value | Rationale |
|---|---|---|
--output | galicia_scouting.mbtiles | Destination file path. Deleted first with rm -f to avoid corrupt state on re-runs. |
--layer | "secciones" | Critical. The internal vector layer name embedded in the MBTiles. Must match source-layer: "secciones" in MapViewer.jsx and REACT_APP_LAYER_NAME in .env. |
--minimum-zoom | 6 | Zoom 6 shows all of Galicia in a single viewport — the broadest useful view. |
--maximum-zoom | 14 | Street-level detail. Beyond zoom 14 the census polygons contain no additional spatial information. |
--coalesce-densest-as-needed | (flag) | Merges the densest adjacent polygons when a tile exceeds the size limit. Correct for polygon data — see warning below. |
--extend-zooms-if-still-dropping | (flag) | Automatically increases the effective maximum zoom if features are still being dropped at zoom 14. Prevents data loss without requiring a hard-coded higher maximum. |
--simplification | 2 | Mild Douglas-Peucker geometric simplification. Reduces tile size without visibly degrading census polygon borders at any zoom level in the range 6–14. |
--include=cusec | (repeated) | Explicit allowlist of properties to embed in tiles. Excludes all intermediate ETL columns (area_km2, densidad, ratio_comercial, etc.), reducing tile size by up to 60%. |
--include=renta_norm … | (×11) | One flag per column in the output contract. Must stay in sync with COLS_OUTPUT in process_data.py. |
--coalesce-densest-as-needed is the correct flag for polygon data. Its counterpart --drop-densest-as-needed silently removes the densest features from overcrowded tiles — appropriate for point datasets where individual POIs can be sacrificed. For census section polygons, dropping features would leave gaps in the choropleth map. --coalesce-densest-as-needed instead merges adjacent dense polygons, which preserves full coverage at every zoom level.Expected output size
| Scenario | Approximate MBTiles size |
|---|---|
| Sources 1 + 2 only (MVP) | 15–20 MB |
| All four sources | 25–40 MB |
Deployment after tile generation
After the MBTiles file is generated, upload it (and the metadata file) to the server withscp. TileServer GL detects the updated file without requiring a container restart:
curl command fetches the TileJSON descriptor that TileServer GL auto-generates for every MBTiles file it finds. A valid response looks like:
vector_layers[0].id equals "secciones" and that all 11 fields are listed. If any field is missing, re-check the corresponding --include flag in generate_tiles.sh and ensure the column exists in galicia_scouting.geojson.