changeset 383:0b813ae17173

Added Point in Polygon Query Support to ArcSDE-Statement-Processing geo-backend/trunk@423 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 15 Dec 2009 10:02:24 +0000
parents 4af6379ac20b
children da2da7bb1aa1
files geo-backend/ChangeLog geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java
diffstat 3 files changed, 25 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/geo-backend/ChangeLog	Fri Dec 11 10:45:18 2009 +0000
+++ b/geo-backend/ChangeLog	Tue Dec 15 10:02:24 2009 +0000
@@ -1,3 +1,13 @@
+2009-12-15  Tim Englich  <tim.englich@intevation.de>
+
+	* src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java (executeQuery): 
+	  We have to use a different SpatialFilter for Point in Polygon Queries as 
+	  in AreaIntersection Statements.
+	  So we have to include a switch which will do that.
+	* src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java (createPoints): 
+	  Added Support of Point-Objects for the possibility to execute a Point in Pologon 
+	  Statement using the ArcSDE.
+
 2009-12-11  Ingo Weinzierl <ingo.weinzierl@intevation.de>
 
 	* src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java:
--- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java	Fri Dec 11 10:45:18 2009 +0000
+++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java	Tue Dec 15 10:02:24 2009 +0000
@@ -24,6 +24,8 @@
 import com.esri.sde.sdk.client.SeShapeFilter;
 import com.esri.sde.sdk.client.SeSqlConstruct;
 import com.vividsolutions.jts.geom.Geometry;
+import com.vividsolutions.jts.geom.Point;
+import com.vividsolutions.jts.geom.Polygon;
 import com.vividsolutions.jts.io.WKTReader;
 
 
@@ -174,7 +176,7 @@
 	                }else{
 	                    wkt = intersectsStmt.substring(intersectsStmt.indexOf("\""), intersectsStmt.lastIndexOf("\"")).replace("\"", "").trim();
 	                }
-	                g = new WKTReader().read(wkt);
+	                g = new WKTReader().read(wkt.toUpperCase());
 	                
 	                if (geometryColumnName == null){
 	                    geometryColumnName = "SHAPE"; // TODO dynamisch aus Intersects auslesen.
@@ -213,9 +215,16 @@
                 
                 SDEPoint[] lPoints = new ArcSDEUtils().createPoints(g);
     
-                shape.generatePolygon(lPoints.length, 1, null, lPoints);
+                int searchMode = SeFilter.METHOD_AI;
+                if (g instanceof Polygon){
+                    shape.generatePolygon(lPoints.length, 1, null, lPoints);
+                }else if (g instanceof Point){
+                    shape.generatePoint(1, lPoints);
+                    searchMode = SeFilter.METHOD_PC;
+                }
+                
                 SeShapeFilter filter = new SeShapeFilter(pLayername[0],
-                        pSpatialColumnName, shape, SeFilter.METHOD_AI);
+                        pSpatialColumnName, shape,searchMode);
                 filters = new SeShapeFilter[1];
                 filters[0] = filter;
             }
--- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java	Fri Dec 11 10:45:18 2009 +0000
+++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java	Tue Dec 15 10:02:24 2009 +0000
@@ -26,6 +26,7 @@
 import com.esri.sde.sdk.client.SeTable;
 import com.vividsolutions.jts.geom.Coordinate;
 import com.vividsolutions.jts.geom.Geometry;
+import com.vividsolutions.jts.geom.Point;
 import com.vividsolutions.jts.geom.Polygon;
 
 /**
@@ -145,6 +146,8 @@
         Coordinate[] coords = null;
         if (g instanceof Polygon) {
             coords = ((Polygon) g).getCoordinates();
+        }else if (g instanceof Point){
+            coords = ((Point)g).getCoordinates();
         }
         if (coords != null){
             SDEPoint[] lSDEPoints = new SDEPoint[coords.length];

http://dive4elements.wald.intevation.org