blankblank blank

Worldfile Basics

I’ll be doing a bunch of upcoming posts on free software for working with image worldfiles, so I thought I’d spend one post reviewing their basics. A worldfile is a simple text file that contains the information necessary to assign geographic coordinates to a raster image, to georeference it for use in a GIS program. For example, suppose I have a image like the one below (downsized by a factor of two from its original pixel dimensions of 1448 x 942 pixels):

Google Earth image with worldfile

The worldfile for the original image is:


The bottom two numbers are the longitude and latitude of the pixel in the upper-left-hand corner. The top number is the horizontal size of a pixel in coordinate units (longitude degrees in this case); the third number from the bottom is the comparable vertical pixel size in latitude degrees, negative because latitude decreases as you go from top to bottom in the image. The two other lines are rotation/compression factors for left/right and top/bottom, and are rarely used. Using the worldfile data, and the pixel dimensions of the image, a GIS can calculate the corresponding geographic position for every pixel in the image.

Worldfiles have an extension that depends on what kind of image file they’re associated with. Typically, it’s the first and last letters of the image extension, with a “w” at the end, but the full image extension with “w” at the end is also sometimes used. For example:

JPG image: worldfile has .jgw or jpgw extension.

BMP image: worldfile has .bpw or .bmpw

TIFF image: .tfw or .tifw

The extension .wld is supposedly acceptable as a general worldfile extension, but I’ve never seen it in the wild.

Worldfiles are plain text, and don’t contain any embedded information in them about the coordinate system. In the example above, it’s pretty obvious that the worldfile is in geographic coordinates, latitude/longitude. But the GIS program you open the image in won’t necessarily know that, and you’ll have to take care that the image’s coordinate system matches up with that of the other data you’re adding to the view. If your image is in geographic coordinates, and your shapefile data is in UTM, the GIS may not be able to convert the coordinates of them “on-the-fly” to match each other.

And there’s also the datum to keep in mind, since worldfiles don’t contain datum information, either. If the image is in the WGS84 datum, and your other data is in NAD27, there can be a distance discrepancy of hundreds of meters between the depicted position and the true position. Some programs can create another text file with the “.PRJ” extension that will contain information about the coordinate system and datum for a worldfile, but some free GIS programs can’t read that PRJ data.

Many image formats, like BMP and JPG, require a worldfile to georeference the image for use in a GIS. Other formats, like TIFF and MRSid, can use worldfiles, but can also have the georeferencing information embedded in the image file itself, optionally with coordinate system and datum information. For TIFF-format files, these are commonly referred to as GeoTiffs. Many GIS programs can open these files and extract the georeferencing data from them automatically, though a few can’t. And while you can open a GeoTiff file in an image editing program like Photoshop, if you save the image that georeferencing data is lost.

Upcoming posts in the series will deal with software that can do various things related to worldfiles, like:

– Combine a worldfile for an image format that doesn’t allow embedding coordinate data inside of it, and save it in a format that does support embedding;

– Extracting worldfile data from embedded coordinate data in an image, and re-embed it without modifying the image data

– Modifying an image file in Photoshop, and then re-embedding the coordinate data using a worldfile

– Creating worldfiles for map images that don’t have them, so that they can be used in a GIS

– Saving and embedding coordinate system / datum information in image formats that support it

Looking for something else? Enter some keywords below, then click "Search".