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

Python Exception: URL misses Ampersand when adding multiple features #84

Open
Erkan70 opened this issue Jun 6, 2019 · 1 comment
Open

Comments

@Erkan70
Copy link

Erkan70 commented Jun 6, 2019

When I add below Inspire Harmonised WFS service I run into a Python error. The URL seems to use Comma's instead of Ampersands for the TypeNames.

https://geodata.nationaalgeoregister.nl/inspire/tn-a/wfs?service=WFS&v
ersion=2.0.0&request=GetFeature&typenames=tn-a%3AAerodromeArea%2Ctn-a%
3AAerodromeNode%2Ctn-a%3AElementWidth%2Ctn-a%3ARunwayArea%2Ctn-a%3ATax
iwayArea%2Ctn-a%3ATouchDownLiftOff

Error log:
Er is een fout opgetreden bij het uitvoeren van Python code:

requests.exceptions.HTTPError: 500 Server Error: for url: https://geodata.nationaalgeoregister.nl/inspire/tn-a/wfs?service=WFS&version=2.0.0&request=GetFeature&typenames=tn-a%3AAerodromeArea%2Ctn-a%3AAerodromeNode%2Ctn-a%3AElementWidth%2Ctn-a%3ARunwayArea%2Ctn-a%3ATaxiwayArea%2Ctn-a%3ATouchDownLiftOff
Traceback (most recent call last):
File "C:/Users/EfekErkan/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gml_application_schema_toolbox\gui\load_wizard_xml.py", line 36, in validatePage
gml_path = self.wizard().gml_path()
File "C:/Users/EfekErkan/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gml_application_schema_toolbox\gui\load_wizard.py", line 181, in gml_path
self._wfs_page.download(gml_path)
File "C:/Users/EfekErkan/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gml_application_schema_toolbox\gui\load_wizard_wfs.py", line 227, in download
self.download_features(output_path)
File "C:/Users/EfekErkan/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gml_application_schema_toolbox\gui\load_wizard_wfs.py", line 260, in download_features
response = wfs.getfeature(**params)
File "C:\PROGRA1\QGIS31.6\apps\Python37\lib\site-packages\owslib\feature\wfs200.py", line 232, in getfeature
username=self.username, password=self.password)
File "C:\PROGRA1\QGIS31.6\apps\Python37\lib\site-packages\owslib\util.py", line 196, in openURL
req.raise_for_status()
File "C:\PROGRA1\QGIS31.6\apps\Python37\lib\site-packages\requests\models.py", line 939, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: for url: https://geodata.nationaalgeoregister.nl/inspire/tn-a/wfs?service=WFS&version=2.0.0&request=GetFeature&typenames=tn-a%3AAerodromeArea%2Ctn-a%3AAerodromeNode%2Ctn-a%3AElementWidth%2Ctn-a%3ARunwayArea%2Ctn-a%3ATaxiwayArea%2Ctn-a%3ATouchDownLiftOff

Python versie: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
QGIS versie: 3.6.2-Noosa Noosa, 656500e0c4

Python pad:
C:/Users/EfekErkan/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gml_application_schema_toolbox\extlibs
C:/PROGRA1/QGIS31.6/apps/qgis/./python
C:/Users/EfekErkan/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/EfekErkan/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA1/QGIS31.6/apps/qgis/./python/plugins
C:\Program Files\QGIS 3.6\bin\python37.zip
C:\PROGRA1\QGIS31.6\apps\Python37\DLLs
C:\PROGRA1\QGIS31.6\apps\Python37\lib
C:\Program Files\QGIS 3.6\bin
C:\PROGRA1\QGIS31.6\apps\Python37
C:\PROGRA1\QGIS31.6\apps\Python37\lib\site-packages
C:\PROGRA1\QGIS31.6\apps\Python37\lib\site-packages\win32
C:\PROGRA1\QGIS31.6\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA1\QGIS31.6\apps\Python37\lib\site-packages\Pythonwin
C:/Users/EfekErkan/AppData/Roaming/QGIS/QGIS3\profiles\default/python

@Erkan70 Erkan70 changed the title URL misses Ampersand when adding multiple features Python Exception: URL misses Ampersand when adding multiple features Jun 7, 2019
@nmtoken
Copy link

nmtoken commented Mar 3, 2020

URL seems to use Comma's instead of Ampersands for the TypeNames.

Comma separator is correct syntax, for a list of type names. WFS 2.0 follows OGC 09-026r2, 5.5

Parameters consisting of lists shall use the comma (",") as the delimiter between items in the list. In addition, multiple lists may be specified as the value of a parameter by enclosing each list in parentheses; "(",")".

EXAMPLE 1 This example shows a list of items.

PARAMETER=item1,item2,item3,item4a%2Citem4b

...

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

No branches or pull requests

2 participants