-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Inconsistent Behaviour when processing WFS dataset
This dataset:
contains one WFS resource URL:
https://data.gov.au/geoserver/manningham-maternal-and-child-health-centres/wfs
The WFS resource URL is previewed correctly by Magda version Map preview. But failed to render when click the "Open in NationalMap button".
Noticed that the national map tries to send the following request:
https://data.gov.au/geoserver/manningham-maternal-and-child-health-centres/wfs?service=WFS&request=GetFeature&version=1.1.0&outputFormat=JSON&srsName=urn%3Aogc%3Adef%3Acrs%3AEPSG%3A%3A4326&maxFeatures=1000
The TYPENAME parameter is missing from the above request. Thus, cause 400 error.
The list of available feature types is actually available in the response of the inital getCapbility request.
On the other hand, if we manually supply the WFS URL via "Upload" function of the national map, it will be rendered correctly.
Noticed that national map will generate correct request with TYPENAME parameter:
https://data.gov.au/geoserver/manningham-maternal-and-child-health-centres/wfs?service=WFS&request=GetFeature&typeName=manningham-maternal-and-child-health-centres%3Ackan_37dda99d_83d9_4261_8c5d_c70a5d38cc86&version=1.1.0&outputFormat=JSON&srsName=urn%3Aogc%3Adef%3Acrs%3AEPSG%3A%3A4326&maxFeatures=1000
I think what we should do are:
- The same WFS processing logic of the "UPLOAD" function should always be used to avoid incorrect request URLs being generated.
- If the original URL comes with a
typenameparameter, a WFS item should be created with thetypenameparameter specified by the query parameter - If the original URL doesn't come with a
typenameparameter & there is only one feature type available in the getCapbility response, we should create a WFS item with thetypenameparameter = the only available feature type - If the original URL doesn't come with a typename parameter & there is more than one feature available, a WFS group item should be created.
- If the original URL comes with a
We probably want to adopt a similar layerName handling behaviour of this PR: