Hello
I am using a WFS reader to extract data, is there any way we could query the WFS to retrieve only specific features
Thanks
Hello
I am using a WFS reader to extract data, is there any way we could query the WFS to retrieve only specific features
Thanks
Yes @boubcher
The reader WFS is possible to retrieve only specific features:
Parameters - Feature Types
Thanks,
Danilo
Thanks, Danilo
we don't have a problem with the feature type, but we looking to retrieve only certain features within this feature type (ex: date = d/m/y )
Thanks, Danilo
we don't have a problem with the feature type, but we looking to retrieve only certain features within this feature type (ex: date = d/m/y )
Thanks,
Danilo
Yes, you can use XML Filter Expression to get specific features. By default Filter Encoding should work.
Filter Encoding example: This GET request will return only the features with the field "identificatie" = "420100000006908".
The decomposed request is:
http://geodata.nationaalgeoregister.nl/bag/wfs?
&service;=wfs
&version;=1.0.0
&request;=getfeature
&typename;=bag:pand
&Filter;=
<PropertyIsEqualTo>
<PropertyName>
identificatie
</PropertyName>
<Literal>
420100000006908
</Literal>
</PropertyIsEqualTo>
Be aware:
- You have to enter Pretty-Print XML in the field XML Filter Expression to make it work.
<PropertyIsEqualTo>
<PropertyName>
identificatie
</PropertyName>
<Literal>
420100000006908
</Literal>
</PropertyIsEqualTo>
- Filter operations are case sensitive.
- If you query WFS version 2.0.0 you have to use namespace, as documented.
wfsxmlfilter2018.fmw
You might be able to use Filter Functions if the server allows this. Check the GetCapabilities, search "Function_Names" under "Filter_Capabilities".
we have a large dataset, could we use the WFS in order to download the entire dataset, if not is there any alternative?
Thanks
we have a large dataset, could we use the WFS in order to download the entire dataset, if not is there any alternative?
Thanks
Hi @boubcher,
The XML Filter example from @nielsgerrits looks great. You happened to mention to me that this was an Esri WFS service so I was able to get this to work further by adding the OGC namespace to the request. See:
https://gis.stackexchange.com/questions/111356/cant-figure-out-wfs-url-filter-what-ami-doing-wrong
E.g.
<ogc:Filter></ogc:Filter>
Many WFS servers also support stored queries as a way of making it easier to execute complex queries especially across multiple feature types. see: https://knowledge.safe.com/idea/72814/add-support-for-ogc-wfs-stored-queries.html?