[GRASSLIST:5234] Re: USGSDEM export

Roger Bivand Roger.Bivand at nhh.no
Tue Dec 28 04:18:31 EST 2004


On Tue, 28 Dec 2004, Miha Staut wrote:

>  --- Tom Russo <russo at bogodyn.org> wrote: 
> > On Mon, Dec 27, 2004 at 02:36:00PM +0000, we
> > recorded a bogon-computron collision of the
> > <mihastaut at yahoo.co.uk> flavor, containing:
> > > Hi!
> > > 
> > > Any way to output a raster file in a USGSDEM
> > format
> > > from GRASS?. If I write
> > > 
> > > r.out.gdal in=mydem format=USGSDEM out=mydem.dem
> > > 
> > > the command returns:
> > > 
> > > Error: value <USGSDEM> out of range for parameter
> > > <format>
> > >        Legal range:
> > >
> >
> AAIGrid,BMP,BSB,DTED,ELAS,ENVI,FIT,GIF,GTiff,HFA,JPEG,MEM,MFF,MFF2,NITF,PAux,PNG,PNM,VRT,XPM
> > > 
> > > Listing all the available formats r.out.gdal
> > > understands among other returns USGSDEM 
> > > 
> > > r.out.gdal -l 
> > > 
> > > ...
> > > USGSDEM: USGS Optional ASCII DEM (and CDED)
> > > 
> > > GRASS 5.7 compiled from cvs (4. 12. 2004),
> > gdal-1.2.3.
> > > Would a newer version of any solve the problem? 
> > 
> > I'm not exactly sure what the limitation is, but
> > I've noticed that gdal
> > only partitially supports output of USGSDEM format. 
> > For example, when I 
> > try to use the GDAL tool "gdalwarp" to convert a
> > USGSDEM from NAD27 datum
> > to NAD83 datum, it tells me that the USGSDEM driver
> > does not support direct
> > creation.  However, if I gdalwarp from the source
> > DEM in NAD27 to an 
> > intermediate GeoTIFF in NAD83, then use
> > gdal_translate to create a DEM
> > from the GeoTIFF, it does work.
> > 
> > So my guess is that if you really need USGSDEM
> > output you could probably 
> > do it by outputting to GeoTIFF and then using
> > gdal_translate (not a 
> > GRASS tool, it comes with the gdal library):
> > 
> >   gdal_translate -of USGSDEM intermediate.tiff
> > Final.DEM
> > 
> > HTH,
> > T.
> 
> Thanks Tom,
> 
> My only scruple is GeoTIFF would destroy the
> information. Could that be true?

My reading of:

http://www.gdal.org/frmt_gtiff.html

suggests that you should be OK, the range of band types is pretty large, 
and less problematic than USGSDEM:

http://www.gdal.org/frmt_usgsdem.html

Roger

> 
> Miha Staut
> 
> 
> 	
> 	
> 		
> ___________________________________________________________ 
> ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
> 
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no




More information about the grass-user mailing list