[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDFJava #GFQ-763475]: java bufr example?



> Hi,
> 
> I am interested in using java to read and write bufr files. I went to
> http://www.unidata.ucar.edu/software/netcdf-java/tutorial/bufr/bufrIosp.html
> and got some code. However, it cannot compile. For example,
> 
> 
> javac -cp 
> ./:/Users/szhou/tasc_april25_06/java_jar/netcdfAll-4.2.jar:/Users/szhou/tasc_april25_06/test_java/test_bufr/bufr-3.0.jar
>   index2NC.java
> 
> 
> index2NC.java:48: cannot find symbol
> symbol  : class Index
> location: class index2NC
> void open( Index index, ucar.nc2.NetcdfFile ncf, CancelTask cancelTask ) {
> ^
> index2NC.java:383: package ucar.bufr.Index does not exist
> void addVariable( Structure struct, ArrayList dims, ucar.bufr.Index.parameter 
> parm )
> ^
> index2NC.java:98: package ucar.bufr.Index does not exist
> ucar.bufr.Index.parameter p =
> ^
> index2NC.java:99: package ucar.bufr.Index does not exist
> (ucar.bufr.Index.parameter) parameters.get( i );
> ^
> index2NC.java:132: package thredds.catalog.DataType does not exist
> ncfile.addAttribute( null, new Attribute( "cdm_data_type", 
> thredds.catalog.DataType.POINT.toString() ) );
> ^
> index2NC.java:134: package thredds.catalog.DataType does not exist
> ncfile.addAttribute( null, new Attribute( "cdm_data_type", 
> thredds.catalog.DataType.STATION.toString() ) );
> ^
> index2NC.java:136: package thredds.catalog.DataType does not exist
> ncfile.addAttribute( null, new Attribute( "cdm_data_type", 
> thredds.catalog.DataType.TRAJECTORY.toString() ) );
> 
> 
> 
> Do you have an updated example which can compiled with netcdf 4.2 and bufr3.0?
> 
> 
> Thanks,
> 
> 
> Shujia
> 
> 

Hi Shujia:

The reason thats failing is that you need both netcdf and bufr jars on your 
classpath. Better, just use netcdfAll.jar as documented here:

http://www.unidata.ucar.edu/software/netcdf-java/reference/JarDependencies.html

Netcdf-Java will only read BUFR, it wont write it.

Also that web page is way out of date. Where did you find a reference to it?

John


Ticket Details
===================
Ticket ID: GFQ-763475
Department: Support netCDF Java
Priority: Normal
Status: Closed


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.