[ https://issues.apache.org/jira/browse/JENA-2266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17484490#comment-17484490 ]
Claus Stadler commented on JENA-2266: ------------------------------------- Hm I see. So the safest approach to ending up with a JTS Geometry which works out-of-the-box with e.g. leaflet via JTS' GeoJsonWriter or WktWriter is to to force the SRS using geometryWrapper.convert(SRS_URI.DEFAULT_WKT_CRS84).getParsingGeometry. At this stage getXYGeometry should be the same - right? - Or is one of the geometry getters preferred over the other? It seems this issue can be closed as "not a bug". > 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 > Priority: Major > Attachments: image-2022-01-30-18-28-56-974.png > > > 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)