Hinrich
Hinrich

Reputation: 14023

Geoserver WFS Cross Layer Filtering and String IDs

I have a Geoserver WFS request with a cross layer filter based cql in it, that looks like this:

...&CQL_FILTER=INTERSECTS(the_geom, querySingle('myLayerName','the_geom','the_id = F338'))

This does not work. Geoserver is giving me this error message:

java.lang.NullPointerException: PropertyDescriptor is null - did you request a property that does not exist?

if I change the filter to this:

&CQL_FILTER=INTERSECTS(the_geom, querySingle('myLayerName','the_geom','INCLUDE'))

it is working.

What could be going wrong in the first example? The id with the value F338 in fact does exist.

Could it be that Geoserver is expecting a integer as id? In CQL filters can be strings, but they have to be quoted. In my example, i obviously cannot really quote the value because the whole parameter to the querySingle function is a quote itself.

Upvotes: 0

Views: 1556

Answers (1)

EltonQ
EltonQ

Reputation: 31

For string comparison, you need to put two single quotations, so i.e. 'the_id = ''F338'''. (one double quotation doesn't work)

This stupid undocumented little thing cost me 5 hours of try and error...

Upvotes: 3

Related Questions