Re: Converting ASCII Grids to NetCdf

Hi Andrew-

Chase, Andrew wrote:
Hi Folks,

I'm trying to do something relatively simple, but I haven't been able to
find any examples of others doing it before me. Just thought I'd ask
here before going off and writing the code myself.
What I want to do is take a DEM stored in the  ESRI ASCII Raster format
and convert it to a netcdf file. My ascii raster has the standard header
format like so:
ncols         5001
nrows         4001
xllcorner     -125
yllcorner     34
cellsize      0.001
NODATA_value  -9999

Anybody got some code to do this? :-)

If not, no biggee, just thought I'd ask.

The best way to do this would be to write an IO Service Provider
(IOSP) layer that would read in the file and create the netCDF
object.  I'm not sure if there is any documentation on this,
but there are some other examples that you could probably follow.

There is code in VisAD to read in the ASCII Arc Grid format
into VisAD Data objects and it could be adapted to use for this
task.  The source code is available at:

ftp://ftp.ssec.wisc.edu/pub/visad/visad_src-2.0.jar

in the visad.data.gis.AsciiArcGrid reader.  It does not
handle any associated .prj files.

Don
*************************************************************
Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************


==============================================================================
To unsubscribe netcdf-java, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================


  • 2006 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: