Skip to content

Handle WFS version mismatch#1039

Open
JakobMiksch wants to merge 3 commits into
geopython:masterfrom
JakobMiksch:wfs-version-mismatch
Open

Handle WFS version mismatch#1039
JakobMiksch wants to merge 3 commits into
geopython:masterfrom
JakobMiksch:wfs-version-mismatch

Conversation

@JakobMiksch
Copy link
Copy Markdown

@JakobMiksch JakobMiksch commented May 31, 2026

@geographika
Copy link
Copy Markdown
Contributor

Nice work - thanks @JakobMiksch ! Unless @tomkralidis has any further comments I'll merge in a day or so.

@domlowe
Copy link
Copy Markdown
Member

domlowe commented Jun 1, 2026

Just to say that the WFS version negotiation rules do allow the server to return alternative versions:
https://docs.ogc.org/is/04-094r1/04-094r1.html#15

But it is essentially a client decision how to deal with alternative versions - e.g. whether to accept it, ask for an alternative or cease communicating (as is the case in this PR).

@geographika
Copy link
Copy Markdown
Contributor

geographika commented Jun 1, 2026

Thanks for the details @domlowe. The warning is an improvement on simply failing when parsing using the incorrect class.
@JakobMiksch - what happens if no version is sent with the GetCapabilities request? I guess it uses the default "1.0".

@JakobMiksch
Copy link
Copy Markdown
Author

JakobMiksch commented Jun 1, 2026

@geographika

what happens if no version is sent with the GetCapabilities request? I guess it uses the default "1.0".

It would raise an exception as well. I have not handled this case.

@JakobMiksch
Copy link
Copy Markdown
Author

JakobMiksch commented Jun 1, 2026

Just to say that the WFS version negotiation rules do allow the server to return alternative versions: https://docs.ogc.org/is/04-094r1/04-094r1.html#15

But it is essentially a client decision how to deal with alternative versions - e.g. whether to accept it, ask for an alternative or cease communicating (as is the case in this PR).

If users rely on the current functionality, we could hide the new check behind a new opening argument, that is False by default. Something like this maybe:

wfs = WebFeatureService(
   url="https://www.geoproxy.geoportal-th.de/geoproxy/services/STRNETZ_wfs", 
   version="1.0.0", 
   strict_version=False # <-- NEW OPTIONAL ARGUMENT
)

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

Successfully merging this pull request may close these issues.

Malformed WFS Capabilities causes cryptic stack trace

4 participants