RE: [Geoserver-devel] Geoserver returning out of range geometry

Changing the filter from "Intersect" to "Intersects" fixed the problem.

many thanks!
mike

-----Original Message-----
From: cholmes@anonymised.com [mailto:cholmes@anonymised.com]
Sent: Thu 10/7/2004 5:53 AM
To: Michael Leong
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] Geoserver returning out of range geometry
Yeah, that's definitely not functioning right, it looks like the filter
isn't successfully making it into geotools. There should be a log
statement of something like 'To gt2: Query', which will show what the
gt2 filter being passed in is.

Ok, just looked into it, the problem is that it should be 'Intersects'
instead of 'Intersect'. Looking at the OGC specs this is obviously
screwy, since in the capabilities section it is defined as 'Intersect'.
THe filter spec never gives a direct example, but refers to Intersects
of Simple Features for SQL. I guess the one deciding factor is that
the official ogc CITE tests use Intersect.

That said GeoServer really should handle this better, either just accept
it or throw a real error, instead of just returning all features.

If changing to Intersects doesn't fix it let me know and I can
investigate more.

best regards,

Chris

Quoting Michael Leong <mleong@anonymised.com>:

Geoserver is returning data that does not intersect w/ the specified
box

wfs post req:

<?xml version="1.0"?>
<GetFeature xmlns="http://www.opengis.net/wfs&quot;
xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:ogc="http://www.opengis.net/ogc&quot; version="1.0" service="WFS"
maxFeatures="2">
<Query typeName="gex:bexar_parcels_join" srsName="EPSG:4326">
<ogc:Filter>
<ogc:Intersect>
<ogc:PropertyName>the_geom</ogc:PropertyName>
<gml:Box srsName="EPSG:4326">
<gml:coordinates>-95.426341899115,29.758758729301654
-95.40965810088501,29.773241270698342</gml:coordinates>
</gml:Box>
</ogc:Intersect>
</ogc:Filter>
</Query>
</GetFeature>

Part of the result:

<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs&quot;
xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:gex="http://www.globexplorer.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.globexplorer.com

http://wfs.globexplorer.com:80/geoserver/wfs/DescribeFeatureType?typeName=gex:bexar_parcels_join

http://www.opengis.net/wfs

http://wfs.globexplorer.com:80/geoserver/data/capabilities/wfs/1.0.0/WFS-basic.xsd&quot;&gt;

  <gml:boundedBy>
    <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
      <gml:coordinates decimal="." cs="," ts="
">-98.91130732,29.11433031 -98.11691522,29.76063178</gml:coordinates>
    </gml:Box>
  </gml:boundedBy>
  <gml:featureMember>
    <gex:bexar_parcels_join fid="bexar_parcels_join.0">
      <gex:area>2727124.88114</gex:area>
      <gex:perimeter>6446.09043</gex:perimeter>
      <gex:parnum>2</gex:parnum>
      <gex:parid>900200257</gex:parid>
      <gex:account>048190000010</gex:account>
      <gex:legal>819 P-1 ABS 325</gex:legal>
      <gex:street>0 AMMANN RD</gex:street>
      <gex:suffix>1</gex:suffix>
      <gex:pid>048190000010</gex:pid>
      <gex:proptype>F</gex:proptype>
      <gex:streetname>AMMANN</gex:streetname>
      <gex:streetno>0</gex:streetno>
      <gex:streetdir>W</gex:streetdir>
      <gex:streetdesc>DR</gex:streetdesc>
      <gex:subdivisio>CM APPR GEO#1 AC W OF 281</gex:subdivisio>
      <gex:stories>0.0</gex:stories>
      <gex:landuse>D1</gex:landuse>
      <gex:descriptio>VACANT RANCH LAND</gex:descriptio>
      <gex:deedsale>200006</gex:deedsale>
      <gex:acreage>33.00</gex:acreage>
      <gex:landsqft>1437480</gex:landsqft>
      <gex:yearbuilt>1987</gex:yearbuilt>
      <gex:yearremode>1987</gex:yearremode>
      <gex:roof>WJ</gex:roof>
      <gex:foundation>00</gex:foundation>
      <gex:neighborco>22150</gex:neighborco>
      <gex:schoolcode>00</gex:schoolcode>
      <gex:heat>C</gex:heat>
      <gex:aircond>0</gex:aircond>
      <gex:appraisaly>2003</gex:appraisaly>
      <gex:totaltaxes>1860.3000</gex:totaltaxes>
      <gex:imprvalue>0</gex:imprvalue>
      <gex:landvalue>73500</gex:landvalue>
      <gex:assessedva>73500</gex:assessedva>
      <gex:ownername>SCHAEFER HARVEY O &amp; EVELYN</gex:ownername>
      <gex:owneraddre>981 SCHAEFER</gex:owneraddre>
      <gex:ownercity>BULVERDE</gex:ownercity>
      <gex:ownerstate>TX</gex:ownerstate>
      <gex:ownerzip>78163</gex:ownerzip>
      <gex:ownerzip4>3031</gex:ownerzip4>
      <gex:ownerroute>H052</gex:ownerroute>
      <gex:ownergende>I</gex:ownergende>
      <gex:ownerlastn>SCHAEFER</gex:ownerlastn>
      <gex:ownerfirst>HARVEY O &amp; EVELYN</gex:ownerfirst>
      <gex:ownerdeliv>819</gex:ownerdeliv>
      <gex:owneroccup>N</gex:owneroccup>
      <gex:taxpayerna>SCHAEFER HARVEY O &amp; EVELYN</gex:taxpayerna>
      <gex:taxpayerad>981 SCHAEFER</gex:taxpayerad>
      <gex:taxpayerci>BULVERDE</gex:taxpayerci>
      <gex:taxpayerst>TX</gex:taxpayerst>
      <gex:taxpayerzi>78163</gex:taxpayerzi>
      <gex:taxpayerro>H052</gex:taxpayerro>
      <gex:taxpayerge>I</gex:taxpayerge>
      <gex:taxpayerla>SCHAEFER</gex:taxpayerla>
      <gex:taxpayerfi>HARVEY O &amp; EVELYN</gex:taxpayerfi>

<gex:doc>http://demos.globexplorer.com/Docs/Harris/TX-Harri&lt;/gex:doc&gt;
      <gex:the_geom>
        <gml:MultiPolygon
srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
          <gml:polygonMember>
            <gml:Polygon>
              <gml:outerBoundaryIs>
                <gml:LinearRing>
                  <gml:coordinates decimal="." cs="," ts="
">-98.54986536,29.7605701 -98.54989773,29.75803172
-98.54992816,29.75553803 -98.55483702,29.75557154
-98.5547521,29.75585679 -98.55473554,29.75618674
-98.5550943,29.75717794 -98.55521223,29.75789114
-98.55515802,29.75804928 -98.55495444,29.75889097
-98.55492255,29.75893268 -98.55489448,29.75897001
-98.55486772,29.75900183 -98.55483452,29.75904905
-98.55480768,29.7590919 -98.55479109,29.75911495
-98.55477452,29.75913471 -98.55473003,29.75917084
-98.5546779,29.75921575 -98.55464738,29.75924204
-98.55461056,29.7592672 -98.55456227,29.75930441
-98.55451781,29.75933724 -98.55447586,29.75937229
-98.55443011,29.75940732 -98.55437545,29.75945221
-98.55432714,29.75949274 -98.55426737,29.75954643
-98.55421648,29.75959355 -98.5541593,29.75963843
-98.55409322,29.75968988 -98.55404619,29.75972711
-98.55399925,29.75975331 -98.55393835,29.75978715
-98.55387363,29.75982538 -98.5537988,29.75986466
-98.553715,29.75992042 -98.55366169,29.7599521
-98.55356656,29.76000339 -98.5534905,29.76003605
-98.55342081,29.76006323 -98.5533815,29.76008175
-98.5532574,29.76011856 -98.55321814,29.76013047
-98.55310791,29.76017176 -98.5530129,29.76020541
-98.55292295,29.76023689 -98.55279499,29.76028359
-98.55270505,29.76031397 -98.55262147,29.76033997
-98.55253532,29.76037147 -98.5524479,29.76040296
-98.55236176,29.76043226 -98.55223133,29.76047013
-98.55213766,29.76049277 -98.5520516,29.76051214
-98.55194021,29.76053799 -98.55184656,29.76055732
-98.55174282,29.7605755 -98.55164035,29.76059147
-98.55154676,29.76060309 -98.55145825,29.76061032
-98.55137481,29.76061649 -98.55129388,29.76062376
-98.55122436,29.76062779 -98.55094507,29.76063178
-98.55089581,29.76062931 -98.55085285,29.76062797
-98.55080107,29.76062438 -98.55074297,29.76062076
-98.55068486,29.76061824 -98.55061536,29.76061896
-98.55051556,29.76061511 -98.55046505,29.76061043
-98.55038423,29.76060337 -98.5503034,29.76059852
-98.55018342,29.76058905 -98.55009378,29.76057974
-98.55002557,29.76057496 -98.54996746,29.76057354
-98.54989544,29.76057204 -98.54986536,29.7605701</gml:coordinates>
                </gml:LinearRing>
              </gml:outerBoundaryIs>
            </gml:Polygon>
          </gml:polygonMember>
        </gml:MultiPolygon>
      </gex:the_geom>
    </gex:bexar_parcels_join>
  </gml:featureMember>

==========================================================================

As you can see, the returned geometry does not intersect w/ the
bounding box. In fact, my postgis backend don't even have any data
within the specified bounding box! My db only have data from
(-98.9113073151635, 29.1143303138412) to (-98.1169152233766,
29.7606317808985).

>From the tomcat logs, two weird sql statements were executed:
SELECT COUNT(*) as cnt FROM "bexar_parcels_join" WHERE TRUE

SELECT AsText(force_2d(Envelope(Extent("the_geom")))) FROM
"bexar_parcels_join" WHERE TRUE

Those 2 statements basically killed my postgis server since it walks
through every roll, twice!

Any workarounds/fixes?

Enviro:
geoserver 1.22, installed from war file
tomcat 5.0.25
log level: all
db: pgsql 7.4 w/ GEOS and postgis addon
os: redhat 9
java: 1.4.1_03

thanks!
mike

-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on
ITManagersJournal
Use IT products in your business? Tell us what you think of them.
Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find
out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/