Friday 19 July 2019

geoserver - How to find out if a WFS instance supports filtering via CQL?



I am considering using Common Query Language (CQL) to add filter parameter to a HTTP curl query which runs against a WFS server. I found out that GeoServer supports CQL via WFS.



  1. Can I tell from a GetCapabilities document if the WFS is served by GeoServer?

  2. How can I test if CQL is supported by the WFS?



Answer



I do not believe there is anything that for sure reveals that WFS server is GeoServer but with standard settings the schema location refers somehow to geoserver and some supported functions are special for GeoServer. However, others can implement functions using same names:


http://localhost:8080/geoserver/topp/ows?service=WFS&version=1.1.0&request=GetCapabilities




BarnesSurface

For testing is CQL_FILTER is supported you can try the "IN" filter as in http://docs.geoserver.org/stable/en/user/tutorials/cql/cql_tutorial.html


The following request will return one feature from GeoServer and probably all features from other servers (or an error). You must edit "states.1" to suit with the name of the featuretype:


http://localhost:8080/geoserver/ows?service=wfs&version=1.1.0&request=GetFeature&typename=topp:states&CQL_FILTER=IN ('states.1')

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...