NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
Hi Adit:The AxisType is optional, so you need to check for null.
John Adit Santokhee wrote:
Hi,I am trying to read data from a netcdf file. But I am getting an "java.lang.IllegalArgumentException: Illegal axis type null" error message.Our application java code is as follows: AxisType axisType = axis1D.getAxisType(); if (axisType == AxisType.Lon || axisType == AxisType.Lat || axisType == AxisType.GeoX || axisType == AxisType.GeoY) { OneDCoordAxis theAxis = null; if (axis1D.isRegular()) { theAxis = new Regular1DCoordAxis(axis1D.getStart(), axis1D.getIncrement(), (int)axis1D.getSize(), axisType); } else {theAxis = new Irregular1DCoordAxis(axis1D.getCoordValues(), axisType);} return theAxis; } else {throw new IllegalArgumentException("Illegal axis type " + axisType);} I have attached the dataset metadata. Could you please advise? Cheers, Adit ------------------------------------------------------------------------ _______________________________________________ netcdf-java mailing list netcdf-java@xxxxxxxxxxxxxxxxFor list information or to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/
netcdf-java
archives: