Strabon

changeset 412:0b9312eb8bba

Fixed Issue with buggy 'decode' function in JTSWrapper.

Cause of issue: When a geometry was constructed from an RDF literal in GeneralDBEvaluation,
no SRID information was utilized. Now, the literal is parsed to determine the SRID that it
is expressed in (or if no SRID is present in the literal, the default case of 4326 is used)
author Manos Karpathiotakis <mk@di.uoa.gr>
date Tue Jul 10 00:46:19 2012 +0300 (2012-07-10)
parents 6c25dbff525d
children d66ca6eab8b1
files generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBEvaluation.java
line diff
     1.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBEvaluation.java	Mon Jul 09 20:49:14 2012 +0300
     1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBEvaluation.java	Tue Jul 10 00:46:19 2012 +0300
     1.3 @@ -315,6 +315,18 @@
     1.4  					 * in order to have them appear in Select Clause along with the appropriate datatype.
     1.5  					 */
     1.6  					rightGeom = new StrabonPolyhedron(((Literal) rightResult).getLabel()).getGeometry();
     1.7 +					int sridPosition = ((Literal) rightResult).getLabel().indexOf(';');
     1.8 +					//Default case
     1.9 +					if(sridPosition == -1)
    1.10 +					{
    1.11 +						rightGeom.setSRID(4326);
    1.12 +					}
    1.13 +					else
    1.14 +					{
    1.15 +						sridPosition = ((Literal) rightResult).getLabel().lastIndexOf('/');
    1.16 +						int srid = Integer.parseInt(((Literal) rightResult).getLabel().substring(sridPosition+1));
    1.17 +						rightGeom.setSRID(srid);
    1.18 +					}
    1.19  				}
    1.20  				else
    1.21  				{	//SHOULD NEVER REACH THIS CASE!