[Gdal-dev] Setting ModelPixelScale in a GeoTIFF Elevation Model?

Frank Warmerdam warmerdam at pobox.com
Thu Nov 9 16:44:26 EST 2006


Thomas Hottendorff wrote:
> Dear all,
> 
> I'm creating geotiffs from arc-ascii grids using gdal_translate. Now I'm
> facing the problem that the third value of the ModelPixelScale tag 
> (height scale) does not get set to 1 as I would expect but stays 0.

Thomas,

GDAL hardcodes the Z value in ModelPixelScale as zero all the time.  It's
use as a scaling value for elevation pixel values has not achieved any
degree of use as far as I know.

> Can anybody give me a hint on how to set it to 1 with gdal_translate? (I 
> figured
> that option -mo might be used for this but couldn't get it to work).
> 
> Alternatively, maybe somebody can post a few lines of python code to do 
> the job?.

I can't think of a way of doing this from python.

If you really, really want to set this, then use listgeo to dump out
the geotiff tags, modify the Z scale in that text file, and then use
geotifcp to reapply the updated geotiff values.

> Secondly, I'd also like to set the vertical reference system in the 
> GeoTIFF.
> Can this be done with gdal_translate or likewise with some python code?

I'm afraid that GDAL has no support for vertical reference systems at
this time.  The closest it gets to any of this is the concept of a
Units value for pixel values which can meaningfully be "ft" or "m" for
elevation values.

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