Hi list,

Seems I solved this issue myself. When I replace 'outerBoundaryIs' by 
'exterior', the polygon isn't empty anymore and the same bunch of features as 
with the GET-request are returned. Yay!

Now I have another question. When I turned verbose logging on I see the 
following query being executed fort this request:

SELECT "prop1","prop2" FROM "table1" WHERE  
"the_geom".Filter(geometry::STGeomFromText('POLYGON ((142578.64599609 
252217.79003906, 73781.897460938 141983.61767578, 287078.38037109 
146764.85888672, 142578.64599609 252217.79003906))', 31370)) = 1 AND 
"the_geom".STIntersects(geometry::STGeomFromText('POLYGON ((142578.64599609 
252217.79003906, 73781.897460938 141983.61767578, 287078.38037109 
146764.85888672, 142578.64599609 252217.79003906))', 31370)) = 1

Why does the where-clause has two conditions: Filter and STIntersects? I would 
only expecte the STIntersects one.

Kind regards,
Roel De Nijs
Senior Java Developer


Van: Roel De Nijs [mailto:[email protected]]
Verzonden: woensdag 18 maart 2015 11:50
Aan: Mailinglist: Geoserver - Users
Onderwerp: [Geoserver-users] Getting features intersecting with a polygon

Hi list,

We are using GeoServer 2.6.2 and I want to get all the features from a given 
layer (based on a SQL Server table) intersecting with a given polygon. So I 
created the following GET-request which returns a bunch of features (as 
expected).

geoserver/wfs?service=wfs&request=GetFeature&version=1.1.0&typeName=JAGIS:gemeente&outputFormat=GML2&cql_filter=INTERSECTS(SP_GEOMETRY,
 POLYGON ((142578.64599609 252217.79003906, 73781.897460938 141983.61767578, 
287078.38037109 146764.85888672, 142578.64599609 252217.79003906)))

Because I don't know how big the polygon is going to get, I want to send a 
POST-request, so I created (using the demo requests of geoserver) the wfs 
GetFeature-request (at the bottom of this message) which (in my humble opinion) 
should return the same bunch of features returned by the GET-request. But for 
some reason I can't figure out the returned feature collection is empty. What 
am I missing here? If I check the geoserver logs, I see this request being 
logged. So for some reason an empty polygon is used.

Request: getFeature
    service = WFS
    version = 1.1.0
    baseUrl = ...
    query[0]:
        filter = [ SP_GEOMETRY intersects POLYGON EMPTY ]
        typeName[0] = {JAGIS}gemeente
    outputFormat = text/xml; subtype=gml/3.1.1
    resultType = results

Kind regards,
Roel De Nijs
Senior Java Developer

<wfs:GetFeature service="WFS" version="1.1.0"
                xmlns:wfs="http://www.opengis.net/wfs";
                xmlns="http://www.opengis.net/ogc";
                xmlns:gml="http://www.opengis.net/gml";
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
                xsi:schemaLocation="http://www.opengis.net/wfs
                                    
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd";>
  <wfs:Query typeName="JAGIS:gemeente">
    <Filter>
      <Intersects>
        <PropertyName>SP_GEOMETRY</PropertyName>
        <gml:Polygon srsName="http://www.opengis.net/gml/srs/epsg.xml#31370";>
          <gml:outerBoundaryIs>
            <gml:LinearRing>
              <gml:coordinates decimal="." cs="," ts=" ">
                142578.64599609,252217.79003906 73781.897460938,141983.61767578 
287078.38037109,146764.85888672 142578.64599609,252217.79003906
              </gml:coordinates>
            </gml:LinearRing>
          </gml:outerBoundaryIs>
        </gml:Polygon>
      </Intersects>
    </Filter>
  </wfs:Query>
</wfs:GetFeature>


________________________________

Volg Aquafin op Facebook<https://www.facebook.com/AquafinNV> | 
Twitter<https://twitter.com/aquafinnv> | 
YouTube<http://www.youtube.com/channel/UCk_4P5BJ-MtEEDCkCsR_KqQ?feature=mhee> | 
LinkedIN<http://www.linkedin.com/company/aquafin/products>

Disclaimer: zie www.aquafin.be<http://www.aquafin.be>   P Denk aan het milieu. 
Druk deze mail niet onnodig af.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to