Processing ISTAT data and OGC of the National Geoportal - PART 2

Processing ISTAT data and OGC of the National Geoportal - PART 2

A few days ago I published an article in which I make a personal reflection on the floodable areas in Italy; the analyzes carried out were possible thanks to ISTAT and MiTE data. With this article I want to continue to talk to you about the problems I encountered in the analysis of that data. If you missed PART 1 you can find it here.

With the previous steps I managed to obtain a single polygonal vector of the census cells with the data relating to the total resident population (column P1).

You can see at a glance that we have colonized the entire Italian territory.

Problem 3

The flood WFS gives strange results.

I reported it to the Gfoss list, comparing the result with a WFS coming from my personal Geoserver which doesn't give me problems. Here is the error that appears when I try to download data using OWSLib:


gdf = gpd.read_file('wfs_data.gml', driver='GML', layer='ITH2018_HPH_Extension')
/home/max/.cache/pypoetry/virtualenvs/drakonotebook-Mbf4coiv-py3.8/lib/python3.8/site-packages/geopandas/io/file.py:238: in _read_file columns = list(features.schema["properties"])
/home/max/.cache/pypoetry/virtualenvs/drakonotebook-Mbf4coiv-py3.8/lib/python3.8/site-packages/fiona/collection.py:208: in schema self._schema = self.session.get_schema() fiona/ogrext.pyx:719: in fiona.ogrext.Session.get_schema ???

??? And fiona.errors.UnsupportedGeometryTypeError: 10

fiona/_geometry.pyx:81: UnsupportedGeometryTypeError

To download the GML I used exactly the same steps indicated in the OWSLib documentation.

Following instructions from Maurizio Napolitano I checked whether the problem depended on the inversion of the axes but unfortunately that is not (only) the problem. How does it make me always notice Maurizio the problem could depend on Fiona but I wasn't able to find the specific bug in the repository. I'm currently unable to download WFS from the GPN and I don't know if it's possible. It's their problem or Fiona's.

In the end I got around the problem by downloading the WFS layers one by one using QGIS. As written previously these data require topological corrections before being used.

End of the adventure!