ANSI-C program: geocode.c
NAME
geocode - Forward transformation with a geocoding look-up table.
For each image point defined in coordinate system A, the lookup
table contains the corresponding coordinates in system B. The
program geocode is used to resample the data in coordinate system
A into the coordinates of system B.
SYNOPSIS
geocode <gc_map> <data_in> <width_in>
<data_out> <width_out> [nlines_out] [interp_mode]
[dtype] [lr_in] [lr_out] [n_ovr] [rad_max] [nintr]
<gc_map> | (input) lookup table containing pairs of real-valued output data coordinates (fcomplex) |
<data_in> | (input) data file (format as specified by format_flag parameter) |
<width_in> | width of input data file and lookup table |
<data_out> | output data file |
<width_out> | width of output data file |
[nlines_out] | number of lines of output data file (default=0: all lines up to highest value) |
[interp_mode] | interpolation mode 0: 1/dist (default) 1: nearest neighbor 2: SQR(1/dist) 3: constant 4: Gauss weighting |
[dtype] | input/output data type 0: FLOAT (default) 1: FCOMPLEX 2: SUN raster/BMP 8 or 24 bit image 3: UNSIGNED CHAR 4: SHORT 5: SCOMPLEX 6: DOUBLE |
[lr_in] | input SUN raster/BMP format left/write flipped flag (default = 1: not flipped, -1: flipped) |
[lr_out] | output SUN raster/BMP format file left/write flipped flag (default = 1: not flipped, -1: flipped) |
[n_ovr] | interpolation oversampling factor (default = 2) |
[rad_max] | rad_max maximum interpolation search radius (default = 4*n_ovr: 8) |
[nintr] | number of points required for interpolation when not nearest neighbor (default = 4) |
EXAMPLE
geocode 8560_8059.UTM_to_RDC 8560_8059.utm.dtm 1422
8560_8059.rdc_hgt 1696 880 0 0
Transformation (from UTM to SAR coordinates) of DEM file of format float into Range/Doppler Coordinates (SAR)
geocode 8560_8059.UTM_to_SAR ls_map 1422 8560_8059.ls_map 1696 880 1 3
Transformation (from UTM to SAR coordinates) of layover/shadow map (of format unsigned char) using nearest neighbor resampling algorithm into SAR coordinates.
geocode 8560_8059_2.SAR_to_UTM 8560_8059.hgt 1696 8560_8059.utm.hgt 1422
Transformation of interferometric DEM data in SAR range/Doppler coordinates to UTM The lookup table 8560_8059.SAR_to_UTM is generated using gc_insar.
DESCRIPTION
geocode conducts forward transformation using
the geocoding lookup table (complex valued lookup table with
dimension of input data, with the real parts corresponding to the
output column and the imaginary part to the output row). For each
image point defined in coordinate system A, the lookup table
contains the corresponding coordinates in system B. The program
geocode is used to resample the data in coordinate system A into
the coordinates of system B.
As an example, program gc_map can be used to calculate the SAR range/Doppler image coordinates corresponding to a regularly spaced map grid in UTM and output these values in the form of a lookup table. For each UTM coordinate on the grid the lookup table contains the corresponding slant range pixel and azimuth pixel values in SAR coordinates (as real valued numbers). The interpolation necessary to determine the transformed values at the output pixel locations is based on irregularly spaced data. Note also that the input data and lookup table have the same dimensions (rows and columns). When gc_map computes the lookup table it can also compute a simulated SAR image in the map coordinate system. Transformation of this image into SAR coordinates requires running geocode. This transformed image can then be compared with the actual SAR image to determine small offsets that can be corrected using gc_map_fine
Valid input/output data formats are float, fcomplex (pairs of 4-byte floating point numbers), unsigned char, and SUN raster/BMP, and short complex (pairs of short integers) format.
The interpolation of the irregularly sampled data is implemented using nearest neighbor or convolutional interpolation weighting of the samples. Different weighting functions are selectable including 1/distance, 1/distance**2, and Gaussian. In the case of complex-valued data, the real and imaginary part are interpolated independently. In the case of unsigned char and SUN raster/BMP images, only the nearest neighbor algorithm is available.
For raster images (SUN Raster or BMP format) input and output data may be flipped left to right. This supports the forward transformation of left/right flipped raster images in SAR geometry.
The required geocoding lookup table is created using either the program gc_map (based on a DEM in map geometry) or gc_insar (using a height map in SAR geometry, as obtained with SAR interferometry).
OPTIONS
Similar results can be obtained by inverting the lookup table
itself using gc_map_inversion
and then use geocode_back to
generate the output product. The inverse lookup table can then be
reused for multiple data sets. The backward transformation is
faster because the input data are equally spaced.
SEE ALSO
gc_map, gc_map_grd, gec_map,
gec_map_grd, gc_insar, geocode_back, gc_map_inversion, typedef_ISP.h, typedef_DIFF.h .