World file
A world file is a six line plain text sidecar file used by geographic information systems to georeference raster map images. The file specification was introduced by Esri.
Filename extension
The base filename of a world file matches the raster's base filename, but has a different filename extension. There are three filename extension naming conventions used for world files, with variable support across software.One simple convention with widespread support is to append the letter "w" to the end of the raster filename. For example, a raster named should have a world file named.
An alternative file naming convention that uses a three-character extension to conform to the 8.3 file naming convention uses the first and last character of the raster file's extension, followed by "w" at the end. For example, here are a few naming conventions for popular raster formats:
| Raster format | Raster file name | World file name |
| GIF | ||
| JPEG | ||
| JPEG 2000 | ||
| PNG | ||
| TIFF |
A third convention is to use a file extension, irrespective of the type of raster file, as supported by GDAL and QGIS, but not Esri.
Content
The generic meaning of the six parameters in a world file is:- Line 1: A: pixel size in the x-direction in map units/pixel
- Line 2: D: rotation about y-axis
- Line 3: B: rotation about x-axis
- Line 4: E: pixel size in the y-direction in map units, almost always negative
- Line 5: C: x-coordinate of the center of the upper left pixel
- Line 6: F: y-coordinate of the center of the upper left pixel
A better description of the A, D, B and E parameters is:
- Line 1: A: x-component of the pixel width
- Line 2: D: y-component of the pixel width
- Line 3: B: x-component of the pixel height
- Line 4: E: y-component of the pixel height, typically negative
- Line 5: C: x-coordinate of the center of the original image's upper left pixel transformed to the map
- Line 6: F: y-coordinate of the center of the original image's upper left pixel transformed to the map
When D or B are non-zero the pixel width is given by:
and the pixel height by
World files describing a map on the Universal Transverse Mercator coordinate system use these conventions:
- D and B are usually 0, since the image pixels are usually made to align with the UTM grid
- C is the UTM easting
- F is the UTM northing
- Units are always meters per pixel
These values are used in a six-parameter affine transformation:
which can be written as this set of equations:
where:
The y-scale is negative because the origins of an image and the UTM coordinate system are different. The origin of an image is located in the upper-left corner, whereas the origin of the map coordinate system is located in the lower-left corner. Row values in the image increase from the origin downward, while y-coordinate values in the map increase from the origin upward. Many mapping programs are unable to handle "upside down" images.
To go from UTM to pixel position one can use the equation:
Example:
Original
falknermap.jpg is 800×600 pixels.Its world file is
falknermap.jgw and contains:32.0
0.0
0.0
-32.0
691200.0
4576000.0
The position of Falkner Island light on the map image is:
x = 171 pixels from left
y = 343 pixels from top
This gives:
x1 = 696672 meters Easting
y1 = 4565024 meters Northing
The UTM zone is not given so the coordinates are ambiguous — they can represent a position in any of the approximately 120 UTM grid zones. In this case, approximate latitude and longitude were looked up in a gazetteer and the UTM zone was found to be 18 using a Web-based converter.