Geoscience Reference
In-Depth Information
-t_srs srs_defn
Defines the target coordinate system. This coordinate system will be written to
the file after an update.
-et max_pixel_err
The error threshold (in pixels) beyond which the file will not be updated. If not
provided no update will be applied to the file, but errors will be reported.
target_file
The file to be operated on. To update this must be a file format that supports in
place updates of the geotransform and SRS.
The affine transformation can be calculated based on the set of six coefficients,
stored by GDAL as an array of doubles (adfGeoTransform) and here abbreviated
as GT:
X
=
GT
[
0
]+
pixel
·
GT
[
1
]+
line
·
GT
[
2
]
(8.1)
Y
=
GT
[
3
]+
pixel
·
GT
[
4
]+
line
·
GT
[
5
]
(8.2)
For an image, rotated anti-clockwise
α
radians, the coefficients are:
adfGeotransform[0]: ULX (upper left X coordinate)
adfGeotransform[1]: cos
(α) ·
Xres
adfGeotransform[2]:
sin
(α) ·
Xres
adfGeotransform[3]: ULY (upper left Y coordinate)
adfGeotransform[4]:
sin
(α) ·
Yres
adfGeotransform[5]:
cos
(α) ·
Yres
We recognize the sine and cosine terms from a rotation matrix. The minus signs
for the last two coefficients operating on Y are due to the convention that for a
North-up image coordinates in Y decrease from North to South. In the case
α =
0,
the coefficients reduce to:
adfGeotransform[0]: ULX (upper left X coordinate)
adfGeotransform[1]: Xres (West-East pixel size in meter)
adfGeotransform[2]: 0
adfGeotransform[3]: ULY (upper left Y coordinate)
adfGeotransform[4]: 0
adfGeotransform[5]: -Yres (North-South pixel size, negative and in meter)
Suppose we want to (affine) transform the forest type map flanders.tif to the
Belgian Lambert 72 projection system (EPSG:31370). We first list the content of the
adfGeotransform of the original image in the European projection:
adfGeotransform[0]: 3799000
adfGeotransform[1]: 25
adfGeotransform[2]: 0
adfGeotransform[3]: 3168000
 
Search WWH ::




Custom Search