[geotk] VerticalCRS transformation

Aaron Braeckel braeckel at ucar.edu
Tue Mar 8 23:50:24 EST 2011


Hello,

I am trying to resample a NetCDF file in Geotk.  Here is my code:

    ImageCoverageReader reader = new ImageCoverageReader();
    reader.setInput( file );
    CompoundCRS targetCRS = new DefaultCompoundCRS( "Target CRS",new
CoordinateReferenceSystem[]{
        CRS.decode( "EPSG:4326"), //lat/lon on WGS84
        CRS.decode( "EPSG:3855" ) } ); //meters above geoid

    for( int i = 0; i < reader.getCoverageNames().size(); i++ ){
      GridCoverage cvg = reader.read( i, null );
      //here I manually set the ProjectedCRS - see
http://jira.geotoolkit.org/browse/GEOTK-154
      Coverage resultCvg = Operations.DEFAULT.resample( cvg, targetCRS,
cvg.getGridGeometry(), Interpolation.getInstance(
Interpolation.INTERP_NEAREST ) );
      System.out.println( "Resampled to "+resultCvg);
    }

The Hints are set to be lenient on datum shifts.  The CRS that is on the
GridCoverage when I make the resample() call is a CompoundCRS with the
following components:

   1. PROJCS["Projection",
        GEOGCS["WGS84(DD)",
          DATUM["WGS84",
            SPHEROID["WGS84", 6378137.0, 298.257223563,
      AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
          PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
          UNIT["degree", 0.017453292519943295],
          AXIS["Geodetic longitude", EAST],
          AXIS["Geodetic latitude", NORTH]],
        PROJECTION["Lambert_Conformal_Conic_2SP"],
        PARAMETER["semi_major", 6371200.0],
        PARAMETER["semi_minor", 6371200.0],
        PARAMETER["central_meridian", -95.0],
        PARAMETER["latitude_of_origin", 25.0],
        PARAMETER["false_easting", 0.0],
        PARAMETER["false_northing", 0.0],
        PARAMETER["standard_parallel_2", 25.049999237060547],
        PARAMETER["standard_parallel_1", 25.0],
        UNIT["metre", 1.0],
        AXIS["Easting", EAST],
        AXIS["Northing", NORTH]]
   2. NetcdfCRS$Vertical instance (DefaultVerticalDatum.GEOIDAL -
      VERT_DATUM["Geoidal", "2005"] )
   3. NetcdfCRS$Temporal instance (custom DefaultTemporalDatum)


This results in the following Exception:

Caused by: org.opengis.referencing.operation.OperationNotFoundException:
No transformation available from system "CompoundCRS[NetCDF:"time
altitude_above_msl y x"]" to "CompoundCRS[Target CRS]".
    at
org.geotoolkit.referencing.operation.DefaultCoordinateOperationFactory.createOperationStep(DefaultCoordinateOperationFactory.java:1329)
    at
org.geotoolkit.referencing.operation.DefaultCoordinateOperationFactory.createOperationStep(DefaultCoordinateOperationFactory.java:1256)
    at
org.geotoolkit.referencing.operation.DefaultCoordinateOperationFactory.createOperation(DefaultCoordinateOperationFactory.java:205)
    at
org.geotoolkit.coverage.processing.operation.Resampler2D.reproject(Resampler2D.java:361)
    at
org.geotoolkit.coverage.processing.operation.Resample.doOperation(Resample.java:249)
    ... 22 more
Caused by: org.opengis.referencing.operation.OperationNotFoundException:
No transformation available from system "VerticalDatum[Geoidal]" to
"VerticalDatum[EGM2008 geoid]".
    at
org.geotoolkit.referencing.operation.DefaultCoordinateOperationFactory.createOperationStep(DefaultCoordinateOperationFactory.java:697)
    at
org.geotoolkit.referencing.operation.DefaultCoordinateOperationFactory.createOperation(DefaultCoordinateOperationFactory.java:273)
    at
org.geotoolkit.referencing.operation.DefaultCoordinateOperationFactory.createOperationStep(DefaultCoordinateOperationFactory.java:1306)
    ... 26 more

I may be making the wrong assumption, but it seems as if these two
VerticalDatums should be transformable.  The only thing I've noticed
that may be a factor is the fact that EPSG 3855 references a 2008 geoid
and the DefaultVerticalDatum.GEOIDAL references a 2005 geoid.  Any
thoughts on why these two VerticalCRSs could not be transformed?

Thanks,
Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geotoolkit/attachments/20110308/bf1bf234/attachment.html


More information about the Geotoolkit mailing list