[mapserver-users] WFS Spatial Filter Problem

John Callahan john.callahan at udel.edu
Fri Aug 5 09:04:32 EDT 2011


This thread may or may not help:
http://osgeo-org.1803224.n2.nabble.com/WFS-intersect-request-td6458533.html

I have not tried using AND compound filters.  The following format does work
for me using the BBOX filter.

<ogc:BBOX>
<ogc:PropertyName>SHAPE</ogc:PropertyName>
<gml:Envelope xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:26957">
<gml:lowerCorner>149081.76574899518 163078.62572595105</gml:lowerCorner>
<gml:upperCorner>205627.85303800018 194899.95291598293</gml:upperCorner>
</gml:Envelope>
</ogc:BBOX>

- John

***********************************
John Callahan, Research Scientist
Delaware Geological Survey
University of Delaware
URL: http://www.dgs.udel.edu
*******************************


On Fri, Aug 5, 2011 at 7:02 AM, Bryan Hempen <bhempen at sciops.esa.int> wrote:

> **
> The problem: I am trying to implement something similar to
> http://openlayers.org/dev/examples/wfs-spatial-filter.html with my own
> data served by MapServer through a WFS. I just changed some lines in the
> code to make it work with MapServer, so the code is almost equal to the code
> in the example at the moment. So far it's working fine UNTIL I drag the
> polygon to apply the spatial filter! According to the getCapabitilies the
> server should be able to handle the request:
>
> ...
>   <ogc:Spatial_Capabilities>
>     <ogc:Spatial_Operators>
>       <ogc:Equals/>
>       <ogc:Disjoint/>
>       <ogc:Touches/>
>       <ogc:Within/>
>       <ogc:Overlaps/>
>       <ogc:Crosses/>
>       <ogc:Intersect/>
>       <ogc:Contains/>
>       <ogc:DWithin/>
>       <ogc:BBOX/>
>     </ogc:Spatial_Operators>
>   </ogc:Spatial_Capabilities>
> ...
>
> Both WFS GetFeature requests are sent via HTTP POST. The first one that
> works (called on page load) looks like this:
>
> <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs"<http://www.opengis.net/wfs>xmlns:xsi="http  ://
> www.w3.org/2001/XMLSchema-instance" service="WFS" version="1.0.0"
> xsi:schemaLocation="http://www.opengis.net/wfs
> http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"<http://www.opengis.net/wfshttp://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd>
> >
>     <wfs:Query typeName="omega">
>         <ogc:Filter xmlns:ogc="http://www  .opengis.net/ogc"<http://www%C2%A0.opengis.net/ogc>
> >
>             <ogc:BBOX>
>                 <ogc:PropertyName>msGeometry</ogc:PropertyName>
>                 <gml:Box xmlns:gml="http:  //www.opengis.net/gml"<http:%C2%A0//www.opengis.net/gml>srsName="EPSG:4326">
>                     <gml:coordinates decimal="." cs="," ts="
> ">135.45,-47.425 157.95,-36.175</gml:coordinates>
>                 </gml:Box>
>             </ogc:BBOX>
>         </ogc:Filter>
>     </wfs:Query>
> </wfs:GetFeature>
>
> The request not working looks like this:
>
> <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs"<http://www.opengis.net/wfs>xmlns:xsi=
> "http://www.w3.org/2001/XMLSchema-instance"<http://www.w3.org/2001/XMLSchema-instance>service="WFS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs
> http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"<http://www.opengis.net/wfshttp://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd>
> >
>   <wfs:Query xmlns:ms="http://mapserver.gis.umn.edu/mapserver"<http://mapserver.gis.umn.edu/mapserver>typeName="ms:omega">
>     <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"<http://www.opengis.net/ogc>
> >
>       <ogc:And>
>         <ogc:Intersects>
>           <ogc:PropertyName>msGeometry</ogc:PropertyName>
>           <gml:Polygon xmlns:gml="http://www.opengis.net/gml"<http://www.opengis.net/gml>srsName="EPSG:4326">
>             <gml:outerBoundaryIs>
>               <gml:LinearRing>
>                 <gml:coordinates decimal="." cs="," ts="
> ">145.72880866081,-40.709423872828 145.83867194206,-42.752880904078
> 148.34355475456,-40.995068404078
> 145.72880866081,-40.709423872828</gml:coordinates>
>               </gml:LinearRing>
>             </gml:outerBoundaryIs>
>           </gml:Polygon>
>         </ogc:Intersects>
>         <ogc:BBOX>
>           <ogc:PropertyName>msGeometry</ogc:PropertyName>
>           <gml:Box xmlns:gml="http://www.opengis.net/gml"<http://www.opengis.net/gml>srsName="EPSG:4326">
>             <gml:coordinates decimal="." cs="," ts="
> ">135.45,-47.40302734375 157.95,-36.15302734375</gml:coordinates>
>           </gml:Box>
>         </ogc:BBOX>
>       </ogc:And>
>     </ogc:Filter>
>   </wfs:Query>
> </wfs:GetFeature>
>
> Does anyone have an idea? Any help is appreciated, I am stuck.
>
> The setup:
>
>    - OS: Red Hat Enterprise Linux 5.4
>    - PostgreSQL 8.2
>    - PostGIS 1.3
>     - MapServer 5.6.5
>    - OpenLayers, one of the latest versions. ProxyHost set and working
>    (calling the proxy.cgi shows OpenLayers website)
>
> Kind regards,
> Bryan
>
> ================================================================================================
> This message and any attachments are intended for the use of the addressee or addressees only. The unauthorised disclosure,
>
> use, dissemination or copying (either in whole or in part) of its content is not permitted. If you received this message in
>
> error, please notify the sender and delete it from your system. Emails can be altered and their integrity cannot be guaranteed by
>
> the sender.
>
> Please consider the environment before printing this email.
> =================================================================================================
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110805/024e66a6/attachment.html


More information about the mapserver-users mailing list