Questions tagged [cql-filter]

To filter data using the Common Query Language

Filter by
Sorted by
Tagged with
12 votes
2 answers
4k views

How to filter big datasets in Geoserver WMS?

Is there a good way to filter datasets with approx 50,000 features in Geoserver? I'd have to select between 100 and 200 features based on ids. These ids are different from the FeatureIds. Couldn't ...
user avatar
  • 81.9k
10 votes
1 answer
2k views

Disappearing Point Features in Geoserver using WMS

I have a shapefile with roughly 6,500 points worldwide in it that I am trying to serve with Geoserver 2.2.1 using WMS. All has been apparently fine with it until I implemented a filtering feature on ...
user avatar
  • 1,458
8 votes
2 answers
5k views

Can I do custom styling on GeoServer

I want to use GeoServer WMS server for custom styling. Let's say I have an area as polygon in a shapefile, but I don't have this area's temperature as an attribute. From a web service I gather ...
user avatar
  • 369
6 votes
2 answers
3k views

OpenLayers filter: OGC (xml) or CQL?

While having not used filtering that much in OpenLayers, we are discussing which type of filtering we should use: The OGC XML filter or the more simple CQL filter? Are one of them more appropriate ...
user avatar
  • 4,292
5 votes
3 answers
18k views

How to get the layer name?

I am using OpenLayers, Geoserver 2.1 CQL language. The problem is that I do not know how to address the layer. I am trying to call a function like this: var createWmsLayer = function(name, url, ...
user avatar
  • 147
5 votes
2 answers
8k views

Restrict CQL filter to a specific BBOX

I need to filter an OpenLayers layer using a CQL filter to an specific Bounding Box. Is it possible? Something like this isn't working: igh > 5000 AND bbox(igh,20786691,22051867,-305577260,-...
user avatar
5 votes
2 answers
2k views

POST CQL filter (with large geometry) in HTTP body

The size of an URL is limited. Therefore I'm not able to request a WFS with a complex geometry. I read (Geoserver POST filter to WMS layer) that is possible to do in a WMS, but I didn't get it to work....
user avatar
5 votes
1 answer
1k views

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

There's a WFS I'm accessing via script to pull in features that will match a particular day. The attribute I care about in the output is DATE_TIME. However because it's WFS 1.1.0 it does not support ...
user avatar
  • 1,325
5 votes
1 answer
2k views

CQL_FILTER that joins two feature types in WFS

I want to join two feature types in my WFS in a union. How can I achieve this using CQL? E.g. http://localhost:8080/example/ows? service=WFS& version=2.0.0& request=GetFeature& srsName=...
user avatar
  • 85
5 votes
2 answers
2k views

Dynamic SLD styling based on min / max value in a PostGIS column

I have a PostGIS table that contains the GDP of countries together with their polygon boundaries. I am using GeoServer to display this data via OpenLayers. When styling the data, I want to avoid ...
user avatar
4 votes
2 answers
942 views

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

On my GeoNetwork 2.10.3 a CSW GetRecords request (CQL) for TempExtent_begin after a certain date returns all of my metadata records. It seems like the filter expression is simply ignored. http://...
user avatar
4 votes
4 answers
9k views

Adding WMS layer with CQL filter

I would like to add to my leaflet's web map layer from my WMS service (Geoserver), but I need to use CQL filter in GetMap link: localhost/geoserver/my_location/wms?(...)&CQL_FILTER=[...] Is it ...
user avatar
  • 93
4 votes
1 answer
2k views

Geoserver WMS Filtering: Clipping geometry against a polygon

My data set is a series of multilinestrings representing roads. During a WMS GetMap request, I want to specify a polygon and display only the portions of those roads that fall within the polygon. I am ...
user avatar
  • 205
4 votes
1 answer
5k views

Query WMS in OpenLayers3

In previous versions of OpenLayers, we could filter WMS services with CQL. However, I can't filter my WMS services using CQL or other. How do I do that in OpenLayers 3? var wmsLayer = new ol.layer....
user avatar
4 votes
1 answer
2k views

Setting CQL_FILTER on WMS in ArcGIS?

Is it at all possible to use a CQL_FILTER on a WMS service in ArcGIS? Ideally we'd be able to programatically change the CQL_FILTER parameter in the WMS URL.
user avatar
4 votes
1 answer
3k views

geotools cql full syntax and examples [closed]

You know you can use CQL to create GeoTools Filter used when filtering FeatureCollection. GeoTools 16 user guide has made a quick tutorial and examples for CQL strings like the following ones: ATTR1 &...
user avatar
  • 1,023
3 votes
1 answer
3k views

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

I am using a WFS of road centrelines available here for a small mapping project in QGIS. There are a number of features in my area of interest that I just want to exclude. I figured that an attribute ...
user avatar
3 votes
1 answer
5k views

CQL_FILTER on multilayer request where only one layer needs filtered

I have an image mosaic timeseries layer called agdd as well as a shapefile layer called cb_2014_us_state_500k that displays us state boundaries. I can stack both layers with the following query: ...
user avatar
  • 1,121
3 votes
1 answer
287 views

Determing, whether WMS service supports CQL filtering

Is it possible to query, whether WMS service supports CQL filtering (like Geoserver does) or not? I didn't find any hints from GetCapabilities query result.
user avatar
  • 2,751
3 votes
1 answer
252 views

Geoserver CQL + SQL Server Plugin - .Filter Statement

Does anyone know why GeoServer's SQL Server Plugin when making a WFS request with a spatial cql/ecql predicate ends up adding a SQL .Filter to the generated query in addition to the spatial predicate ...
user avatar
  • 329
3 votes
2 answers
798 views

cql_filter with strToUpperCase() fails with "Cannot do natural order without a primary key"

I'm trying to convert a query into uppercase in a GeoServer WFS request. According to the Filter Function reference this can be achieved using strToUpperCase(). This is working successfully on a ...
user avatar
  • 20.5k
3 votes
1 answer
856 views

PyQGIS add WMS layer with CQL_FILTER

I'd like to add a WMS layer through my QGIS plugin with custom CQL_FILTER parameters. My problem is, that the CQL_FILTER parameters are not passed to the GeoServer (I can see it in the GeoServer log ...
user avatar
  • 121
3 votes
2 answers
2k views

Zoom after apply CQL_FILTER in OpenLayers

I apply a filter to one layer and works nice. I want to maximize the bounds where I applied the filter, like this: // mapbounds = array(minx,miny,maxx,maxy) activeLayer = new OpenLayers.Layer.WMS( ...
user avatar
3 votes
0 answers
204 views

Geoserver: how to filter a layer related to another layer?

I have the following problem: I have 2 vector layers from PostGIS datastores: "firepoints" and "threats". The corresponding tables "firepoints" and "threats" have IDs and other attributes. They are ...
user avatar
2 votes
2 answers
1k views

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

I'm trying to use CQL filters in WFS, like (with proper URL encoding): &cql_filter=strEqualsIgnoreCase(name, 'Jane Doe') &cql_filter=strMatches(name, '(?i).* doe') But this tells me, e.g.: ...
user avatar
  • 201
2 votes
2 answers
244 views

How to use UNION ALL in GeoServer CQL Filter?

Basically I want to combine 2 cql filters of the same layer and output the result on my geoserver layer. It is similar to this SQl query (my case using PostgreSQL): select * from table1 where val = 'a'...
user avatar
  • 257
2 votes
1 answer
125 views

GeoServer CQL Filter doesnt work with Unicode

I'm using CQL filter to extract certain data from my GeoServer layer. var source = new ol.source.Vector({ loader: function (extent, resolution, projection) { var url = "http://...
user avatar
  • 257
2 votes
2 answers
2k views

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

I have a WFS service : https://services.ovam.be/geoserver/wfs?REQUEST=GetCapabilities&SERVICE=WFS Where I'm trying the following: http://services.ovam.be/geoserver/wfs?SERVICE=WFS&REQUEST=...
user avatar
2 votes
1 answer
7k views

CQL_FILTER not liking '%' wildcards

I am setting up a query against a layer on my GeoServer instance. My query string can become quite complex, and some statements require using multiple '%' wildcards. For starter's here's an example: ...
user avatar
  • 2,781
2 votes
2 answers
146 views

Geotools CQL to OGC filter

I'm trying to convert a CQL filter to OCG. I followed this example: https://blog.ianturton.com/geotools/code/ogc/2015/03/18/Generating-OGC-Filters.html In line with org.geotools.xml.Configuration ...
user avatar
  • 137
2 votes
2 answers
1k views

How to request paginated or filtered data from WFS 2.0?

I want to download a data set from a WFS 2.0 server via HTTP GET, with curl for instance. $ curl -X GET http://example.com/wfs/?service=WFS&request=GetFeature &version=2.0.0&typeNames=...
user avatar
  • 1,461
2 votes
1 answer
1k views

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

I'm running a query on a GeoServer WFS layer, using a CQL_FILTER. This results in duplicates, whereas I only want to see one instance of each matching result. The query I'm running is: &...
user avatar
  • 20.5k
2 votes
1 answer
1k views

How to use CQL to return a geometry type?

I would like to use CQL in a URL call to return only a particular geometric type from a WFS that broadcasts multiple geometries. I have been going over this: http://docs.geoserver.org/latest/en/user/...
user avatar
  • 1,325
2 votes
2 answers
358 views

OpenLayers3: catch invalid CQL filter exception

My code is following: var filterParams = { 'FILTER': null, 'CQL_FILTER': null, 'FEATUREID': null }; if (filter.length > 0) { filterParams["CQL_FILTER"] = filter; lyr.getSource()...
user avatar
2 votes
2 answers
1k views

Leaflet polygon (multi polygon) to CQL equivelent

I am using leaflet with geoserver. I want to set up a CQL filter to do an intersect but having an issue with getting the geometry from leaflet polygon to cql polygon. For instance, the feature has ...
user avatar
2 votes
2 answers
457 views

CQL filter causing slowness in Java \ Geoserver app

I have a Java application that includes an OpenLayers map with WMS tiles pulled from Geoserver. Geoserver and the Java app are looking at the same MySQL database. In the Java application I have a ...
user avatar
  • 165
2 votes
1 answer
573 views

How to use CQL_FILTER for the highest value in a layer field?

I need to query/filter my wms in openlayers to only see the polygons classified with the highest values in a given field. Would be something like: wms_layer.mergeNewParams({'CQL_FILTER': "ND = max(...
user avatar
  • 5,298
2 votes
1 answer
630 views

Make POST request for WMS in Leaflet for big values of cql_filter

I am passing a spatial query such as CONTAINS(geom, POLYGON((// geometry))) in the cql_filter, but for big polygons GET request the allowed URI length is violated and hence my requests is getting HTTP ...
user avatar
2 votes
1 answer
754 views

How to select features which overlap one geometry but are disjoint from another?

Given a point layer and a polygon layer (P1) in GeoServer, the following CQL Filter selects points which intersect the polygon P1: CQL_FILTER = "Within(geom,POLYGON((P1_coordinates)))"; The ...
user avatar
  • 20.5k
2 votes
1 answer
913 views

GeoServer CQL Filter IN and strToLowerCase

I am trying to query GeoServer with a CQL Filter using the IN clause. If I send a request like this I get data back. http://server.com/geoserver/server/wfs?service=wfs&version=1.0.0&request=...
user avatar
  • 169
2 votes
1 answer
1k views

How to convert int to string in CQL filter GeoServer?

I want to filter columns in GeoServer WMS layer using 'ilike'. I tried following cql query. "column_name" ilike 'string' It works for columns of datatype string, not working for integer columns. ...
user avatar
2 votes
1 answer
560 views

Using nested geometric functions in ECQL queries in GeoServer

When doing a WFS Get Feature request, I am using the cql_filter option to do some more advanced spatial filtering/quering. I am looking for the centroids of the polygons in a database that intersect ...
user avatar
  • 51
2 votes
1 answer
880 views

Geoserver 2.5.2 CQL BBOX filter

Trying to use CQL bounding-box filter, but get a strange result like this: loadFeatures({"type":"FeatureCollection","totalFeatures":15640,"features":[]}) It showing a total 15640 features in that ...
user avatar
  • 371
2 votes
2 answers
1k views

Geoserver CQL Cross Layer Intersection Failing

I am having trouble forming a properly formatted CQL request using geoServer cross layer filer functions and was hoping others could assist. My request is as follows: http://localhost:8080/geoserver/...
user avatar
  • 31
2 votes
1 answer
251 views

Any source code for converting an infix filter to a WFS filter?

A WFS GetFeature query looks something like this: http://hname/arcgis/services/sname/MapServer/WFSServer?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.0.0&MAXFEATURES=1001&FILTER=%3CFilter%...
user avatar
  • 2,821
2 votes
1 answer
935 views

CQL_TEXT in CSW doesn't work

I need to retrieve some data from CSW server running GeoNetwork. I'm using this query but it doesn't work: http://serverurl/geonetwork/srv/en/csw? REQUEST=GetRecords& SERVICE=CSW& VERSION=2.0....
user avatar
2 votes
1 answer
257 views

Using a CQL Intersects filter with WFS GetFeature request in JavaScript

I am using OpenLayers to create a web app which allows users to define a polygon as an area of interest, and then query the features which fall within the bounding box and return the data to present ...
user avatar
2 votes
2 answers
141 views

How increase speed of counting CQL.toFilter("CONTAINS(the_geom, POINT (lat lon))") on GeoTools with Java

How can I increase speed of counting? I want to select points which is included by shape (GIS shapefile .shp). I have 5 million points and 10 shape files. qry="CONTAINS(the_geom, POINT (69....
user avatar
2 votes
1 answer
1k views

GeoServer WMS service CQL filter query with Mapbox GL

Is there any way to query WMS tile layer for Mapbox GL? map.addLayer({ 'id': 'wms-test-layer', 'type': 'raster', 'source': { 'type': 'raster', 'tiles': [ '...
user avatar
2 votes
1 answer
3k views

Refresh of a customized WMS-Layer (with cql-filter) generates a new map instances on website

I've two simple problems, but I can't fix it by my own :o( My OL-map features a basemap and a cql-filtered WMS from my local geoserver (topp:states). The map is just shown, when i click the ...
user avatar