1

I have trouble with CQL filter in geojson.

The CQL filter that I want:

"Sector Catastral" = 'VERONA'

The URL that compose for this purpose:

http://localhost:3000/geoserver/SIGUD/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=SIGUD:vista_lotes&outputFormat=application%2Fjson&CQL_FILTER=%22Sector%20Catastral%22%20=%20%27VERONA%27

Response:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<ServiceExceptionReport version="1.2.0" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd"><ServiceException>
  Could not parse CQL filter list.
Encountered "\"" at line 1, column 1.
Was expecting one of:
    "not" ...
    "id" ...
    "in" ...
    <IDENTIFIER> ...
    <DATE_TIME> ...
    "(" ...
    "[" ...
    <DATE> ...
    "-" ...
    <INTEGER_LITERAL> ...
    <FLOATING_LITERAL> ...
    <STRING_LITERAL> ...
    "true" ...
    "false" ...
    "point" ...
    "linestring" ...
    "polygon" ...
    "multipoint" ...
    "multilinestring" ...
    "multipolygon" ...
    "geometrycollection" ...
    "envelope" ...
    "include" ...
    "exclude" ...
     Parsing : "Sector Catastral" = 'VERONA'.
</ServiceException></ServiceExceptionReport>

The CQL filter that actually works:

"Localidad"='CHAPINERO'

The URL that compose for this purpose:

http://localhost:3000/geoserver/SIGUD/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=SIGUD:vista_lotes&outputFormat=application%2Fjson&CQL_FILTER=%22Localidad%22=%27CHAPINERO%27

Response normally with filtered features.

I want to filter by field with spaces.

My geoserver version is 2.7.6

With OGC Filters i'm getting the same error by the space in field name.

  • Are you saying that the WFS GetCapabilities response for version 1.0.0 reports the ability to do that type of filter, but it doesn't work? – nmtoken Jul 19 '17 at 22:10
  • I don't know, but de field name is "Sector Catastral" and the query is not working, exists a version of WFS that the field names can be with spaces? – juusechec Jul 19 '17 at 22:54
  • Does deleting the spaces before and after the equals resolve the problem? The space character that's causing the error might not be the one in the field name, but the ones before and after the equals. – Brynne Jul 19 '17 at 23:11
  • I'm getting the same error. Change de parsing string is last line. Parsing : "Sector Catastral"='VERONA'. – juusechec Jul 19 '17 at 23:36
  • Appears to be the same error of gis.stackexchange.com/questions/49227/… geoserver no yet include support for all characters in field name. With OGC Filter the error is "Illegal property name". – juusechec Jul 24 '17 at 18:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.