Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-2266

convertLatLon swaps coordinates

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • Jena 4.3.2
    • None
    • GeoSPARQL
    • None

    Description

      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.

      public class ConvertLatLon {
          public static final Literal toLiteral(double lat, double lon) {
              checkBounds(lat, lon);
              return WKTLiteralFactory.createPoint(lat, lon, SRS_URI.WGS84_CRS);
          }
      }
      
      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);
          }
      }
      

      Attachments

        1. image-2022-01-30-18-28-56-974.png
          32 kB
          Greg Albiston

        Activity

          People

            Unassigned Unassigned
            Aklakan Claus Stadler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: