Terragen -- Terragen™ Terrain File
Driver short name
Terragen
Driver built-in by default
This driver is built-in by default
Terragen terrain files store 16-bit elevation values with optional gridspacing (but not positioning). The file extension for Terragen heightfields is "TER" or "TERRAIN" (which in the former case is the same as Leveller, but the driver only recognizes Terragen files). The driver ID is "Terragen". The dataset is file-based and has only one elevation band. Void elevations are not supported. Pixels are considered points.
Driver capabilities
Supports CreateCopy()
This driver supports the GDALDriver::CreateCopy()
operation
Supports Create()
This driver supports the GDALDriver::Create()
operation
Supports Georeferencing
This driver supports georeferencing
Supports VirtualIO
This driver supports virtual I/O operations (/vsimem/, etc.)
Reading
dataset::GetProjectionRef()
returns a local coordinate system using meters.
band::GetUnitType()
returns meters.Elevations are
Int16
. You must use theband::GetScale()
andband::GetOffset()
to convert them to meters.
Writing
Use the
Create
call. Set theMINUSERPIXELVALUE
option (a float) to the lowest elevation of your elevation data, andMAXUSERPIXELVALUE
to the highest. The units must match the elevation units you will give toband::SetUnitType()
.Call
dataset::SetProjection()
anddataset::SetGeoTransform()
with your coordinate system details. Otherwise, the driver will not encode physical elevations properly. Geographic (degree-based) coordinate systems will be converted to a local meter-based system.To maintain precision, a best-fit baseheight and scaling will be used to use as much of the 16-bit range as possible.
Elevations are
Float32
.
Roundtripping
Errors per trip tend to be a few centimeters for elevations and up to one or two meters for ground extents if degree-based coordinate systems are written. Large degree-based DEMs incur unavoidable distortions since the driver currently only uses meters.
See Also
Implemented as terragendataset.cpp.
See readme.txt for installation and support information.