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

[netCDFJava #TLG-682846]: Regarding Java netcdf surfer grid files

> Hello sean,
> I have a data regarding latitude and longitude i want to create a nc file 
> using that data in java. Can you tell me how can i create a .nc file in java.
> Thanks,
> Ravi Teja
Greetings Ravi,

Here is a page with several examples of reading and writing netCDF files, 
ranging from very simple to very complex.


I would start with 

There is code in Simple_xy_wr.java that creates some data to store - you would 
just simply need to replace those data with yours. Also, often times it's not 
quite enough to put the data into netCDF format and call it good. It's best to 
also properly document the files with metadata. Check out:


for an example of a pretty well documented netCDF file. Notice how the 
dimensions of the variables are given, each variable comes with attributes 
(such as name, units, axis dimension, axis type), as well as some global 
attributes, like dataset title, which are shown at the end. There are examples 
from the 'example file page' (first link) that show how to add information like 
those described above. The beauty of a netCDF file is that it can be a self 
describing file - all the information you need about the dataset can be 
contained in one file, as long as it's documented properly.



Ticket Details
Ticket ID: TLG-682846
Department: Support netCDF Java
Priority: High
Status: Open