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

Inconsistent Behaviour when processing WFS dataset #1171

Open
t83714 opened this issue Aug 18, 2022 · 0 comments
Open

Inconsistent Behaviour when processing WFS dataset #1171

t83714 opened this issue Aug 18, 2022 · 0 comments
Labels

Comments

@t83714
Copy link
Member

t83714 commented Aug 18, 2022

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 the typename 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 the typename 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.

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

TerriaJS/terriajs#6255

@meh9 meh9 added the bug label Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants