Strabon
changeset 509:fc8d2ebc91ce
fixed bug when parsing geometries in WKT with embedded the SRID URI to get the SRID number
author | Babis Nikolaou <charnik@di.uoa.gr> |
---|---|
date | Wed Jul 25 18:38:08 2012 +0300 (2012-07-25) |
parents | f028b9815056 |
children | 9ad5fecacad6 |
files | evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/WKTHelper.java |
line diff
1.1 --- a/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/WKTHelper.java Wed Jul 25 18:22:23 2012 +0300 1.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/WKTHelper.java Wed Jul 25 18:38:08 2012 +0300 1.3 @@ -15,6 +15,7 @@ 1.4 1.5 private static String SRID_DELIM = ";"; 1.6 private static String CUT_DELIM = "/"; 1.7 + private static String URI_ENDING = ">"; 1.8 1.9 /** 1.10 * Returns the given WKT without the SRID (if any). 1.11 @@ -50,7 +51,7 @@ 1.12 int pos = wkt.indexOf(SRID_DELIM); 1.13 if (pos != -1) { 1.14 try { 1.15 - srid = Integer.parseInt(wkt.substring(wkt.lastIndexOf(CUT_DELIM) + 1)); 1.16 + srid = Integer.parseInt(wkt.substring(wkt.lastIndexOf(CUT_DELIM) + 1).replace(URI_ENDING, "")); 1.17 1.18 } catch (NumberFormatException e) { 1.19 logger.warn("[Strabon.WKTHelper] Was expecting an integer. The URL of the SRID was {}. Continuing with the default SRID, {}", wkt.substring(pos + 1), srid);