You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Claus Stadler (Jira)" <ji...@apache.org> on 2022/01/30 04:23:00 UTC
[jira] [Created] (JENA-2266) convertLatLon swaps coordinates
Claus Stadler created JENA-2266:
-----------------------------------
Summary: convertLatLon swaps coordinates
Key: JENA-2266
URL: https://issues.apache.org/jira/browse/JENA-2266
Project: Apache Jena
Issue Type: Bug
Components: GeoSPARQL
Affects Versions: Jena 4.3.2
Reporter: Claus Stadler
The correct setting is that longitude corresponds to x-axis and latitude to y-axis, but in the code lat is passed for x and lon for y.
{code:java}
public class ConvertLatLon {
public static final Literal toLiteral(double lat, double lon) {
checkBounds(lat, lon);
return WKTLiteralFactory.createPoint(lat, lon, SRS_URI.WGS84_CRS);
}
}
{code}
{code:java}
public class WKTLiteralFactory {
public static final Literal createPoint(Double x, Double y, String srsURI) {
String tidyURI = tidySrsURI(srsURI);
return ResourceFactory.createTypedLiteral(tidyURI + "POINT(" + reducePrecision(x) + " " + reducePrecision(y)
+ ")", WKTDatatype.INSTANCE);
}
}
{code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)