[geotk] NetCDF Coverage Reading issue
Aaron Braeckel
braeckel at ucar.edu
Thu Feb 17 23:22:27 EST 2011
Hello,
most of the files I am reading through the NetCDF coverage support are
working fine (thanks, Martin!) but it looks like I have a case where the
code is expecting a CoordinateAxis1D and is instead finding a
CoordinateAxis2D. Here is my code (against SNAPSHOT):
ImageCoverageReader reader = new ImageCoverageReader();
reader.setInput( TestUtil.readFile(
"data/CIP_20100508_v_200000_l_0000000.nc" ) );
GridCoverage cvg = reader.read( 0, null );
I have placed a copy of this file under
http://www.rap.ucar.edu/~braeckel/data/CIP_20100508_v_200000_l_0000000.nc.
Note that this file is not CF-compliant and it is NetCDF 4 (HDF 5)
format. I think it is the data model causing problems rather than the
format, though. Here is the resulting Exception:
java.lang.ClassCastException: ucar.nc2.dataset.CoordinateAxis2D cannot
be cast to ucar.nc2.dataset.CoordinateAxis1D
at
org.geotoolkit.referencing.adapters.NetcdfCRS.wrap(NetcdfCRS.java:272)
at
org.geotoolkit.image.io.plugin.NetcdfMetadata.setCoordinateSystem(NetcdfMetadata.java:223)
at
org.geotoolkit.image.io.plugin.NetcdfMetadata.<init>(NetcdfMetadata.java:177)
at
org.geotoolkit.image.io.plugin.NetcdfImageReader.createMetadata(NetcdfImageReader.java:771)
at
org.geotoolkit.image.io.SpatialImageReader.getSpatialMetadata(SpatialImageReader.java:343)
at
org.geotoolkit.image.io.SpatialImageReader.getImageMetadata(SpatialImageReader.java:308)
at
org.geotoolkit.image.io.SpatialImageReader.getImageMetadata(SpatialImageReader.java:129)
at javax.imageio.ImageReader.getMetadata(ImageReader.java:789)
at javax.imageio.ImageReader.getImageMetadata(ImageReader.java:887)
at
org.geotoolkit.coverage.io.ImageCoverageReader.getSpatialMetadata(ImageCoverageReader.java:523)
at
org.geotoolkit.coverage.io.ImageCoverageReader.getGridGeometry(ImageCoverageReader.java:574)
at
org.geotoolkit.coverage.io.ImageCoverageReader.read(ImageCoverageReader.java:820)
Thanks,
Aaron
More information about the Geotoolkit
mailing list