<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffffff">
Hello,<br>
<br>
I am trying to resample a NetCDF file in Geotk. Here is my code:<br>
<br>
ImageCoverageReader reader = new ImageCoverageReader();<br>
reader.setInput( file );<br>
CompoundCRS targetCRS = new DefaultCompoundCRS( "Target CRS",new
CoordinateReferenceSystem[]{ <br>
CRS.decode( "EPSG:4326"), //lat/lon on WGS84<br>
CRS.decode( "EPSG:3855" ) } ); //meters above geoid<br>
<br>
for( int i = 0; i < reader.getCoverageNames().size(); i++ ){<br>
GridCoverage cvg = reader.read( i, null );<br>
//here I manually set the ProjectedCRS - see
<a class="moz-txt-link-freetext" href="http://jira.geotoolkit.org/browse/GEOTK-154">http://jira.geotoolkit.org/browse/GEOTK-154</a><br>
Coverage resultCvg = Operations.DEFAULT.resample( cvg,
targetCRS, cvg.getGridGeometry(), Interpolation.getInstance(
Interpolation.INTERP_NEAREST ) );<br>
System.out.println( "Resampled to "+resultCvg);<br>
}<br>
<br>
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:<br>
<ol>
<li>PROJCS["Projection", <br>
GEOGCS["WGS84(DD)", <br>
DATUM["WGS84", <br>
SPHEROID["WGS84", 6378137.0, 298.257223563,
AUTHORITY["EPSG","7030"]], <br>
AUTHORITY["EPSG","6326"]], <br>
PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], <br>
UNIT["degree", 0.017453292519943295], <br>
AXIS["Geodetic longitude", EAST], <br>
AXIS["Geodetic latitude", NORTH]], <br>
PROJECTION["Lambert_Conformal_Conic_2SP"], <br>
PARAMETER["semi_major", 6371200.0], <br>
PARAMETER["semi_minor", 6371200.0], <br>
PARAMETER["central_meridian", -95.0], <br>
PARAMETER["latitude_of_origin", 25.0], <br>
PARAMETER["false_easting", 0.0], <br>
PARAMETER["false_northing", 0.0], <br>
PARAMETER["standard_parallel_2", 25.049999237060547], <br>
PARAMETER["standard_parallel_1", 25.0], <br>
UNIT["metre", 1.0], <br>
AXIS["Easting", EAST], <br>
AXIS["Northing", NORTH]]</li>
<li>NetcdfCRS$Vertical instance (DefaultVerticalDatum.GEOIDAL -
VERT_DATUM["Geoidal", "2005"] )</li>
<li>NetcdfCRS$Temporal instance (custom DefaultTemporalDatum)<br>
</li>
</ol>
<br>
This results in the following Exception:<br>
<br>
Caused by:
org.opengis.referencing.operation.OperationNotFoundException: No
transformation available from system "CompoundCRS[NetCDF:"time
altitude_above_msl y x"]" to "CompoundCRS[Target CRS]".<br>
at
org.geotoolkit.referencing.operation.DefaultCoordinateOperationFactory.createOperationStep(DefaultCoordinateOperationFactory.java:1329)<br>
at
org.geotoolkit.referencing.operation.DefaultCoordinateOperationFactory.createOperationStep(DefaultCoordinateOperationFactory.java:1256)<br>
at
org.geotoolkit.referencing.operation.DefaultCoordinateOperationFactory.createOperation(DefaultCoordinateOperationFactory.java:205)<br>
at
org.geotoolkit.coverage.processing.operation.Resampler2D.reproject(Resampler2D.java:361)<br>
at
org.geotoolkit.coverage.processing.operation.Resample.doOperation(Resample.java:249)<br>
... 22 more<br>
Caused by:
org.opengis.referencing.operation.OperationNotFoundException: No
transformation available from system "VerticalDatum[Geoidal]" to
"VerticalDatum[EGM2008 geoid]".<br>
at
org.geotoolkit.referencing.operation.DefaultCoordinateOperationFactory.createOperationStep(DefaultCoordinateOperationFactory.java:697)<br>
at
org.geotoolkit.referencing.operation.DefaultCoordinateOperationFactory.createOperation(DefaultCoordinateOperationFactory.java:273)<br>
at
org.geotoolkit.referencing.operation.DefaultCoordinateOperationFactory.createOperationStep(DefaultCoordinateOperationFactory.java:1306)<br>
... 26 more<br>
<br>
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?<br>
<br>
Thanks,<br>
Aaron<br>
</body>
</html>