Creating Image “World Files”

Q:  How do I make a "world file" so I can load a map image into HDMapper? I have an image file of a topo map that I want to use in HDMapper, but I sometimes get an error message about a missing “world file”, or if the image loads, the coordinates are wrong.  How do I correct this?

A:  With TAP6.0.2330 or later and a Maintenance Subscription date of January 31, 2010, or later, you can load the image file into an image viewer, then associate map pixels with latitude and longitude values to create the “world file” for the image.

Note that all values in this example are for demonstration purposes only.  You should determine appropriate settings for your application.

Another document will provide suggestions for obtaining image files of maps that you may be able to use in TAP.  Another article describes an older version of the Image Viewer function.

The utility function described in this article can be used to create approximate world files for use with image files in TAP.  It is always preferable to use a world file created when the image file is created, since differences in resolution, map projections, etc., can affect the precision of the map image.  The world file for use in TAP must use the units of decimal degrees of latitude and longitude.  If the world file is only available in other units or map projections, the Image Viewer function can be used to create a substitute world file as described below.

 

Launch the image viewer from the TAP “Map” menu by clicking “Image Viewer”:

(You can also launch the Image Viewer directly from the folder where TAP is installed by running the SWBMPViewer.exe application.)

The Image Viewer form is displayed:

Click the “Open” button (or use the File-Open menu) to load a file into the viewer.

Find the image file you want and click the Open button:

 

The image will be loaded into the viewer.

 

There are two ways to define reference points to create a world file:

·  You can select two reference points anywhere on the map

·  You can use the upper-left and lower right corners of the map

Reference Points

If the map has clearly marked coordinate values (as in the example above), or if you have known reference points (road crossings, political boundary intersections, etc.) you can use those values to define reference points on the map

To select two reference points on the map, click the “reference points” button on the Image Viewer toolbar:

 

If a world file already exists for the image, a warning will be displayed.  Click Yes to continue if you want to create a new file to replace the old file.

 

A yellow banner will be displayed prompting you to click on the first reference point.  Place the cross-hair cursor on the location where you know the coordinates and left-click the mouse:

 

A small circle will be shown to remind you of the location of the reference point. (The circle is only on the viewer.  It is not written to the image file.)  You will be prompted to enter the coordinates of the location.  This enables the program to associate those coordinates with the selected pixel in the image.

 

The program will prompt you for the second reference point, and you can click on the location and enter the corresponding coordinates:

The two points you select must have different latitude and longitude values.  If you select, for example, two points on the same latitude line, the operation will be cancelled.

After the world file has been created, the image can be loaded into HDMapper, along with other shapefile layers, such as area coverage computed with HDCoverage.

Corner Points

You can also use two corners of the image (upper-left and lower-right) to define coordinates for creating a world file.  This option should usually be used only with image files having the map image all the way to the edge of the file.  Some files (like the example above) include borders or white-space around the map image.  In such cases, be sure you do not use the map corner coordinates to define the image, since the image (including white-space) extends beyond the map.

To define coordinates for the corners of an image file, click the “Corners” button on the Image Viewer form:

 

You will be prompted for the coordinates of the corners, first the upper-left corner:

This example is taken from the file downloaded in the Mapping Image Files Online article.  The Terraserver window is also shown with the "info" display to see the image corner coordinates.

Then you will be prompted for the coordinates of the lower-right corner.  :

Click the Continue button to complete the world file information.  You can then close Image Viewer and load the file into HDMapper.

 

Search SoftWright Website

 

Copyright 2010 by SoftWright LLC