TerriaJS / nationalmap

Australia's NationalMap
https://nationalmap.gov.au
122 stars 45 forks source link

Inconsistent Behaviour when processing WFS dataset #1171

Open t83714 opened 1 year ago

t83714 commented 1 year ago

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:

We probably want to adopt a similar layerName handling behaviour of this PR:

https://github.com/TerriaJS/terriajs/pull/6255