# HG changeset patch # User Tim Englich # Date 1260871344 0 # Node ID 0b813ae171736a5dd6ed1fa10cc8ae0b1ddc36be # Parent 4af6379ac20b2d0e0b6cc9491877cc1be552ec99 Added Point in Polygon Query Support to ArcSDE-Statement-Processing geo-backend/trunk@423 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 4af6379ac20b -r 0b813ae17173 geo-backend/ChangeLog --- 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 + + * 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 * src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java: diff -r 4af6379ac20b -r 0b813ae17173 geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.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; } diff -r 4af6379ac20b -r 0b813ae17173 geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java --- 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];