geobeyond / Arpav-PPCV-backend

Backend di Piattaforma Proiezioni Climatiche per il Nord-Est.
Creative Commons Attribution 4.0 International
0 stars 1 forks source link

Add newer version of municipalities #197

Closed ricardogsilva closed 3 weeks ago

ricardogsilva commented 3 weeks ago

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:

These are the coordinates of each municipality's centroid. These are included both in:

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>