Issue Type: Bug Bug
Affects Versions: 11-beta
Assignee: Simone Giannecchini
Components: coverage, unsupported
Created: 24/Jan/14 4:09 AM
Description:

I have a TAMSAT netcdf file with an invalid units string in the time dimension: 'days since 2007-00-01 0:0:0'
This results in an ugly NPE when initializing the UnidataImageReader (stack trace below).

I propose to add some logging which clarifies the root of this issue.
I would also like to add a workaround in the specific case of a 'time' axis: the unidata-netcdf library refuses to set the axistype if it can not parse the units, which is rather unfortunate for the geotools implementation which heavily depends on this axistype.
I would think that a workaround specifically for a given axis type is relevant because the time dimension is very common.

A pull request follows.

Caused by: java.lang.NullPointerException
	at org.geotools.imageio.unidata.UnidataImageReader.initMapping(UnidataImageReader.java:381) ~[gt-unidata-11-SNAPSHOT.jar:?]
	at org.geotools.imageio.unidata.UnidataImageReader.extractCoordinatesVariable(UnidataImageReader.java:416) ~[gt-unidata-11-SNAPSHOT.jar:?]
	at org.geotools.imageio.unidata.UnidataImageReader.init(UnidataImageReader.java:461) ~[gt-unidata-11-SNAPSHOT.jar:?]
	at org.geotools.imageio.unidata.UnidataImageReader.setInput(UnidataImageReader.java:253) ~[gt-unidata-11-SNAPSHOT.jar:?]
	at javax.imageio.ImageReader.setInput(ImageReader.java:380) ~[?:1.7.0_45]
	at org.geotools.coverage.io.netcdf.NetCDFAccess.<init>(NetCDFAccess.java:116) ~[gt-netcdf-11-SNAPSHOT.jar:?]
	at org.geotools.coverage.io.netcdf.NetCDFDriver.connect(NetCDFDriver.java:87) ~[gt-netcdf-11-SNAPSHOT.jar:?]
	at org.geotools.coverage.io.impl.DefaultFileDriver.process(DefaultFileDriver.java:216) ~[gt-coverage-api-11-SNAPSHOT.jar:?]
	at org.geotools.coverage.io.netcdf.NetCDFReader.<init>(NetCDFReader.java:155) ~[gt-netcdf-11-SNAPSHOT.jar:?]
Project: GeoTools
Priority: Major Major
Reporter: Jeroen Dries
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to