Strabon

changeset 915:e08f9275cd93

implemented store of geometries with wktLiteral datatype
author Babis Nikolaou <charnik@di.uoa.gr>
date Sun Mar 24 23:19:01 2013 +0200 (2013-03-24)
parents a83d7023a89b
children b58aa113f25e
files evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/AbstractWKT.java generaldb/src/main/java/org/openrdf/sail/generaldb/schema/LiteralTable.java
line diff
     1.1 --- a/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/AbstractWKT.java	Sat Mar 23 21:43:04 2013 +0200
     1.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/AbstractWKT.java	Sun Mar 24 23:19:01 2013 +0200
     1.3 @@ -73,9 +73,9 @@
     1.4  	}
     1.5  	
     1.6  	private void parseWKTLITERAL(String literalValue) {
     1.7 -		String wkt = literalValue.trim();
     1.8 +		wkt = literalValue.trim();
     1.9  		// FIXME: the default value for wktLiteral
    1.10 -		//srid = ;
    1.11 +		srid = GeoConstants.defaultSRID;
    1.12  		
    1.13  		if (wkt.charAt(0) == '<') {// if a CRS URI is specified
    1.14  			int uriIndx = wkt.indexOf('>');
     2.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/schema/LiteralTable.java	Sat Mar 23 21:43:04 2013 +0200
     2.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/schema/LiteralTable.java	Sun Mar 24 23:19:01 2013 +0200
     2.3 @@ -13,6 +13,7 @@
     2.4  import javax.xml.bind.JAXBException;
     2.5  
     2.6  import org.openrdf.sail.generaldb.exceptions.conversionException;
     2.7 +import org.openrdf.query.algebra.evaluation.function.spatial.AbstractWKT;
     2.8  import org.openrdf.query.algebra.evaluation.function.spatial.StrabonPolyhedron;
     2.9  import org.openrdf.query.algebra.evaluation.function.spatial.WKTHelper;
    2.10  import org.openrdf.query.algebra.evaluation.util.JTSWrapper;
    2.11 @@ -201,8 +202,9 @@
    2.12  	public void insertWKT(Number id, String label, String datatype, Timestamp start,Timestamp end) throws SQLException, NullPointerException,InterruptedException,IllegalArgumentException
    2.13  	{
    2.14  		try {
    2.15 -			Geometry geom = JTSWrapper.getInstance().WKTread(label);
    2.16 -			geoSpatialTable.insert(id, WKTHelper.getSRID(label),/* start,end,*/ JTSWrapper.getInstance().WKBwrite(geom));
    2.17 +			AbstractWKT awkt = new AbstractWKT(label, datatype);
    2.18 +			Geometry geom = JTSWrapper.getInstance().WKTread(awkt.getWKT());
    2.19 +			geoSpatialTable.insert(id, awkt.getSRID(),/* start,end,*/ JTSWrapper.getInstance().WKBwrite(geom));
    2.20  			
    2.21  		} catch (ParseException e) {
    2.22  			throw new IllegalArgumentException(e);