A world file (. English spelling: worldfile ) is a small text file that geospatial reference contains an image. This branch file type was introduced by ESRI as a supplement for simple image formats. The file name extension is derived from the image type and is, for example, .jgw , .j2w , .pgw , .gfw, or .tfw for JPEG , JPEG 2000 , PNG , GIF , or TIFF image data. The reference system is missing from the file.
A world file contains 6 lines with the 6 parameters of the affine transformation :
- a11 = x component of the pixel width
- a21 = y component of the pixel width
- a12 = x component of the pixel height
- a22 = y component of the pixel height (mostly negative)
- b1 = x-coordinate of the center of the top left pixel
- b2 = y-coordinate of the center of the top left pixel
Interpretation of the parameters
The equations of the affine transformation are:
with the world coordinates (x, y) and the image coordinates (column s, line z).
The affine transformation covers the translations in x and y, the scales of the x and y axes, as well as the rotations of the x and y axes (and thus also the shear). If it is only a question of a similarity transformation , the following applies: a11 = - a22 and a12 = a21. There is often a minus in front of the pixel height, since the y-axis of the image coordinate system points downwards - i.e. H. the y-axis is mirrored.
The dimensions of a pixel can be calculated as follows:
- Pixel width:
- Pixel height:
The angles of rotation are calculated as follows:
- The rotation angle of the x-axis:
- The rotation angle of the y-axis:
If the twist is only very small, the parameters a11 and a22 can be interpreted approximately as the size of the pixel in the x and y directions. a21 and a12 are then approximately zero.
In the general case in which distortions and shearings are present in both coordinate systems, the parameters cannot be interpreted clearly.
Due to a lack of information regarding the reference systems (projected and geographic coordinate systems), world files can only be used in a known context. The units of length and the reference system of the map in which the image is located are derived from this. With the GeoTIFF image format , these data are binary in the file header.
Example of a world file, matching the middle picture below (in the reference system WGS 84 ):
1.669E-4 0 0 -9.278E-5 8.491 50.058
Lines 2 and 3, which describe the orientation and linear distortion of the image, are indicated with 0.0, since there is no rotation around the respective axes. The image was corrected accordingly beforehand. The units per pixel in the y-direction (line 4) are usually negative because an image has its point of origin at the top left, but a geographical coordinate system at the bottom left.
In the reference system used, the coordinate axes correspond to the geographical longitude and latitude in degrees. In the example, therefore, lines 5 and 6 define the upper left coordinate origin at 50.06 ° N and 8.5 ° E, a location southwest of Frankfurt. Together with the known pixel size of the image file, lines 1 and 4 define the image size in degrees on the card.
If, on the other hand, a projected reference system (for example UTM ) is used, the parameters are to be interpreted in the projected coordinate system (east value / north value), i.e. generally in the order of meters or meters per pixel.
Aerial view of Frankfurt Airport. North axis rotated by approx. 25 °. Not orthorectified .