[GRASSLIST:5232] Re: USGSDEM export

Tom Russo russo at bogodyn.org
Mon Dec 27 10:46:15 EST 2004


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.

-- 
Tom Russo    KM5VY     SAR502  DM64ux         http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://www.qsl.net/~km5vy/
 "When life gives you lemons, find someone with a paper cut."




More information about the grass-user mailing list