6 votes
Accepted

Using filter functions in cql_filter throws "... cannot be cast to org.opengis.filter.Filter"

The solution is simple: anything that yields a boolean value must be explicitly compared to true. Like (with proper URL encoding): &cql_filter=strEqualsIgnoreCase(name, 'Jane Doe') = true &...
user avatar
  • 201
5 votes
Accepted

Adding WMS layer with CQL filter

Your code contains: &CQL_FILTER=user_id=1 And I will guess that the two =s are messing up the URL. In Leaflet WMS tilelayers, any extra options which are not defined will be passed to the WMS ...
user avatar
  • 9,380
5 votes
Accepted

CQL_FILTER on multilayer request where only one layer needs filtered

You can't pass an empty filter into CQL but you can say you want all the features from that layer by using the special INCLUDE filter. So your query should be something like: CQL_FILTER=INCLUDE;NAME='...
user avatar
  • 75.1k
5 votes
Accepted

Geoserver WMS Filtering: Clipping geometry against a polygon

Figured it out! The following SLD uses a rendering transformation to call "gs:Clip", which clips vector features to a bounding geometry. The result is then rasterized by GeoServer's WMS. <?xml ...
user avatar
  • 205
5 votes
Accepted

Ol3, dynamic CQL for WFS layer (GeoJSON) from Geoserver

Since this has not been answered. Here is my own solution which is very simple and works well. The "update" function clears the vector source. The "loader" function, which has been added to the ...
user avatar
  • 61
5 votes

How to run a temporal query on a CSW using GeoNetwork?

Thanks for reply. I didn't know this log file. Really a great help! Here is the solution for my problem: http://myserver:8080/geonetwork/srv/eng/csw?SERVICE=CSW&version=2.0.2 &REQUEST=GetRecords&...
user avatar
5 votes
Accepted

How to use NOT IN correctly in a WFS CQL attribute filter?

You can successfully use the NOT IN syntax if you are filtering more than one feature. "attribute" NOT IN (1, 2) ← works "attribute" NOT IN (1) ← does not work So I suppose this syntax is limited ...
user avatar
5 votes
Accepted

GeoServer CQL Filter doesnt work with Unicode

Because the grammar of CQL defines an identifier as: < IDENTIFIER: (<LETTER> (<LETTER>|<DIGIT>)*) | <DOUBLE_QUOTE> (<ANY>)+ <DOUBLE_QUOTE> > | < #...
user avatar
  • 15.7k
4 votes
Accepted

Query WMS in OpenLayers3

CQL filter is a vendor parameter provided by GeoServer, therefore you have to include the cql_filter in the params string object. OpenLayers 3's ol.source.TileWMS object only supports options you can ...
user avatar
  • 4,428
4 votes
Accepted

WFS version issue with DWITHIN CQL_FILTER in GeoServer

It's likely the axis flipping biting you, you should flip coordinates in WFS 1.1 and 2.0 filters: http://docs.geoserver.org/stable/user/services/wfs/basics.html#axis-ordering
user avatar
  • 15.7k
4 votes

POST CQL filter (with large geometry) in HTTP body

Complete post request would be var url = 'http://localhost/geoserver/ows?service=WFS&version=1.0.0&outputFormat=application%2Fjson&request=GetFeature&typeName=topp:states', ...
user avatar
  • 140
4 votes
Accepted

Using CQL for a poor man's temporal filter on a server offering only WFS 1.1.0

Note only a GeoServer based WFS will understand a CQL filter, you can and should use an OGC Filter to achieve this effect too. You can use one (or more) of the ECQL temporal filters for this. I would ...
user avatar
  • 75.1k
4 votes
Accepted

How to use UNION ALL in GeoServer CQL Filter?

You can combine two filters using or (or and) so your query becomes cql_filter="val"='a' or "val"='b'
user avatar
  • 75.1k
3 votes
Accepted

CQL filter not displaying in leaflet.js

Try this: var FilterWMSlayer= L.tileLayer.wms("http://Server.com/geoserver/Workspace/wms", { layers: 'Workspace:Layer', format: 'image/png', transparent: true, ...
user avatar
3 votes
Accepted

How to request paginated or filtered data from WFS 2.0?

Often even if filters or pagination are not supported, you can use the BBOX parameter to query features limited to a specific region. Via trial and error this can give you all the data. Just slice the ...
user avatar
  • 8,420
3 votes
Accepted

Leaflet polygon (multi polygon) to CQL equivelent

POLYGON((-90.89 46.67,-90.89 46.67,-90.89 46.67,-90.89 46.67,-90.89 46.67)) Looks like WKT. If it is, you can convert features/layers/geojson to WKT using Wellknown or Wicket-Leaflet
user avatar
  • 6,738
3 votes
Accepted

CQL_FILTER that joins two feature types in WFS

Did I understood you right, that you basically want to request two layers in one Request? If so then just use "typeName" instead of "typeNames". See this request of two layers at the same time ( bvv:...
user avatar
  • 6,350
3 votes
Accepted

geotools cql full syntax and examples

The CQL is defined by the OGC as part of the catalogue service (i.e. CSW) model specification. See http://docs.opengeospatial.org/is/12-168r6/12-168r6.html for the current (as of July 2016) version. ...
user avatar
  • 12.5k
3 votes

GeoServer (CQL) query to return just the boundary polygon of a filtered feature

This error is trying to tell you a FilterFunction is not a Filter which means that it doesn't evaluate to true or false. The CQL filter is used to select some or all of the features in the data store,...
user avatar
  • 75.1k
3 votes
Accepted

What is the difference between CQL_FILTER and FILTER?

CQL (Common Query Language) is a query language created by the OGC for the Catalogue Web Services specification. Unlike the XML-based Filter Encoding language, CQL is written using a familiar text-...
user avatar
  • 75.1k
3 votes

How to use CQL to return a geometry type?

TL;DR; You need to use the geometryType function e.g. CQL_FILTER=geometryType(the_geom)='MultiPolygon'& Longer Explanation As you found on the ECQL page there is no way to directly get hold of ...
user avatar
  • 75.1k
3 votes

WFS GetFeature request with CQL_FILTERS with SPATIAL OPERATORS does not retrieve correct results

I think you are being bitten by loose bounding box comparisons since technically this polygon doesn't intersect any features. POLYGON((123664.03100000322 210489.5150000006, 123705.24599999934 ...
user avatar
  • 75.1k
3 votes

Is it possible to use SELECT DISTINCT in a GeoServer CQL_FILTER statement?

The WFS specification does not allow aggregation, the filter, regardless of the language used is the equivalent of a "where" clause only. If you need aggregation you'll have to combine WFS with WPS, ...
user avatar
  • 15.7k
3 votes
Accepted

Geoserver CQL + SQL Server Plugin - .Filter Statement

When the plugin was developed Filter was the only way to force usage of a spatial index. Maybe more recent versions of SQLServer do not have this requirement anymore and will leverage the spatial ...
user avatar
  • 15.7k
3 votes
Accepted

Geoserver CQL file queryCollection limit

Something that could be related is documented in http://docs.geoserver.org/stable/en/user/extensions/querylayer/index.html Memory limits The queryCollection and collectGeometries functions do ...
user avatar
  • 52.4k
2 votes

Geoserver 2.5.2 CQL BBOX filter

you have to declare that you use EPSG 3301 and not EPSG 4326 for the BBOX with wfs in version 1.1.1.: " If the crsuri is not specified then the 2-D coordinates shall be specified using decimal degrees ...
user avatar
  • 6,350
2 votes

PyQGIS add WMS layer with CQL_FILTER

if you are using PyQgis 2.x registry = QgsMapLayerRegistry.instance() urlWithParams = "crs=EPSG:21037&IgnoreGetMapUrl=1&featureCount=10&format=image/png&styles=&layers=parcels&...
user avatar
2 votes
Accepted

Remove CQL_Filter from OpenLayers map

I just find out how to do it and is very simple, just set the CQL_FILTER to null: //My var map is previously declared var layerFromMap = map.getLayersByName(input.name)[0]; //If my input is empty ...
user avatar
  • 313
2 votes
Accepted

WMS GetMap Request with featureid CQL filter

In the very end, I got a response from the vendor a month after we stopped working on the project. The vendor's response was that I was using the wrong letter casing in the CQL_FILTER parameters. ...
user avatar
  • 31
2 votes
Accepted

CQL_filter parameter on WMS layer doesn't work

You are actually making a GeoWebCache request not a simple WMS request so in general GWC ignores filters. The simple answer is to make your filtered request directly to GeoServer by changing http://...
user avatar
  • 75.1k

Only top scored, non community-wiki answers of a minimum length are eligible