Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add newer version of municipalities #197

Merged

Conversation

ricardogsilva
Copy link

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:

  • the already existing /api/v2/municipalities endpoint
  • the vector tile endpoint at /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:

image

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:

arpav-ppcv bootstrap municipalities <dataset-file-path>

@ricardogsilva ricardogsilva marked this pull request as ready for review August 20, 2024 19:31
@francbartoli francbartoli merged commit 5358dc5 into geobeyond:main Aug 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use newer municipalities layer
2 participants