[Geoserver-users] CQL_FILTER syntax for sets and/or wildcards

Is there an more efficient way to chain together equality conditions in a
CQL_FILTER

&CQL_FILTER=(huc_8=4100001)OR(huc_8=4100011)OR(huc_8=4100012)

something like...

&CQL_FILTER=(huc_8 IN 4100001,4100011,4100012)
or
&CQL_FILTER=(huc_8 LIKE 41000%%)

(which doesn't work)

Pointing me to a comprehensive CQL_FILTER reference outside of the GeoServer
docs would work, if that exists...

Thanks,
Tyler

--
View this message in context: http://www.nabble.com/CQL_FILTER-syntax-for-sets-and-or-wildcards-tp16755214p16755214.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Tyler Erickson ha scritto:

Is there an more efficient way to chain together equality conditions in a
CQL_FILTER

&CQL_FILTER=(huc_8=4100001)OR(huc_8=4100011)OR(huc_8=4100012)

something like...

&CQL_FILTER=(huc_8 IN 4100001,4100011,4100012)
or &CQL_FILTER=(huc_8 LIKE 41000%%)

(which doesn't work)

Pointing me to a comprehensive CQL_FILTER reference outside of the GeoServer
docs would work, if that exists...

Hmmm... try the following links:
http://geotools.codehaus.org/CQL+Parser+Design
http://docs.codehaus.org/display/GEOTDOC/01+CQL+Examples

Not sure something like x in (list) is actually supported thought.
I've cc'ed the developer that created the CQL parser, he surely knows more about this.
Cheers
Andrea

Hi Tyler Erickson, I am afraid, now you haven any convenient filter to avoid
the OR list. CQL has Like statement but it doesn't work numeric types

I think the IN statement could be an improvemet for the TXT (CQL extension)
project.

  huc_8 IN (4100001,4100011,4100012)

cheers

On Friday 18 April 2008 15:03:48 Andrea Aime wrote:

Tyler Erickson ha scritto:
> Is there an more efficient way to chain together equality conditions in a
> CQL_FILTER
>
> &CQL_FILTER=(huc_8=4100001)OR(huc_8=4100011)OR(huc_8=4100012)
>
> something like...
>
> &CQL_FILTER=(huc_8 IN 4100001,4100011,4100012)
> or
> &CQL_FILTER=(huc_8 LIKE 41000%%)
>
> (which doesn't work)
>
> Pointing me to a comprehensive CQL_FILTER reference outside of the
> GeoServer docs would work, if that exists...

Hmmm... try the following links:
http://geotools.codehaus.org/CQL+Parser+Design
http://docs.codehaus.org/display/GEOTDOC/01+CQL+Examples

Not sure something like x in (list) is actually supported thought.
I've cc'ed the developer that created the CQL parser, he surely knows
more about this.
Cheers
Andrea

--

Mauricio Pazos
Axios Director
www.axios.es
Tel.: +34 94 682 42 86

MassGIS would also love an IN ability.. TOWN_ID IN (3,6,39) .. because we
have 351 towns in Massachusetts and while we just got a long WMS Get URL to
squeak past our tomcat and squid, it only works in Firefox. IE has a
smaller URL limit of 2,083 bytes. See long example at bottom:
http://lyceum.massgis.state.ma.us/wiki/doku.php?id=cql

--
View this message in context: http://www.nabble.com/CQL_FILTER-syntax-for-sets-and-or-wildcards-tp16755214p17345148.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

aleda_freeman ha scritto:

MassGIS would also love an IN ability.. TOWN_ID IN (3,6,39) .. because we
have 351 towns in Massachusetts and while we just got a long WMS Get URL to
squeak past our tomcat and squid, it only works in Firefox. IE has a
smaller URL limit of 2,083 bytes. See long example at bottom:
http://lyceum.massgis.state.ma.us/wiki/doku.php?id=cql

As a workaround for this specific case, since most of the towns are matched by that filter, why don't you reverse it, and ask the town not to be among the ones that do not have reports about the American Robin? The filter would be quite a bit smaller.

As for a real fix, hmmm... CQL has been implemented as the standard
asks for, with no extensions, but there was a proposal underway
to make an extension of it, labelled TXT, that would have some extras:
http://docs.codehaus.org/display/GEOTOOLS/TXT+Language+Analysis

"property in (list)" is not among them unfortunately. Mauricio,
you have been following that proposal, what is its state?
What about adding this extra extension to it? It would have to
parse into a list of or-ed PropertyIsEqualsTo, since the OGC filter
standard does not have a "PropertyInList" element, but at
least it would make for a more compact, easier to read filter
expression.

Another approach to solve this issue could be to split the request
into two, first a POST request to store the filter on the server side,
getting back a filter identifier, and then use the filter identifier
in the wms requests. This is a bit far fetched, but it may also be
one solution to support WFS 1.2 feature paging, since the spec says the returned page should point to the next page (so, a GET request),
meaning we'll need ways to store big WFS requests on the server side anyways (having a way to store the filter and refer back to it using an identifier in a GET would be one solution to that problem).
Anyways, this is just me thinking aloud, we have bigger fishes to
fry for the next few months.

Cheers
Andrea

On Wednesday 21 May 2008 10:14:31 Andrea Aime wrote:

As for a real fix, hmmm... CQL has been implemented as the standard
asks for, with no extensions, but there was a proposal underway
to make an extension of it, labelled TXT, that would have some extras:
http://docs.codehaus.org/display/GEOTOOLS/TXT+Language+Analysis

"property in (list)" is not among them unfortunately. Mauricio,
you have been following that proposal, what is its state?
What about adding this extra extension to it? It would have to
parse into a list of or-ed PropertyIsEqualsTo, since the OGC filter
standard does not have a "PropertyInList" element, but at
least it would make for a more compact, easier to read filter
expression.

for feature id we have specified the following sentence

<id predicate> ::= "ID" "IN" <id> {"," <id> }

it's produce an id filter (no PropertyIsEqualsTo).

then you could write a TXT query like

ID IN 'road.1', 'road.2', 'road.47'

I have implemented this extension in geotools trunk.

cheers
--

Mauricio Pazos
www.axios.es
Tel.: +34 94 682 42 86

Andrea, that is a good suggestion - if I need to select more than half the
set, flip the query around to not equals in order to make the whole thing
shorter. Sounds like a good solution for now until the next TXT format.

--
View this message in context: http://www.nabble.com/CQL_FILTER-syntax-for-sets-and-or-wildcards-tp16755214p17364258.html
Sent from the GeoServer - User mailing list archive at Nabble.com.