This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Use GridDataset.open(String filename); Carl Drews wrote:
John - Last week you suggested that I could use a GeoGrid to read grib1 and grib2 files, rather than a NetcdfDataset. I'm looking at the javadoc on GeoGrid here: http://www.unidata.ucar.edu/software/netcdf-java/v2.2.14/javadoc/ucar/nc2/dataset/grid/GeoGrid.html GeoGrid takes a GridDataset for its constructor; GridDataset takes a NetcdfDataset for its constructor. From this pair of constructors it appears that I will need a NetcdfDataset anyway. Is there any other way to construct a GeoGrid? Carl