This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
John Caron wrote:
-------- Original Message -------- Subject: Problem using GeotiffWriter Date: Wed, 14 Sep 2005 09:23:19 -0500 From: Matt Foster <address@hidden> Organization: UCAR/Unidata To: address@hiddenI'm a serious Java newbie, so be gentle if I've done something stupid here...I wrote the attached short program, which is based off of a post to this list last year, to read a single element from a netCDF file, and write a GeoTIFF file, however, I get the following error message when I try to compile it with javac...GeoTifWriter.java:16: cannot resolve symbolsymbol : method writeGrid (java.lang.String,java.lang.String,int,int,boolean)location: class ucar.nc2.geotiff.GeotiffWriterwriter.writeGrid("/home/mwfoster/MaxT_test.cdf", "MaxT_SFC", 0, 0, false);^The "caret" symbol is actually under the dot between writer and writeGrid, in case a variable-width font messed that up.Can someone help me out here?
Matthew,
Here is a small example of using GeotiffWriter class:
import ucar.ma2.*;
import ucar.nc2.*;
import ucar.nc2.dataset.*;
import ucar.nc2.geotiff;
import ucar.nc2.dataset.grid.*;
import ucar.unidata.geoloc.*;
import ucar.unidata.geoloc.projection.*;
import java.io.*;
import java.util.*;
public static void main(String args[]) throws IOException {
String fileOut = "totalr1.tif";
GeotiffWriter writer = new GeotiffWriter(fileOut);
writer.writeGrid("2003091116_ruc2.nc", "P_sfc", 0, 0, false);
writer.close(); } If this does not work for you, email me your java code. Yuan
Matt