/** * Write a NetcdfFile as an XML document to the specified file. * * @param ncfile NcML for this NetcdfFile * @param filenameOut write NcML to this location * @throws IOException on io error */ public void writeXML(NetcdfFile ncfile, String filenameOut) throws IOException { OutputStream out = new BufferedOutputStream(new FileOutputStream(filenameOut, false)); writeXML(ncfile, out, null); out.close(); }
/** * Write a NetcdfFile as an XML document to the specified file. * * @param ncfile NcML for this NetcdfFile * @param filenameOut write NcML to this location * @throws IOException on io error */ public void writeXML(NetcdfFile ncfile, String filenameOut) throws IOException { OutputStream out = new BufferedOutputStream(new FileOutputStream(filenameOut, false)); writeXML(ncfile, out, null); out.close(); }
/** * Write the NcML representation. * * @param os write to this Output Stream. * @param uri use this for the url attribute; if null use getLocation(). * @throws IOException */ public void writeNcML(java.io.OutputStream os, String uri) throws IOException { new NcMLWriter().writeXML(this, os, uri); }
/** * Write the NcML representation. * * @param os write to this Output Stream. * @param uri use this for the url attribute; if null use getLocation(). * @throws IOException */ public void writeNcML(java.io.OutputStream os, String uri) throws IOException { new NcMLWriter().writeXML(this, os, uri); }
public static void main(String arg[]) { //String urls = "C:/data/conventions/coards/cldc.mean.nc"; String test = "http://testbedapps.sura.org/thredds/dodsC/shelf_hypoxia_scan/noaa/NGOM/GOMUD-2009.3.182.3D.nc"; String urls = (arg.length == 0) ? test : arg[0]; try { NetcdfDataset df = NetcdfDataset.openDataset(urls); NcMLWriter writer = new NcMLWriter(); System.out.println("NetcdfDataset = " + urls + "\n" + df); System.out.println("-----------"); writer.writeXML(df, System.out, null); } catch (Exception ioe) { System.out.println("error = " + urls); ioe.printStackTrace(); } }
public static void main(String arg[]) { //String urls = "C:/data/conventions/coards/cldc.mean.nc"; String test = "http://testbedapps.sura.org/thredds/dodsC/shelf_hypoxia_scan/noaa/NGOM/GOMUD-2009.3.182.3D.nc"; String urls = (arg.length == 0) ? test : arg[0]; try { NetcdfDataset df = NetcdfDataset.openDataset(urls); NcMLWriter writer = new NcMLWriter(); System.out.println("NetcdfDataset = " + urls + "\n" + df); System.out.println("-----------"); writer.writeXML(df, System.out, null); } catch (Exception ioe) { System.out.println("error = " + urls); ioe.printStackTrace(); } }