Mercurial > dive4elements > gnv-client
changeset 879:9bcc423d8d76
Added Support for SpatialQueries using LineString as Geometry of Interest.
geo-backend/trunk@790 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Tue, 16 Mar 2010 14:07:18 +0000 (2010-03-16) |
parents | 203f95af5b2c |
children | 7a133dd83dbd |
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(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/geo-backend/ChangeLog Fri Mar 12 10:58:24 2010 +0000 +++ b/geo-backend/ChangeLog Tue Mar 16 14:07:18 2010 +0000 @@ -1,3 +1,10 @@ +2010-03-16 Tim Englich <tim.englich@intevation.de> + + * src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java (createPoints): + Now it is also possible to extract Points from a given LineString. + * src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java (executeQuery): + Added Support for SpatialQueries using LineString as Geometry of Interest. + 2010-03-12 Tim Englich <tim.englich@intevation.de> * src/main/java/de/intevation/gnv/geobackend/sde/datasources/Row.java (getPosValue):
--- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java Fri Mar 12 10:58:24 2010 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java Tue Mar 16 14:07:18 2010 +0000 @@ -1,5 +1,13 @@ package de.intevation.gnv.geobackend.sde.datasources; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.sql.Statement; + +import org.apache.log4j.Logger; + import com.esri.sde.sdk.client.SDEPoint; import com.esri.sde.sdk.client.SeColumnDefinition; import com.esri.sde.sdk.client.SeConnection; @@ -18,23 +26,14 @@ import com.esri.sde.sdk.client.SeShape; 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.LineString; import com.vividsolutions.jts.geom.Point; import com.vividsolutions.jts.geom.Polygon; - import com.vividsolutions.jts.io.WKTReader; import de.intevation.gnv.geobackend.util.RedundancyRemover; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.SQLWarning; -import java.sql.Statement; - -import org.apache.log4j.Logger; - /** * @author Tim Englich (tim.englich@intevation.de) * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) @@ -234,6 +233,9 @@ }else if (g instanceof Point){ shape.generatePoint(1, lPoints); searchMode = SeFilter.METHOD_PC; + }else if (g instanceof LineString){ + shape.generateLine(lPoints.length, 1, null, lPoints); + searchMode = SeFilter.METHOD_LCROSS; } SeShapeFilter filter = new SeShapeFilter(pLayername[0],
--- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java Fri Mar 12 10:58:24 2010 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java Tue Mar 16 14:07:18 2010 +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.LineString; import com.vividsolutions.jts.geom.Point; import com.vividsolutions.jts.geom.Polygon; @@ -148,7 +149,12 @@ coords = ((Polygon) g).getCoordinates(); }else if (g instanceof Point){ coords = ((Point)g).getCoordinates(); + }else if (g instanceof LineString){ + coords = ((LineString)g).getCoordinates(); + }else{ + coords = g.getCoordinates(); } + if (coords != null){ SDEPoint[] lSDEPoints = new SDEPoint[coords.length]; for (int i = 0; i < coords.length; i++) {