ANSI-C program: dem_trans.c, map_trans.c
NAME
dem_trans - DEM
resampling from one map projection to another
map_trans - Data
resampling from one map projection to another map projection
SYNOPSIS
dem_trans <DEM1_par> <DEM1> <DEM2_par>
<DEM2> [lat_ovr] [lon_ovr] [datum_shift] [bflg]
[lookup_table]
<DEM_par1> | (input) DEM parameter file of the input DEM data |
<DEM1> | (input) input DEM data |
<DEM_par2> | (input/output) DEM parameter file of the resampled
input DEM NOTE: if DEM2_par does not exist, it is created using the projection parameters from DEM1_par |
<DEM2> | (output) DEM in transformed coordinates specified
by DEM2_par |
[lat_ovr] | lat/northing DEM oversampling factor (enter - for
default: 2.0) |
[lon_ovr] | lon/easting DEM oversampling factor (enter - for
default: 2.0) |
[datum_shift] | vertical datum shift flag, enter - for default: 0: output DEM heights not corrected for datum shift between projections (default) 1: output DEM heights corrected for datum shift between projections |
[bflg] |
output DEM bounds flag
(enter - for default): 0: use DEM bounds specified by DEM2_par (default) 1: determine bounds from DEM1_par in the projection specified by DEM2_par |
[lookup_table] | (output) complex valued lookup table (DEM2 -> DEM1) |
map_trans <DEM1_par> <data1>
<DEM2_par> <data2> [lat_ovr] [lon_ovr] [interp_mode]
[format] [bflg] [lookup_table]
<DEM_par1> | (input)DEM parameter file of input data file |
<data1> | (input) input data in the geometry of DEM_par1 |
<DEM_par2> | (input/output) DEM parameter file of output DEM NOTE: if DEM2_par does not exist, the DEM parameters are copied from DEM1_par |
<data2> | (output) output data file resampled into geometry of
DEM_par2 |
[lat_ovr] | lat/northing DEM oversampling factor (enter - for
default: 2.0) |
[lon_ovr] | lon/easting DEM oversampling factor (enter - for
default: 2.0) |
[interp_mode] | interpolation mode (enter - for default): 0: nearest neighbor 1: bicubic (default) 2: bicubic-log |
[format] |
data format (enter - for
default): 0: float (default) 1: fcomplex or geocoding lookup table 2: SUN/BMP raster file 3: unsigned char 4: short integer |
[bflg] |
output DEM bounds flag
(enter - for default): 0: use DEM bounds specified by DEM2_par (default) 1: determine bounds from DEM1_par in the projection specified by DEM2_par |
[lookup_table] | (output) complex valued lookup table (DEM2 -> DEM1) |
EXAMPLE
dem_trans dv_eqa.dem_par
dv_eqa.dem dv_utm.dem_par dv_utm.dem - - 1
Transforms DEM from Equiangular Projection to UTM. The input projection/ellipsoid/datum are specified in the input DEM parameter file: dv_eqa.dem_par. The output projection / ellipsoid / datum are specified in the output DEM parameter file: dv_utm.dem_par. A vertical datum-shift is applied between the projections.
The datum_shift_parameter is set to 1 to correct the transformed heights for the height difference caused by the Datum Shift. The oversamppling rates (lat_ovr=1 and lon_ovr=1) are not considered because an existing DEM/MAP parameter file is provided for the output geometry.
dem_trans dv_eqa.dem_par dv_eqa.dem dv_eqa5x.dem_par dv_eqa5x.dem 5 5
Oversampling of DEM (in Equiangular Projection) by a factor of
5 in both dimensions. A new DEM parameter file is created for the
output geometry , dv_eqa5x.dem_par does not
exist yet.
map_trans dv_eqa.dem_par dv_eqa.dem.ras dv_utm.dem_par dv_utm.dem.ras - - 0 2 1 dv.utm_to_eqa
Transforms the SUN raster image dv_eqa.dem.ras from Equiangular Projection to UTM. The input projection/ellipsoid/datum are specified in the input DEM parameter file dv_eqa.dem_par. The output projection/ellipsoid/datum are specified in the output DEM parameter file dv_utm.dem_par. The oversampling command line parameters lat_ovr and lon_ovr are not considered because an existing DEM parameter file is provided for the output geometry. The selected interpolation mode (0) is nearest neighbor and the image format specified (2) is SUN or BMP raster image. In addition the lookup table is written to the file dv.utm_to_eqa that can be used to transform additional data or raster images between the input and output geometries using the program geocode_back.
DESCRIPTION
dem_trans supports the transformation of a DEM or other image data between an input DEM geometry and an output DEM geometry. The input and output geometries (projection/ellipsoid/datum) are specified in DEM parameter files. In addition to the transformed data set a lookup table can be saved that may be used to transform additional images between the input and output geometries using the program geocode_back.
dem_trans is particularly adapted for the transformation of DEMs between input and output datums and projections. Input and output DEMs in float (REAL*4) and short integer (INTEGER*2) format are both supported. Bicubic polynomial interpolation ensures that the first derivative of the interpolated values is continuous. dem_trans has the functionality to apply a vertical datum shift to the DEM values. DEM height values are specified relative to a vertical datum. Vertical datums are often selected to minimize the offset to the local geoid. The geoid is defined as the surface of constant gravitational potential and is close to local sea-level. The WGS84 datum minimizes the geodal offset on a global basis and can differs from the geoid by up to +85 and -107 meters. Each country specifies a vertical datums (ellipsoids and offsets) that minimize the offset to the local geoid. The datum parameters are stored in the DEM_par and used to transform the DEM height values depending on the value selected for the datum_shift command line parameter.
dem_trans should be used to resample an existing DEM to a different spatial resolution (without changing the projection, reference ellipsoid, and reference datum) or it can be used to transform a DEM to an entirely different projection. The input and output map geometries (projection/ellipsoid/datum) are specified in the corresponding DEM parameter files. When specifying a DEM in a new geometry the required DEM parameter file can be created with the program create_dem_par. The bounds of the new DEM can also be calculated using coord_trans and entered when specifying the DEM2_par with create_dem_par. Alternately, there is new functionality in dem_trans and map_trans that calculates the the bounds for the output data (specified via the bflag value) from the input DEM parameters rather than using the original bounds specified in the DEM2_par.
When transforming from one DEM projection to another, dem_trans has functionality (specified via the bflag value) to calculate the DEM map bounds of the new projection from the input DEM parameters rather than using the bounds specified in the DEM2_par. Optionally, a lookup table for the transformation between the output DEM geometry and the input DEM can be printed out. The lookup table contains for each pixel of the output DEM a pair of float (fcomplex) corresponding to the corresponding coordinates in the input DEM with the real part corresponding to the real valued column (corresponding to easting or longitude) and the imaginary part corresponding to the real valued row number (corresponding to northing or latitude). This lookup table can be used to transform further data between the input and output geometry using the program geocode_back or between the output and input DEM geometry using geocode. This lookup table is not used if only the DEM is transformed.
To use a coarse resolution global DEM in EQA coordinates to improve SAR geocoding to UTM coordinates, for example, dem_trans may be used to transform the global DEM to local UTM coordinates. To define the output DEM parameter file the program create_dem_par is used. The UTM zone and the coordinates of the DEM corners are determined with the program coord_trans which allows to transform the SAR image corner coordinates from lat/lon (EQA) to UTM. In order to minimize errors caused by the necessary resampling it is recommended to select a higher resolution for the output DEM.
map_trans is similar
to dem_trans, but does
not have the requirement to perform vertical datum shifts as this
only applies to DEM data. map_trans supports the
transformation of data with various data types (float, short
integer, fcomplex, unsigned byte, SUN or BMP raster format) from
one map projection to another. Data type is specified using
the format command line
parameter. Interpolation for float, fcomplex and short integer
data is performed using either are nearest-neighbor or bicubic
polynomial algorithms based on the value of the interp_mode command line
parameter.
In addition, for both float and short integer data can be interpolated using bicubic-log interpolation. This mode is usually performed for data that is intensity or radar cross-section that is by definition non-negative. The logarithm of the data is interpolated rather than the data itself insuring that the output values are non-negative. For the unsigned byte and raster images nearest neighbor interpolation is performed.
If a lookup table is transformed from one projection to another, this can be accomplished using map_trans combined with interpretation of the lookup table as fcomplex format.
The supported map projections are listed in a table below.
Keyword | Projection |
EQA | Equiangular |
UTM | Universal Transverse Mercator |
OMCH | Oblique Mercator (Switzerland) |
LCC | Lambert Conformal Conic (France) |
TM | Transverse Mercator |
PS | Polar Stereographic |
LCC2 |
Lambert Conformal Conic of
Belgium, Madagaskar |
PC | Polyconic Projection |
AEAC | Albers Equal Area Conic |
SCH |
Spherical geometry map
projection (see "Zebker et. al, "Geodetically Accurate INSAR Data Processor", Trans. Geoscience and Remote Sensing, pp.4309-4321, vol. 49, no. 12, Dec., 2010) |
SEE ALSO
coord_trans, create_dem_par, geocode, geocode_back, typedef_ISP.h, typedef_DIFF.h .