Add newer version of municipalities #197
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new version of the municipalities auxiliary dataset.
The data is gotten from ISTAT's official municipalities datasets at:
https://www.istat.it/notizia/confini-delle-unita-amministrative-a-fini-statistici-al-1-gennaio-2018-2/
The chosen version is the 2021 dataset, which contains the relevant centroid for each municipality in a companion .xlsx file. The dataset has been pre-processed in order to subset, join and reproject into the proposed implementation.
This PR includes the
data/README.md
file, with a description of the new dataset, its provenance, pre-processing steps applied and how to load it into the system.The underlying schema for municipalities is also modified in order to expose two additional properties:
centroid_epsg_4326_lon
centroid_epsg_4326_lat
These are the coordinates of each municipality's centroid. These are included both in:
/api/v2/municipalities
endpoint/vector-tiles/municipalities/{z}/{x}/{y}
As an additional facility, this PR also includes an additional vector tile layer named
municipality-centroids
, available at/vector-tiles/municipality-centroids/{z}/{x}/{y}
that exposes the centroids as an individual layer. The frontend is thus free to choose how to show this information, as it can either get the centroid coords from the municipalities layer and then draw them or it can use the municipality-centroids vector tile layer directly.Here is an inspirational screenshot of these two vector tile layers rendered in QGIS:
Note how the location of each centroid is not at the geometric centroid of each feature, but at the designated location.
The backend implements this additional layer as a PostGIS materialized view that gets created when the municipality dataset is ingested into the system.
Ingestion of the new dataset continues to be done via our custom CLI command: