You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Greg Albiston (Jira)" <ji...@apache.org> on 2022/01/30 18:29:00 UTC

[jira] [Updated] (JENA-2266) convertLatLon swaps coordinates

     [ https://issues.apache.org/jira/browse/JENA-2266?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Albiston updated JENA-2266:
--------------------------------
    Attachment: image-2022-01-30-18-28-56-974.png

> 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)