I'm attempting to use the gdal tools to convert some geotiff files I have to the Terragen format. I was hoping to use either gdal_translate or gdalwarp in a similar fashion to this post. (though I should admit I am not sure which tool may be more appropriate for my task)
However, when I issue either command it exits with an error, in fact, the same error:
$ gdal_translate -of Terragen src.tif dest.ter
Input file size is 8743, 6159
0ERROR 1: Inverted, flat, or unspecified span for Terragen file.
$ gdalwarp -of Terragen src.tif dest.ter
Creating output file that is 8743P x 6159L.
ERROR 1: Inverted, flat, or unspecified span for Terragen file.
I quickly stumbled upon a post (which also points to gdal documentation) stating that I need to specify the span of elevation values:
Use the Create call. Set the MINUSERPIXELVALUE option (a float) to the lowest elevation of your elevation data, and MAXUSERPIXELVALUE to the highest. The units must match the elevation units you will give to band::SetUnitType().
Were I developing my own utility that used libgdal, this information would be applicable. However, instead of developing a new utility to achieve the conversion - I'd rather use the existing gdal tools if possible ( gdal-translate, gdalwarp).
Is it possible to specify the min/max elevation values using any existing gdal tools?