Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've started trying to read GRIB2 files with JAVA which I downloaded at the NOAA GFS site. Using the library provided by unidata.ucar.edu. But, whatever, not working. Using the

NetcdfFile ncfileIn = ucar.nc2.dataset.NetcdfDataset.openFile(datasetIn, null);

code provided in the small cookbook at this site gives me an "Not a valid NETCDF" error.

Another possibility which I found here (retrieve some info from GRIB2 file with JAVA) did also not work out.

Someone working with GRIB2 files and JAVA? I do not stick to this library, but it seems the only one working (sometimes).

Thanks a lot! Gunther

Update: Solved. I was already using an older version of netcdf library in the whole project. Deleting this old one allowed the new one to work. Nice thing now. Of someone has problems with netcdf and Java, just reply.

share|improve this question
add comment

closed as off-topic by BradHards, PolyGeo, MappaGnosis, Simbamangu, radouxju Mar 7 at 12:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – BradHards, PolyGeo, MappaGnosis, Simbamangu, radouxju
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

Using Unidata's NetCDF-Java library, you can also convert GRIB2 to NetCDF from the command line thusly:

java -Xmx512m -classpath netcdfAll-4.3.jar ucar.nc2.dataset.NetcdfDataset -in infile.grib2 -out outfile.nc
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.