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:

in the reader.  It does not
handle any associated .prj files.

Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307

To unsubscribe netcdf-java, visit:

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