I'm trying to parse a Geography Markup Language (GML) string as returned by owslib when querying a Web Feature Service (WFS). Unfortunately, this fails with UnboundLocalError.
Traceback (most recent call last):
File "/data/gholl/checkouts/protocode/mwe/pygml-unboundlocalerror.py", line 6, in <module>
geom = pygml.parse(content)
File "/data/gholl/mambaforge/envs/py310/lib/python3.10/site-packages/pygml/parse.py", line 58, in parse
return Geometry(result)
UnboundLocalError: local variable 'result' referenced before assignment
The exception should be more descriptive, and handled better. Will do that.
I see that you want to parse a WFS response, which is not possible. You have to unpack the individual XML tags for geometries in order to parse the GML geometries.
I'm trying to parse a Geography Markup Language (GML) string as returned by owslib when querying a Web Feature Service (WFS). Unfortunately, this fails with UnboundLocalError.
Example:
Result:
The first 2000 characters of
content
are:The last 500 are: