/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package titff2nc; import java.io.IOException; import java.util.List; import ucar.nc2.NetcdfFile; import ucar.nc2.dt.GridDatatype; import ucar.nc2.dt.grid.GridDataset; import ucar.nc2.iosp.geotiff.GeoTiffIOServiceProvider; /** * * @author gtiosp */ public class TestGTIosp { static { try { NetcdfFile.registerIOProvider(GeoTiffIOServiceProvider.class); } catch (IllegalAccessException | InstantiationException ex) { System.out.println(ex.getClass().getName() + ":" + ex.getMessage()); } } public static void main(String args[]) throws IOException { GridDataset gds = GridDataset.open("/usr1/ghansham/test.nc"); System.out.println(gds.getDetailInfo()); // List grids = gds.getGrids(); // for (GridDatatype grid : grids) { // System.out.println(grid.getFullName()); // } } }