[Geoserver-users] Combining CQL_FILTER and MAXFEATURES in WFS GetFeature

Hi all,

I'm trying to use both CQL_FILTER (to add spatial constraints) and
MAXFEATURES in a WFS GetFeature request. A query with:
SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&CQL_FILTER=INTERSECT(geometry,POINT(98.232999999946
29.115999999383))

returns results as expected.

Once I add &MAXFEATURES=1, though, no results are returned. This continues
through about MAXFEATURES=500. At MAXFEATURES=600, one result begins to be
returned, and when I jump to MAXFEATURES=10000, many results are returned.

Shouldn't MAXFEATURES=n return n results? Is the MAXFEATURES constraint
applied before CQL_FILTER, or am I missing something about how this is set
up? I don't have access to the GeoServer backend, so I unfortunately can't
look at the queries that are being performed.

Thanks,
Tom
--
View this message in context: http://www.nabble.com/Combining-CQL_FILTER-and-MAXFEATURES-in-WFS-GetFeature-tp24259357p24259357.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Tom,

Strange, i seem unable to replicate this behavior. Do you know what kind of datastore is being queried in the back end? Also which version of GeoServer are you using.

A shot in the dark, but one thing might be to try to rearranging the order of the parameters. Put the maxfeatures param before the cql_filter param.

-Justin

Tom B wrote:

Hi all,

I'm trying to use both CQL_FILTER (to add spatial constraints) and
MAXFEATURES in a WFS GetFeature request. A query with:
SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&CQL_FILTER=INTERSECT(geometry,POINT(98.232999999946
29.115999999383))

returns results as expected.

Once I add &MAXFEATURES=1, though, no results are returned. This continues
through about MAXFEATURES=500. At MAXFEATURES=600, one result begins to be
returned, and when I jump to MAXFEATURES=10000, many results are returned.

Shouldn't MAXFEATURES=n return n results? Is the MAXFEATURES constraint
applied before CQL_FILTER, or am I missing something about how this is set
up? I don't have access to the GeoServer backend, so I unfortunately can't
look at the queries that are being performed.

Thanks,
Tom

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Tom,
Also, what happens if you remove the INTERSECT and just have MAXFEATURES? Does it return n? Or if you can’t do that because INTERSECT is required (I don’t know much about CQL :slight_smile: ), try replacing it with WITHIN, DISJOINT etc.
Jonathan

2009/6/30 Justin Deoliveira <jdeolive@anonymised.com>

Hi Tom,

Strange, i seem unable to replicate this behavior. Do you know what kind
of datastore is being queried in the back end? Also which version of
GeoServer are you using.

A shot in the dark, but one thing might be to try to rearranging the
order of the parameters. Put the maxfeatures param before the cql_filter
param.

-Justin

Tom B wrote:

Hi all,

I’m trying to use both CQL_FILTER (to add spatial constraints) and
MAXFEATURES in a WFS GetFeature request. A query with:
SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&CQL_FILTER=INTERSECT(geometry,POINT(98.232999999946
29.115999999383))

returns results as expected.

Once I add &MAXFEATURES=1, though, no results are returned. This continues
through about MAXFEATURES=500. At MAXFEATURES=600, one result begins to be
returned, and when I jump to MAXFEATURES=10000, many results are returned.

Shouldn’t MAXFEATURES=n return n results? Is the MAXFEATURES constraint
applied before CQL_FILTER, or am I missing something about how this is set
up? I don’t have access to the GeoServer backend, so I unfortunately can’t
look at the queries that are being performed.

Thanks,
Tom

Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.



Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi Justin and Jonathan,

Thanks for the help. I know that this is running off a PostGIS database,
but I'm not sure how to find what version of GeoServer it is. Is there a
request that will return that?

Reordering the params unfortunately doesn't change the outcome, nor does
switching in something like CONTAINS for INTERSECT.

If I remove the CQL_FILTER param and keep MAXFEATURES=n, n results are
indeed returned.

I might be able to contact the person who maintains this copy of GeoServer
to see if he can help, but if anyone has any other ideas, that'd be great.

Thanks,
Tom

Jonathan Moules wrote:

Tom,
Also, what happens if you remove the INTERSECT and just have MAXFEATURES?
Does it return n? Or if you can't do that because INTERSECT is required (I
don't know much about CQL :slight_smile: ), try replacing it with WITHIN, DISJOINT
etc.
Jonathan
2009/6/30 Justin Deoliveira <jdeolive@anonymised.com>

Hi Tom,

Strange, i seem unable to replicate this behavior. Do you know what kind
of datastore is being queried in the back end? Also which version of
GeoServer are you using.

A shot in the dark, but one thing might be to try to rearranging the
order of the parameters. Put the maxfeatures param before the cql_filter
param.

-Justin

Tom B wrote:
> Hi all,
>
> I'm trying to use both CQL_FILTER (to add spatial constraints) and
> MAXFEATURES in a WFS GetFeature request. A query with:
>
SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&CQL_FILTER=INTERSECT(geometry,POINT(98.232999999946
> 29.115999999383))
>
> returns results as expected.
>
> Once I add &MAXFEATURES=1, though, no results are returned. This
continues
> through about MAXFEATURES=500. At MAXFEATURES=600, one result begins
to
be
> returned, and when I jump to MAXFEATURES=10000, many results are
returned.
>
> Shouldn't MAXFEATURES=n return n results? Is the MAXFEATURES
constraint
> applied before CQL_FILTER, or am I missing something about how this is
set
> up? I don't have access to the GeoServer backend, so I unfortunately
can't
> look at the queries that are being performed.
>
> Thanks,
> Tom

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/Combining-CQL_FILTER-and-MAXFEATURES-in-WFS-GetFeature-tp24259356p24273644.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

If you go to http://<host>:<port>/geoserver/welcome.do it should tell you what version of geoserver you are running. Knowing it is postgis might help, i will try to reproduce. Any chance you can provide a bit of the data that is in the database, as it could possibly be a data issue.

Tom B wrote:

Hi Justin and Jonathan,

Thanks for the help. I know that this is running off a PostGIS database,
but I'm not sure how to find what version of GeoServer it is. Is there a
request that will return that?

Reordering the params unfortunately doesn't change the outcome, nor does
switching in something like CONTAINS for INTERSECT.

If I remove the CQL_FILTER param and keep MAXFEATURES=n, n results are
indeed returned.

I might be able to contact the person who maintains this copy of GeoServer
to see if he can help, but if anyone has any other ideas, that'd be great.

Thanks,
Tom

Jonathan Moules wrote:

Tom,
Also, what happens if you remove the INTERSECT and just have MAXFEATURES?
Does it return n? Or if you can't do that because INTERSECT is required (I
don't know much about CQL :slight_smile: ), try replacing it with WITHIN, DISJOINT
etc.
Jonathan
2009/6/30 Justin Deoliveira <jdeolive@anonymised.com>

Hi Tom,

Strange, i seem unable to replicate this behavior. Do you know what kind
of datastore is being queried in the back end? Also which version of
GeoServer are you using.

A shot in the dark, but one thing might be to try to rearranging the
order of the parameters. Put the maxfeatures param before the cql_filter
param.

-Justin

Tom B wrote:

Hi all,

I'm trying to use both CQL_FILTER (to add spatial constraints) and
MAXFEATURES in a WFS GetFeature request. A query with:

SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&CQL_FILTER=INTERSECT(geometry,POINT(98.232999999946

29.115999999383))

returns results as expected.

Once I add &MAXFEATURES=1, though, no results are returned. This

continues

through about MAXFEATURES=500. At MAXFEATURES=600, one result begins

to
be

returned, and when I jump to MAXFEATURES=10000, many results are

returned.

Shouldn't MAXFEATURES=n return n results? Is the MAXFEATURES

constraint

applied before CQL_FILTER, or am I missing something about how this is

set

up? I don't have access to the GeoServer backend, so I unfortunately

can't

look at the queries that are being performed.

Thanks,
Tom

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

OK, thanks; this is GeoServer 1.7.3. I've put some of the data in a
shapefile here:
http://people.virginia.edu/~tbb4n/geoserver/

Let me know if there's a file format that'd be easier to work with (I'm a
bit new to this). These are nations, but there are multiple records for
each nation: one record for each language/name pair that the nation has
(this is a multilingual data set).

Thanks again,
Tom

Justin Deoliveira-6 wrote:

If you go to http://<host>:<port>/geoserver/welcome.do it should tell
you what version of geoserver you are running. Knowing it is postgis
might help, i will try to reproduce. Any chance you can provide a bit of
the data that is in the database, as it could possibly be a data issue.

Tom B wrote:

Hi Justin and Jonathan,

Thanks for the help. I know that this is running off a PostGIS database,
but I'm not sure how to find what version of GeoServer it is. Is there a
request that will return that?

Reordering the params unfortunately doesn't change the outcome, nor does
switching in something like CONTAINS for INTERSECT.

If I remove the CQL_FILTER param and keep MAXFEATURES=n, n results are
indeed returned.

I might be able to contact the person who maintains this copy of
GeoServer
to see if he can help, but if anyone has any other ideas, that'd be
great.

Thanks,
Tom

Jonathan Moules wrote:

Tom,
Also, what happens if you remove the INTERSECT and just have
MAXFEATURES?
Does it return n? Or if you can't do that because INTERSECT is required
(I
don't know much about CQL :slight_smile: ), try replacing it with WITHIN, DISJOINT
etc.
Jonathan
2009/6/30 Justin Deoliveira <jdeolive@anonymised.com>

Hi Tom,

Strange, i seem unable to replicate this behavior. Do you know what
kind
of datastore is being queried in the back end? Also which version of
GeoServer are you using.

A shot in the dark, but one thing might be to try to rearranging the
order of the parameters. Put the maxfeatures param before the
cql_filter
param.

-Justin

Tom B wrote:

Hi all,

I'm trying to use both CQL_FILTER (to add spatial constraints) and
MAXFEATURES in a WFS GetFeature request. A query with:

SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&CQL_FILTER=INTERSECT(geometry,POINT(98.232999999946

29.115999999383))

returns results as expected.

Once I add &MAXFEATURES=1, though, no results are returned. This

continues

through about MAXFEATURES=500. At MAXFEATURES=600, one result begins

to
be

returned, and when I jump to MAXFEATURES=10000, many results are

returned.

Shouldn't MAXFEATURES=n return n results? Is the MAXFEATURES

constraint

applied before CQL_FILTER, or am I missing something about how this is

set

up? I don't have access to the GeoServer backend, so I unfortunately

can't

look at the queries that are being performed.

Thanks,
Tom

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/Combining-CQL_FILTER-and-MAXFEATURES-in-WFS-GetFeature-tp24259356p24291355.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Tom,

Thanks for sending your data, sorry it took me a while to look at this.

Unfortunately I am not able to replicate the issue with GeoServer 1.7.5, so it could just be that this is an issue that has been solved. But basically I added the shapefile you send and executed the following:

curl -G "http://localhost:8080/geoserver/wfs?request=getfeature&typename=topp:test2Polygon&version=1.0.0&CQL_FILTER=INTERSECT(the_geom,POINT(98.232999999946%2029.115999999383))&maxfeatures=n"

With different values of n, getting the expected result each time.

-Justin

Tom B wrote:

OK, thanks; this is GeoServer 1.7.3. I've put some of the data in a
shapefile here:
http://people.virginia.edu/~tbb4n/geoserver/

Let me know if there's a file format that'd be easier to work with (I'm a
bit new to this). These are nations, but there are multiple records for
each nation: one record for each language/name pair that the nation has
(this is a multilingual data set).

Thanks again,
Tom

Justin Deoliveira-6 wrote:

If you go to http://<host>:<port>/geoserver/welcome.do it should tell you what version of geoserver you are running. Knowing it is postgis might help, i will try to reproduce. Any chance you can provide a bit of the data that is in the database, as it could possibly be a data issue.

Tom B wrote:

Hi Justin and Jonathan,

Thanks for the help. I know that this is running off a PostGIS database,
but I'm not sure how to find what version of GeoServer it is. Is there a
request that will return that?

Reordering the params unfortunately doesn't change the outcome, nor does
switching in something like CONTAINS for INTERSECT.

If I remove the CQL_FILTER param and keep MAXFEATURES=n, n results are
indeed returned.

I might be able to contact the person who maintains this copy of
GeoServer
to see if he can help, but if anyone has any other ideas, that'd be
great.

Thanks,
Tom

Jonathan Moules wrote:

Tom,
Also, what happens if you remove the INTERSECT and just have
MAXFEATURES?
Does it return n? Or if you can't do that because INTERSECT is required
(I
don't know much about CQL :slight_smile: ), try replacing it with WITHIN, DISJOINT
etc.
Jonathan
2009/6/30 Justin Deoliveira <jdeolive@anonymised.com>

Hi Tom,

Strange, i seem unable to replicate this behavior. Do you know what
kind
of datastore is being queried in the back end? Also which version of
GeoServer are you using.

A shot in the dark, but one thing might be to try to rearranging the
order of the parameters. Put the maxfeatures param before the
cql_filter
param.

-Justin

Tom B wrote:

Hi all,

I'm trying to use both CQL_FILTER (to add spatial constraints) and
MAXFEATURES in a WFS GetFeature request. A query with:

SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&CQL_FILTER=INTERSECT(geometry,POINT(98.232999999946

29.115999999383))

returns results as expected.

Once I add &MAXFEATURES=1, though, no results are returned. This

continues

through about MAXFEATURES=500. At MAXFEATURES=600, one result begins

to
be

returned, and when I jump to MAXFEATURES=10000, many results are

returned.

Shouldn't MAXFEATURES=n return n results? Is the MAXFEATURES

constraint

applied before CQL_FILTER, or am I missing something about how this is

set

up? I don't have access to the GeoServer backend, so I unfortunately

can't

look at the queries that are being performed.

Thanks,
Tom

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Hi Justin,

Thanks for taking a look at this. I'm using a workaround now that mitigates
this a little but doesn't solve it. I think we might just use that until
we're sure that we need a fix for this, and if we are, we'll ask the person
who maintains our copy of GeoServer if he could take a look.

Thanks again,
Tom

Justin Deoliveira-6 wrote:

Hi Tom,

Thanks for sending your data, sorry it took me a while to look at this.

Unfortunately I am not able to replicate the issue with GeoServer 1.7.5,
so it could just be that this is an issue that has been solved. But
basically I added the shapefile you send and executed the following:

curl -G
"http://localhost:8080/geoserver/wfs?request=getfeature&typename=topp:test2Polygon&version=1.0.0&CQL_FILTER=INTERSECT(the_geom,POINT(98.232999999946%2029.115999999383))&maxfeatures=n"

With different values of n, getting the expected result each time.

-Justin

Tom B wrote:

OK, thanks; this is GeoServer 1.7.3. I've put some of the data in a
shapefile here:
http://people.virginia.edu/~tbb4n/geoserver/

Let me know if there's a file format that'd be easier to work with (I'm a
bit new to this). These are nations, but there are multiple records for
each nation: one record for each language/name pair that the nation has
(this is a multilingual data set).

Thanks again,
Tom

Justin Deoliveira-6 wrote:

If you go to http://<host>:<port>/geoserver/welcome.do it should tell
you what version of geoserver you are running. Knowing it is postgis
might help, i will try to reproduce. Any chance you can provide a bit of
the data that is in the database, as it could possibly be a data issue.

Tom B wrote:

Hi Justin and Jonathan,

Thanks for the help. I know that this is running off a PostGIS
database,
but I'm not sure how to find what version of GeoServer it is. Is there
a
request that will return that?

Reordering the params unfortunately doesn't change the outcome, nor
does
switching in something like CONTAINS for INTERSECT.

If I remove the CQL_FILTER param and keep MAXFEATURES=n, n results are
indeed returned.

I might be able to contact the person who maintains this copy of
GeoServer
to see if he can help, but if anyone has any other ideas, that'd be
great.

Thanks,
Tom

Jonathan Moules wrote:

Tom,
Also, what happens if you remove the INTERSECT and just have
MAXFEATURES?
Does it return n? Or if you can't do that because INTERSECT is
required
(I
don't know much about CQL :slight_smile: ), try replacing it with WITHIN,
DISJOINT
etc.
Jonathan
2009/6/30 Justin Deoliveira <jdeolive@anonymised.com>

Hi Tom,

Strange, i seem unable to replicate this behavior. Do you know what
kind
of datastore is being queried in the back end? Also which version of
GeoServer are you using.

A shot in the dark, but one thing might be to try to rearranging the
order of the parameters. Put the maxfeatures param before the
cql_filter
param.

-Justin

Tom B wrote:

Hi all,

I'm trying to use both CQL_FILTER (to add spatial constraints) and
MAXFEATURES in a WFS GetFeature request. A query with:

SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&CQL_FILTER=INTERSECT(geometry,POINT(98.232999999946

29.115999999383))

returns results as expected.

Once I add &MAXFEATURES=1, though, no results are returned. This

continues

through about MAXFEATURES=500. At MAXFEATURES=600, one result
begins

to
be

returned, and when I jump to MAXFEATURES=10000, many results are

returned.

Shouldn't MAXFEATURES=n return n results? Is the MAXFEATURES

constraint

applied before CQL_FILTER, or am I missing something about how this
is

set

up? I don't have access to the GeoServer backend, so I
unfortunately

can't

look at the queries that are being performed.

Thanks,
Tom

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full
prize
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/Combining-CQL_FILTER-and-MAXFEATURES-in-WFS-GetFeature-tp24259356p24378538.html
Sent from the GeoServer - User mailing list archive at Nabble.com.