WebGIS Discussions

Need a push in the right direction when configuring WebMap, Portal or SDI services? Looking for hints and tips, or just looking for Ideas and information? The WebGIS discussion board is where you start those discussions, connect and share information.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 45
Registered: ‎01-11-2017
Accepted Solution

WFS Spatial Query by X,Y location or point

Hi,

 

Any advice on how to requrest a WFS Spatial Query by X,Y location or point geometry which intersects a  feature.

 

We are able to do BBOX and attribute queries but unable to run any spatial queries. 

 

Any spatial query sample would be of great help as we are not able to find this anywhere in documentation.

 

Tried this one below as part of the requrest but it returns error.

<Intersects>
<PropertyName>Geometry</PropertyName>
<Literal>
<Point srsName="EPSG:4326">
<gml:coordinates>55,24</gml:coordinates>
</Point>
</Literal>
</Intersects>

Highlighted
Technical Evangelist
Posts: 1,351
Registered: ‎09-11-2015

Re: WFS Spatial Query by X,Y location or point

Hi, try something like this:

 

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs/2.0" version="2.0.0" service="WFS" xmlns:gmgml="http://www.intergraph.com/geomedia/gml" count="300" >
  <wfs:Query typeNames="gmgml:States" srsName="EPSG:4326">
      <fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gmgml="http://www.intergraph.com/geomedia/gml">
       <fes:Intersects>
            <fes:ValueReference>gmgml:Geometry</fes:ValueReference>
            <Point srsName="EPSG:4326" xmlns="http://www.opengis.net/gml">
                <pos>39.73917 -104.98472</pos>
            </Point>
       </fes:Intersects>
    </fes:Filter>
  </wfs:Query>
</wfs:GetFeature>
Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Highlighted
Contributor
Posts: 45
Registered: ‎01-11-2017

Re: WFS Spatial Query by X,Y location or point

Hi,

 

I tried as you suggested and tried with different srs and values. But always returns invalid parameter value error. Please see the screenshot below. Any suggestions?

 

wfs.JPG

Highlighted
Contributor
Posts: 45
Registered: ‎01-11-2017

Re: WFS Spatial Query by X,Y location or point

Hi,

 

It worked after setting Value reference as GEOMETRY in caps instead gmgml:Geometry.

 

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs/2.0" version="2.0.0" service="WFS" xmlns:gmgml="http://www.intergraph.com/geomedia/gml" count="300" >
  <wfs:Query typeNames="gmgml:MunicipalSectors" srsName="EPSG:4326">
      <fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gmgml="http://www.intergraph.com/geomedia/gml">
       <fes:Intersects>
            <fes:ValueReference>GEOMETRY</fes:ValueReference>
            <Point srsName="EPSG:4326" xmlns="http://www.opengis.net/gml">
                <pos>24.237886249727683 55.73108188168665</pos>
            </Point>
       </fes:Intersects>
    </fes:Filter>
  </wfs:Query>
</wfs:GetFeature>