# HG changeset patch # User Tim Englich # Date 1268748438 0 # Node ID 9bcc423d8d76e3b10daa3c2934437a1e3a3fa97c # Parent 203f95af5b2c95d6536fc53a246b4d62c024b957 Added Support for SpatialQueries using LineString as Geometry of Interest. geo-backend/trunk@790 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 203f95af5b2c -r 9bcc423d8d76 geo-backend/ChangeLog --- 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 + + * 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 * src/main/java/de/intevation/gnv/geobackend/sde/datasources/Row.java (getPosValue): diff -r 203f95af5b2c -r 9bcc423d8d76 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 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], diff -r 203f95af5b2c -r 9bcc423d8d76 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 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++) {