Select to view content in your preferred language

Obtain features using ARCGIS and WFS based on CQL_Filter

809
3
07-04-2023 10:00 AM
MiriEshel1
Emerging Contributor

Hi,

I'm trying to obtain a filter using cql_filter on wfsserver and nothing works.

Here are some references:

https://aaa.mapi.co.il/arcgis/services/MAPI/MapServer/WFSServer?service=WFS&version=1.0.0&request=Ge...

https://ags1091.stltd.co.il/arcgis/services/AgriParcels/MapServer/WFSServer?service=WFS&request=GetF...

https://ags1091.stltd.co.il/arcgis/services/AgriParcels/MapServer/WFSServer?service=WFS&request=GetF...

The one that we finally need is a combination of BBOX and an alphanumeric field.

 

My questions are:

1. Is it supported? I found the attached file in Sales Force that maybe claims that it is not supported. Here is the link to SalesForce: https://esri.lightning.force.com/lightning/r/Defect__c/a3qf2000001tEfnAAE/view

2. If it is supported, what is the exact syntax to use? An example will be really appreciated.

Thanks a lot,

Miri

0 Kudos
3 Replies
MiguelParedes
Esri Contributor

Greetings Miri,
I believe that according to the ENH you quoted, the CQL_Filter type appears not to be supported, even though it is not documented.

However, if you visit the help page on Consuming a WFS 1.0.0 or 1.1.0 in a web browser you should see examples of how to use filters as part of the GetFeature request.  One of the examples shows how to use the BBOX. But it does not show how to combine BBOX with an additional filter for a field value.

If you are not constrained to using CQL_Filters, I would suggest experimenting with the URLs you provided and seeing if you are able to make them work using filtering as per the documentation.

Miguel
0 Kudos
MiriEshel1
Emerging Contributor

Hello @Miguel ,

Thank you for your reply. I'm familiar with this document. Thanks!

I'm looking for exact syntax (can be also in xml)  for how to filter, using both extent and an SQL condition (e.g. name='Ruth'). I expect a real URL, that somebody tested and it worked for him. I will adjust it to my server name, service name etc.

Thanks,

Miri 

0 Kudos
Bastien
Occasional Contributor

You can use an undocumented feature using an OGC OpenGIS Filter.

For example if you want to filter a WFS layer "YOUR_LAYER" with the attribute "YOUR_FIELD" and the value "YOUR_VALUE" then you can use:

https://yourWFSserverURL/WFSServer?service=WFS&version=1.1.0&request=GetFeature&typeName=esri:YOUR_L...<ogc:Filter xmlns:ogc='http://www.opengis.net/ogc'><ogc:PropertyIsEqualTo><ogc:PropertyName>esri:YOUR_FIELD</ogc:PropertyName><ogc:Literal>YOUR_VALUE</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>
 
It works like a charm.
0 Kudos