nationalmap
nationalmap copied to clipboard
Inconsistent Behaviour when processing WFS dataset
Inconsistent Behaviour when processing WFS dataset
This dataset:
https://data.gov.au/dataset/ds-dga-37dda99d-83d9-4261-8c5d-c70a5d38cc86/distribution/dist-dga-4457bb2f-cb99-4a30-9a3e-1157603ee126/details?q=
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
typename
parameter, a WFS item should be created with thetypename
parameter specified by the query parameter - If the original URL doesn't come with a
typename
parameter & there is only one feature type available in the getCapbility response, we should create a WFS item with thetypename
parameter = 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:
https://github.com/TerriaJS/terriajs/pull/6255