Uploaded image for project: 'Spatial Information Systems'
  1. Spatial Information Systems
  2. SIS-376

Geographic/geocentric conversion fails if the geographic CRS is two-dimensional

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.7, 0.8
    • Fix Version/s: 1.0
    • Component/s: Referencing
    • Labels:
      None

      Description

      Following Java code:

      GeographicCRS geographic = CommonCRS.WGS84.geographic();
      GeocentricCRS geocentric = CommonCRS.WGS84.geocentric();
      CRS.findOperation(geographic, geocentric, null);
      

      fails with the following exception.

      org.apache.sis.referencing.factory.InvalidGeodeticParameterException: Les transformations « Affine parametric transformation » et « Geographic/geocentric conversions » ne peuvent pas être combinées. Les dimensions des objets (2D et 3D) ne concordent pas.
          at org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory.createConcatenatedTransform(DefaultMathTransformFactory.java:1313)
          at org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory.swapAndScaleAxes(DefaultMathTransformFactory.java:1158)
          at org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory.createParameterizedTransform(DefaultMathTransformFactory.java:1058)
          at org.apache.sis.referencing.operation.CoordinateOperationFinder.createOperationStep(CoordinateOperationFinder.java:572)
          at org.apache.sis.referencing.operation.CoordinateOperationFinder.createOperation(CoordinateOperationFinder.java:272)
          at org.apache.sis.referencing.operation.DefaultCoordinateOperationFactory.createOperation(DefaultCoordinateOperationFactory.java:814)
          at org.apache.sis.referencing.CRS.findOperation(CRS.java:644)
      Caused by: org.opengis.geometry.MismatchedDimensionException: Les transformations « Affine parametric transformation » et « Geographic/geocentric conversions » ne peuvent pas être combinées. Les dimensions des objets (2D et 3D) ne concordent pas.
          at org.apache.sis.referencing.operation.transform.ConcatenatedTransform.create(ConcatenatedTransform.java:164)
          at org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory.createConcatenatedTransform(DefaultMathTransformFactory.java:1311)
          ... 7 more
      

      If we replace the call to geographic() by a call to geographic3D, then the code succeed and the converted coordinates are corrects.

        Attachments

          Activity

            People

            • Assignee:
              desruisseaux Martin Desruisseaux
              Reporter:
              desruisseaux Martin Desruisseaux
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: