GeoTools
  1. GeoTools
  2. GEOT-1783

OperationNotFoundException when sourceCRS is a ProjectedCRS + VerticalCRS

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.5-M0
    • Fix Version/s: 2.7.6
    • Component/s: referencing
    • Labels:
      None

      Description

      DefaultCoordinateOperationFactory.createOperation works as expected with 3D or 4D source CRS in the following cases:

      • No datum shift.
      • Datum shift required but no vertical axis (only a temporal one).
      • Datum shift required but the 3D CRS is a GeographicCRS with height above the ellipsoid.

      But it doesn't work anymore in the following cases:

      • Datum shift required and the vertical axis is height above the geoid. This is the subject of "referencing 3D" and will not be discussed further in this issue.
      • Datum shift required, the vertical axis is height above the ellipsoid and the horizontal CRS is a ProjectedCRS.

      The last failure is unexpected. I suspect (but didn't tested) that it would occur with any derived CRS, not just ProjectedCRS. Steps to reproduce:

      @Test
      public void testProjected4D() throws Exception {
          CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:3395");
          CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:27572");
          sourceCRS = new DefaultCompoundCRS("3D", sourceCRS, DefaultVerticalCRS.ELLIPSOIDAL_HEIGHT);
          sourceCRS = new DefaultCompoundCRS("4D", sourceCRS, DefaultTemporalCRS.JULIAN);
          CRS.findMathTransform(sourceCRS, targetCRS);
      }
      

      Results:

      org.opengis.referencing.operation.OperationNotFoundException: Aucune transformation du système "CompoundCRS[4D]" vers "GeographicCRS[WGS 84]" n'est disponible.
      	at org.geotools.referencing.operation.DefaultCoordinateOperationFactory.createOperationStep(DefaultCoordinateOperationFactory.java:1360)
      	at org.geotools.referencing.operation.DefaultCoordinateOperationFactory.createOperationStep(DefaultCoordinateOperationFactory.java:1200)
      	at org.geotools.referencing.operation.DefaultCoordinateOperationFactory.createOperation(DefaultCoordinateOperationFactory.java:358)
      	at org.geotools.referencing.operation.DefaultCoordinateOperationFactory.createOperationStep(DefaultCoordinateOperationFactory.java:1210)
      	at org.geotools.referencing.operation.DefaultCoordinateOperationFactory.createOperation(DefaultCoordinateOperationFactory.java:358)
      	at org.geotools.referencing.operation.DefaultCoordinateOperationFactory.createOperation(DefaultCoordinateOperationFactory.java:319)
      	at org.geotools.referencing.operation.BufferedCoordinateOperationFactory.createOperation(BufferedCoordinateOperationFactory.java:253)
      	at org.geotools.referencing.CRS.findMathTransform(CRS.java:947)
      	at org.geotools.referencing.CRS.findMathTransform(CRS.java:915)
      

        Activity

        Show
        Martin Desruisseaux added a comment - See [ http://jira.geotoolkit.org/browse/GEOTK-81 ]

          People

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

            Dates

            • Created:
              Updated: