Strabon

changeset 918:454a685fbf10

GeoJSONWriter now checks also for geometries with wktLiteral datatype
author Babis Nikolaou <charnik@di.uoa.gr>
date Sun Mar 24 23:39:50 2013 +0200 (2013-03-24)
parents 7e9173482c03
children 6c8b5e31d7fe
files resultio-spatial/sparqlgeojson/src/main/java/org/openrdf/query/resultio/sparqlgeojson/stSPARQLResultsGeoJSONWriter.java
line diff
     1.1 --- a/resultio-spatial/sparqlgeojson/src/main/java/org/openrdf/query/resultio/sparqlgeojson/stSPARQLResultsGeoJSONWriter.java	Sun Mar 24 23:33:47 2013 +0200
     1.2 +++ b/resultio-spatial/sparqlgeojson/src/main/java/org/openrdf/query/resultio/sparqlgeojson/stSPARQLResultsGeoJSONWriter.java	Sun Mar 24 23:39:50 2013 +0200
     1.3 @@ -28,6 +28,7 @@
     1.4  import org.openrdf.query.Binding;
     1.5  import org.openrdf.query.BindingSet;
     1.6  import org.openrdf.query.TupleQueryResultHandlerException;
     1.7 +import org.openrdf.query.algebra.evaluation.function.spatial.AbstractWKT;
     1.8  import org.openrdf.query.algebra.evaluation.function.spatial.WKTHelper;
     1.9  import org.openrdf.query.algebra.evaluation.util.JTSWrapper;
    1.10  import org.openrdf.query.resultio.TupleQueryResultFormat;
    1.11 @@ -159,13 +160,16 @@
    1.12  					} else { // spatial literal WKT or GML
    1.13  						// get the textual representation of the geometry (WKT or GML)
    1.14  						String geoText = value.stringValue();
    1.15 +						Literal literal = (Literal) value;
    1.16  						
    1.17 -						if (XMLGSDatatypeUtil.isWKTLiteral((Literal) value)) {// WKT
    1.18 +						if (XMLGSDatatypeUtil.isWKTLiteral(literal)) {// WKT
    1.19 +							AbstractWKT awkt = new AbstractWKT(geoText, literal.getDatatype().stringValue());
    1.20 +							
    1.21  							// get its geometry
    1.22 -							geom = jts.WKTread(WKTHelper.getWithoutSRID(geoText));
    1.23 +							geom = jts.WKTread(awkt.getWKT());
    1.24  							
    1.25  							// get its SRID
    1.26 -							srid = WKTHelper.getSRID(geoText);
    1.27 +							srid = awkt.getSRID();
    1.28  							
    1.29  						} else { // GML
    1.30  							// get its geometry
    1.31 @@ -173,7 +177,6 @@
    1.32  							
    1.33  							// get its SRID
    1.34  							srid = geom.getSRID();
    1.35 -								
    1.36  						}
    1.37  					}
    1.38