Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
World file
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{More sources|date=December 2024}}{{Short description|Geographic data file}} A '''world file''' is a six line [[plain text]] [[sidecar file]] used by [[geographic information system]]s (GIS) to [[georeference]] [[Raster graphics|raster]] map images. The file specification was introduced by [[Esri]].<ref name="Esri"/>{{efn |name="Esri wld"}} ==Filename extension== The base [[filename]] of a world file matches the raster's base filename, but has a different [[filename extension]] (suffix). 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 {{mono|''mymap''.jpg}} should have a world file named {{mono|''mymap''.jpgw}}. An alternative file naming convention that uses a three-character extension to conform to the [[8.3 filename|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: {| class="wikitable" ! Raster format !! Raster file name !! World file name |- | [[GIF]] || {{mono|''mymap''.gif}} || {{mono|''mymap''.gfw}} |- | [[JPEG]] || {{mono|''mymap''.jpg}} || {{mono|''mymap''.jgw}} |- | [[JPEG 2000]] || {{mono|''mymap''.jp2}} || {{mono|''mymap''.j2w}} |- | [[Portable Network Graphics|PNG]] || {{mono|''mymap''.png}} || {{mono|''mymap''.pgw}} |- | [[TIFF]] || {{mono|''mymap''.tif}} || {{mono|''mymap''.tfw}} |} A third convention is to use a {{mono|.wld}} file extension, irrespective of the type of raster file, as supported by [[GDAL]] and [[QGIS]], but not [[Esri]].{{efn |name="Esri wld" |Esri also has another ''world file'' format that applies to computer-aided design or [[Computer-aided design|CAD]] drawing files. That standard refers to the format of plain text computer files with names ending in {{mono|.wld}} and is not discussed in this article.}} ==Content== [[File:WorldFileParametersSchemas.gif|right|thumb|upright=2.0|Graphical view of world files parameters and computed values of the four first upper left pixels of an image.]] The generic meaning of the six parameters in a world file (as defined by Esri<ref name="Esri">{{cite web |date=2016-05-05 |title=FAQ: What is the format of the world file used for georeferencing images? |url=http://support.esri.com/en/technical-article/000002860 |access-date=2017-09-29 |archive-url=https://web.archive.org/web/20230304183331/https://support.esri.com/en/technical-article/000002860|archive-date=2023-03-04|publisher=[[Esri]]}}</ref>) 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{{efn|The ''E'' parameter is often a negative number. This is because most image files store data from top to bottom, while the software utilizes traditional [[Cartesian coordinates]] with the origin in the conventional lower-left corner. If your raster appears upside-down, you may need to add a minus sign. The parameter therefore describes the map distance between consecutive image lines.}} *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 This description is however misleading in that the ''D'' and ''B'' parameters are not angular rotations, and that the ''A'' and ''E'' parameters do not correspond to the pixel size if ''D'' or ''B'' are not zero. The ''A'', ''D'', ''B'' and ''E'' parameters are sometimes named "x-scale", "y-skew", "x-skew" and "y-scale". A better description of the ''A'', ''D'', ''B'' and ''E'' parameters is: *Line 1: ''A'': ''x''-component of the pixel width (''x''-scale) *Line 2: ''D'': ''y''-component of the pixel width (''y''-skew) *Line 3: ''B'': ''x''-component of the pixel height (''x''-skew) *Line 4: ''E'': ''y''-component of the pixel height (''y''-scale), 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 All four parameters are expressed in the map units, which are described by the [[spatial reference system]] for the raster. When ''D'' or ''B'' are non-zero the pixel width is given by: :<math>\sqrt{A^2+D^2}</math> and the pixel height by :<math>\sqrt{B^2+E^2}</math> World files describing a map on the [[Universal Transverse Mercator coordinate system]] (UTM) 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 The above description applies also to a rectangular, non-rotated image which might be, for example, overlaid on an orthogonally projected map. If the world file describes an image that is rotated from the axis of the target projection, however, then A, D, B and E must be derived from the required affine transformation (see below). Specifically, A and E will no longer be the meter/pixel measurement on their respective axes. These values are used in a six-parameter [[affine transformation]]: :<math> \begin{bmatrix} x\prime \\ y\prime \end{bmatrix} = \begin{bmatrix} A & B & C\\ D & E & F\end{bmatrix} \begin{bmatrix} x \\ y \\ 1 \end{bmatrix}</math> which can be written as this set of equations: :<math>\begin{align} x' &= A\,x + B\,y + C \\ y' &= D\,x + E\,y + F \end{align}</math> where: :''x''' is the calculated UTM easting of the pixel on the map :''y''' is the calculated UTM northing of the pixel on the map :''x'' is the column number of the pixel in the image counting from left :''y'' is the row number of the pixel in the image counting from top :''A'' or ''x''-scale; dimension of a pixel in map units in ''x''-direction :''B'', ''D'' are rotation terms :''C'', ''F'' are translation terms: ''x'', ''y'' map coordinates of the center of the upper-left pixel :''E'' is negative of ''y''-scale: dimension of a pixel in map units in ''y''-direction The ''y''-scale (''E'') 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 (i.e. those with a positive ''y''-scale). To go from UTM(x'y') to pixel position(x,y) one can use the equation: :<math>\begin{align} x&=\frac{Ex'-By'+BF-EC}{AE-DB}\\ y&=\frac{-Dx'+Ay'+DC-AF}{AE-DB} \end{align}</math> Example: Original <code>falknermap.jpg</code> is 800Γ600 pixels (map not shown). Its world file is <code>falknermap.jgw</code> and contains: 32.0 0.0 0.0 -32.0 691200.0 4576000.0 <!-- no image (was unsourced and removed) [[file:falknerisland.jpg|thumb|USGS map of Falkner Island]] --> 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 (grid) zone is not given so the coordinates are ambiguous — they can represent a position in any of the approximately 120 [[Universal Transverse Mercator coordinate system#Notation|UTM grid zones]]. In this case, approximate latitude and longitude (41.2, −072.7) were looked up in a [[gazetteer]] and the UTM (grid) zone was found to be 18 using a Web-based converter. ===Localization=== When writing world files it is advisable to ignore [[Internationalization and localization|localization]] settings and always use dot {{char|.}} as the [[decimal separator]]. Also, negative numbers should be specified with the "-" character exclusively. This ensures maximum portability of the images. ==See also== *[[Esri grid]] β embeds a similar georeferencing context within a single raster file *[[GeoTIFF]] *[[MapInfo TAB format]] - a popular geospatial vector data format for GIS software == Notes == <references group="lower-alpha" /> ==References== {{reflist}} ==External links== *[https://web.archive.org/web/20160304051310/http://egb13.net/2009/03/worldfile-calculator// Online Worldfile Calculator] *[http://freegeographytools.com/2007/worldfile-basics Worldfile Basics] *[http://www.kralidis.ca/gis/worldfile.htm Esri World File Format] [[Category:GIS raster file formats]] [[Category:Cartography]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Char
(
edit
)
Template:Cite web
(
edit
)
Template:Efn
(
edit
)
Template:Mono
(
edit
)
Template:More sources
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)