InseeFrLab / pynsee

pynsee package contains tools to easily search and download french data from INSEE and IGN APIs
https://pynsee.readthedocs.io/en/latest/
MIT License
67 stars 8 forks source link

geodata returns exception traceback as dataframe (missing rights) #161

Closed tgrandje closed 1 year ago

tgrandje commented 1 year ago
from pynsee.geodata import get_geodata
com = get_geodata("ADMINEXPRESS-COG-CARTO:commune")
print(com.to_json())
>>>    {"status":{"0":403},"comment":{"0":"<ExceptionReport><Exception exceptionCode=\"MissingRights\">No rights for this ressource or ressource does not exist<\/Exception><\/ExceptionReport>"}}

The link prepared by geodata/_get_geodata.py is : 'https://wxs.ign.fr/administratif/geoportail/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TYPENAME=ADMINEXPRESS-COG-CARTO:commune&srsName=EPSG:3857&OUTPUTFORMAT=application/json&COUNT=1000'

tgrandje commented 1 year ago

@hadrilec can you confirm this behaviour and do you think this is (already) linked to https://github.com/InseeFrLab/pynsee/issues/159 (I'm a bit suspicious about it, that would be a strange coincidence...) ?

EDIT If that's the case, maybe we should drop correcting this bug and start anew directly with the geoplateforme...

hadrilec commented 1 year ago

Hi,

I have noticed some weird output from this data identifier. I would suggest to use the following code:

from pynsee import *
com = get_geodata('ADMINEXPRESS-COG-CARTO.LATEST:commune')