Questions tagged [cql-filter]

To filter data using the Common Query Language

Filter by
Sorted by
Tagged with
12
votes
2answers
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 ...
10
votes
1answer
1k 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 ...
8
votes
2answers
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 ...
6
votes
2answers
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 ...
5
votes
3answers
17k 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, ...
5
votes
2answers
7k 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,-...
5
votes
2answers
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....
5
votes
1answer
857 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 ...
4
votes
2answers
865 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://...
4
votes
1answer
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 ...
4
votes
1answer
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....
4
votes
1answer
1k 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.
4
votes
1answer
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=...
4
votes
2answers
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 ...
3
votes
1answer
2k 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 ...
3
votes
1answer
4k 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: ...
3
votes
1answer
282 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.
3
votes
1answer
215 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 ...
3
votes
2answers
661 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 ...
3
votes
1answer
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 &...
3
votes
1answer
808 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 ...
3
votes
2answers
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( ...
3
votes
0answers
185 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 ...
2
votes
2answers
808 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.: ...
2
votes
2answers
150 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'...
2
votes
1answer
84 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://...
2
votes
2answers
1k 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=...
2
votes
1answer
6k 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: ...
2
votes
2answers
105 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 ...
2
votes
2answers
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=...
2
votes
1answer
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: &...
2
votes
1answer
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/...
2
votes
2answers
310 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()...
2
votes
3answers
8k 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 ...
2
votes
2answers
952 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 ...
2
votes
2answers
413 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 ...
2
votes
1answer
528 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(...
2
votes
1answer
389 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 ...
2
votes
1answer
524 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 ...
2
votes
1answer
593 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=...
2
votes
1answer
822 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 ...
2
votes
1answer
235 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%...
2
votes
1answer
893 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....
2
votes
1answer
900 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': [ '...
2
votes
1answer
878 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. ...
2
votes
1answer
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 ...
2
votes
1answer
1k views

Case insensitive CQL-OpenLayers filter?

I have the following filter in OpenLayers 2.13 var filter_c = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.LIKE, property: 'p_name', value: '%'+...
2
votes
1answer
809 views

MapFish print module with cql_filter params

Does anyone know how to pass cql_filter params into MapFish's Print module? I already tried this, but it does not work. It generates the PDF but I get this error "The byte array is not a recognized ...
2
votes
2answers
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/...
2
votes
0answers
44 views

CQL filter not quite properly formatted

I am trying to use the following CQL filter in Geoserver for extracting all polygons (layer1) intersecting a line (layer2): http://XXX.XX.X.XX:8080/geoserver/workspace/wfs?service=wfs&version=1.1....