[OpenLayers-Users] WFS geometry problem from openlayers after moving to Geoserver 2.0

Andreas Hocevar ahocevar at opengeo.org
Thu Dec 3 04:14:50 EST 2009


Hey,

have you set the geometryName option of your protocol (or format if you 
don't use a protocol) to "SHAPE"?

Regards,
Andreas.

Phil Scadden wrote:
> Issues here.
>                                         filter: new 
> OpenLayers.Filter.Spatial({
>                                             property: "SHAPE",
>                                             type: 
> OpenLayers.Filter.Spatial.DWITHIN,
>                                             distance: 
> map.getExtent().getHeight() / 10000000,
>                                             distanceUnits: "degree",
>                                             value: e.feature.geometry
>                                         }),
> I set up a filter on a layer,  (SDE now coming from Geoserver 2.0).
> It generates a POST of
>
> |<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" xsi:schemaLocation||="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="http://www.w3.org||/2001/XMLSchema-instance"><wfs:Query typeName="MYLAYER" srsName="EPSG:900913">||<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:DWithin><ogc:PropertyName>the_geom</ogc:PropertyName||><gml:Point xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:900913"><gml:pos>19372200.445898 -4657155||.2587109</gml:pos></gml:Point><ogc:Distance units="degree">0.46082355604312003</ogc:Distance></ogc:DWithin||></ogc:Filter></wfs:Query></wfs:GetFeature>
>
> note the property name of "the_geom".
>
> This gets a wfs response of:
> |
>
> |<?xml version="1.0" encoding="UTF-8"?>
> ||<ows:ExceptionReport version="1.0.0"
> ||  xsi:schemaLocation="http://www.opengis.net/ows http://maps.gns.cri.nz:80/geoserver/schemas/ows/1.0||.0/owsExceptionReport.xsd"
> ||  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows">
> ||  <ows:Exception exceptionCode="InvalidParameterValue">
> ||    <ows:ExceptionText>Illegal property name: the_geom</ows:ExceptionText>
> ||  </ows:Exception>
> ||</ows:ExceptionReport>
>
> Quite correct - because the geometry is in SHAPE not in the_geom.
>
> What am I doing wrong or has an incompatibility developed with geoserver?
>
> |
>
>
>   


-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.




More information about the Users mailing list