[Gdal-dev] how to translate .asc files (Info ASCII Grid) to .dem files (USGS ASCII DEM)

Frank Warmerdam warmerdam at pobox.com
Tue Oct 17 11:20:37 EDT 2006

maestrini_andrea at virgilio.it wrote:
> Hello gdal-dev,
> I'm very new to gdal so please cope with my ignorance.
> I have two questions for you
> 1.  .dem files are same things SRTM files 
> (used by Radio Mobile Radio Propagation tool)???
> 2. when I invoke the 
> command:
> ./gdal_translate -of USGSDEM input.asc output.dem
> I have 
> this error:
> Input file size is 6592, 5728
> ERROR 1: DEM Default Setup: 
> Importing source dataset projection failed
> what it means?
> Is the 
> command right?
> Can I translate a file .asc into a file .dem and How I 
> can do it????


USGS DEM is digital elevation format, and so suitable to hold data like
SRTM elevation data.

The error you see is likely because the source .asc file does not have
an apparent coordinate system and we can't write a USGS DEM file without
knowing the coordinate system.  If your .asc file is sampled on a latlong
grid (ie. it is geographic) then you could like do:

   gdal_translate -of USGSDEM -a_srs WGS84 input.asc output.dem

This tells the system that the coordinate system is lat/long WGS84.

I've just tried the translator and I see the USGSDEM writer only seems
to produce very specific products (essentially CDED - a Canadian version
of USGS DEM) in UTM.  It will almost certainly not be suitable for
your purposes.

Assuming you want to take your elevation data into another program, I'd
suggest looking for another more general intermediate format it supports.
Perhaps GeoTIFF?

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org

More information about the Gdal-dev mailing list