You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wfs20=WebFeatureService(url='http://services.ga.gov.au/earthresource/wfs', version='2.0.0')
gold="""<fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:erl="http://xmlns.earthresourceml.org/earthresourceml-lite/1.0"> <fes:PropertyIsEqualTo> <fes:ValueReference>erl:representativeCommodity_uri</fes:ValueReference> <fes:Literal>http://resource.geosciml.org/classifier/cgi/commodity-code/gold</fes:Literal> </fes:PropertyIsEqualTo> </fes:Filter>"""# Get some mineral occurrencesresponse=wfs20.getfeature(typename='erl:MineralOccurrenceView',maxfeatures=10,method="{http://www.opengis.net/wfs}Post",filter=etree.fromstring(gold))
filter parameter can either be a string on a etree Element, so filter=etree.fromstring(gold)or filter=gold should both work. If I pass the etree Element, it works fine, except it outputs a warning
(...) feature\__init__.py:351: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
elif filter:
but If I use a string
# Get some mineral occurrencesresponse=wfs20.getfeature(typename='erl:MineralOccurrenceView',maxfeatures=10,method="{http://www.opengis.net/wfs}Post",filter=gold)
the WFS returns nothing because there are no filter, because this bit of code in postrequest.py (set_filter
Greetings
Not sure if it's a bug or me misunderstanding.
In this small snippet (which works)
filter
parameter can either be a string on a etree Element, sofilter=etree.fromstring(gold)
orfilter=gold
should both work. If I pass the etree Element, it works fine, except it outputs a warningbut If I use a string
the WFS returns nothing because there are no filter, because this bit of code in postrequest.py (set_filter
sub_elem
returnsNothing
(because it look only inf
child ?)so to make it work you must surround the filter with some dummy tag (and it then works for both string and Element)
The text was updated successfully, but these errors were encountered: