[Geoserver-users] Point Intersect Filters, 1.7.0+

Hi,
I'm trying to get a point intersect filter working on
geo.openplans.org (which I think is running 1.7.0), and am having
problems. I'm not sure if I'm formatting my queries incorrectly, or
if there's a bug and I should be opening a jira. If this is a bug,
can someone test a comparable filter on a 1.7.1 installation?

Thanks,
Josh Rosenthal

Looking at
http://geoserver.org/display/GEOSDOC/WFS+vendor+parameters
we have two types of intersect filter examples, already coded for the
topp layers.

OGC version:
http://geo.openplans.org/geoserver/wfs?request=GetFeature&typeName=topp:states&outputFormat=GML2&FILTER=<Filter%20xmlns:gml="http://www.opengis.net/gml"><Intersects><PropertyName>the\_geom</PropertyName><gml:Point%20srsName="4326"><gml:coordinates>\-74\.817265,40\.5296504</gml:coordinates></gml:Point></Intersects></Filter>

CQL_FILTER version:
http://geo.openplans.org/geoserver/wfs?request=GetFeature&typeName=topp:states&outputFormat=GML2&CQL_FILTER=INTERSECT(the_geom,%20POINT%20(-74.817265%2040.5296504))

If, however, we look at the layer

http://geo.openplans.org/geoserver/wms?bbox=-127.61950064999999,23.7351786,-64.08177035,50.592523400000005&styles=&Format=application/openlayers&request=GetMap&version=1.1.1&layers=topp:states&width=800&height=317&srs=EPSG:4326

We'll see that the coordinates (-74.817265,40.5296504) have the
dubious fortune to be in New Jersey.
http://geo.openplans.org/geoserver/wfs?request=GetFeature&typeName=topp:states&outputformat=gml2&CQL_FILTER=STATE_NAME='New
Jersey'

CQL_FILTER=STATE_NAME='New Jersey' returns a fair amount of data,
while the intersect filters don't.

just for reference here is a working 1.6.5 beta example of the same:

http://giswebservices.massgis.state.ma.us/geoserver/wfs?request=GetFeature&typeName=massgis:GISDATA.NEWENGLAND_POLY&CQL_FILTER=INTERSECT(SHAPE,%20POINT%20(112625%20880124))

Hi Josh,

I believe there are two issues here. The first is that this is a wfs 1.1 request, and the spec dictates that "4326" be in lat/lon which is a flip of the normal case. So an easy way to fix this will be just to append a &version=1.0.0 to the request. Or flip your coordinates.

That said, your filter specified srsName="EPSG:4326" so that should force the regular lon/lat or "xy" case... but it seems to not be. I will look into this further.

-Justin

Josh Rosenthal wrote:

Hi,
I'm trying to get a point intersect filter working on
geo.openplans.org (which I think is running 1.7.0), and am having
problems. I'm not sure if I'm formatting my queries incorrectly, or
if there's a bug and I should be opening a jira. If this is a bug,
can someone test a comparable filter on a 1.7.1 installation?

Thanks,
Josh Rosenthal

Looking at
http://geoserver.org/display/GEOSDOC/WFS+vendor+parameters
we have two types of intersect filter examples, already coded for the
topp layers.

OGC version:
http://geo.openplans.org/geoserver/wfs?request=GetFeature&typeName=topp:states&outputFormat=GML2&FILTER=<Filter%20xmlns:gml="http://www.opengis.net/gml"><Intersects><PropertyName>the\_geom</PropertyName><gml:Point%20srsName="4326"><gml:coordinates>\-74\.817265,40\.5296504</gml:coordinates></gml:Point></Intersects></Filter>

CQL_FILTER version:
http://geo.openplans.org/geoserver/wfs?request=GetFeature&typeName=topp:states&outputFormat=GML2&CQL_FILTER=INTERSECT(the_geom,%20POINT%20(-74.817265%2040.5296504))

If, however, we look at the layer

http://geo.openplans.org/geoserver/wms?bbox=-127.61950064999999,23.7351786,-64.08177035,50.592523400000005&styles=&Format=application/openlayers&request=GetMap&version=1.1.1&layers=topp:states&width=800&height=317&srs=EPSG:4326

We'll see that the coordinates (-74.817265,40.5296504) have the
dubious fortune to be in New Jersey.
http://geo.openplans.org/geoserver/wfs?request=GetFeature&typeName=topp:states&outputformat=gml2&CQL_FILTER=STATE_NAME='New
Jersey'

CQL_FILTER=STATE_NAME='New Jersey' returns a fair amount of data,
while the intersect filters don't.

just for reference here is a working 1.6.5 beta example of the same:

http://giswebservices.massgis.state.ma.us/geoserver/wfs?request=GetFeature&typeName=massgis:GISDATA.NEWENGLAND_POLY&CQL_FILTER=INTERSECT(SHAPE,%20POINT%20(112625%20880124))

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
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.

Thanks Justin,

Reversing the coordinates appears to solve the problem for cql_filter
queries, which is by far my preference for this.

http://geo.openplans.org/geoserver/wfs?request=GetFeature&typeName=topp:states&propertyname=STATE_ABBR&outputFormat=GML2&CQL_FILTER=INTERSECT(the_geom,%20POINT%20(40.5296504%20-74.817265))

It's probably worth noting that the requests I tried was copied from
http://geoserver.org/display/GEOSDOC/WFS+vendor+parameters . From
what you said, the cql_filter example, should probably be updated in
one of the two ways you mentioned.

Josh

On Tue, Jan 13, 2009 at 3:05 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Hi Josh,

I believe there are two issues here. The first is that this is a wfs 1.1
request, and the spec dictates that "4326" be in lat/lon which is a flip of
the normal case. So an easy way to fix this will be just to append a
&version=1.0.0 to the request. Or flip your coordinates.

That said, your filter specified srsName="EPSG:4326" so that should force
the regular lon/lat or "xy" case... but it seems to not be. I will look into
this further.

-Justin

Josh Rosenthal wrote:

Hi,
I'm trying to get a point intersect filter working on
geo.openplans.org (which I think is running 1.7.0), and am having
problems. I'm not sure if I'm formatting my queries incorrectly, or
if there's a bug and I should be opening a jira. If this is a bug,
can someone test a comparable filter on a 1.7.1 installation?

Thanks,
Josh Rosenthal

Looking at
http://geoserver.org/display/GEOSDOC/WFS+vendor+parameters
we have two types of intersect filter examples, already coded for the
topp layers.

OGC version:

http://geo.openplans.org/geoserver/wfs?request=GetFeature&typeName=topp:states&outputFormat=GML2&FILTER=&lt;Filter%20xmlns:gml=&quot;http://www.opengis.net/gml&quot;&gt;&lt;Intersects&gt;&lt;PropertyName&gt;the\_geom&lt;/PropertyName&gt;&lt;gml:Point%20srsName=&quot;4326&quot;&gt;&lt;gml:coordinates&gt;\-74\.817265,40\.5296504&lt;/gml:coordinates&gt;&lt;/gml:Point&gt;&lt;/Intersects&gt;&lt;/Filter&gt;

CQL_FILTER version:

http://geo.openplans.org/geoserver/wfs?request=GetFeature&typeName=topp:states&outputFormat=GML2&CQL_FILTER=INTERSECT(the_geom,%20POINT%20(-74.817265%2040.5296504))

If, however, we look at the layer

http://geo.openplans.org/geoserver/wms?bbox=-127.61950064999999,23.7351786,-64.08177035,50.592523400000005&styles=&Format=application/openlayers&request=GetMap&version=1.1.1&layers=topp:states&width=800&height=317&srs=EPSG:4326

We'll see that the coordinates (-74.817265,40.5296504) have the
dubious fortune to be in New Jersey.

http://geo.openplans.org/geoserver/wfs?request=GetFeature&typeName=topp:states&outputformat=gml2&CQL_FILTER=STATE_NAME='New
Jersey'

CQL_FILTER=STATE_NAME='New Jersey' returns a fair amount of data,
while the intersect filters don't.

just for reference here is a working 1.6.5 beta example of the same:

http://giswebservices.massgis.state.ma.us/geoserver/wfs?request=GetFeature&typeName=massgis:GISDATA.NEWENGLAND_POLY&CQL_FILTER=INTERSECT(SHAPE,%20POINT%20(112625%20880124))

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
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.