Datums and ellipsoidsUsing GPSMan in graphical modeMapMap background images

Map background images

A map background image can be loaded either from a file containing an image in a recognized graphical format, in which case it must be geo-referenced, or from an image information file that contains geo-referencing information together with the path of the files containing images. GPSMan will automatically detect the kind of file it has to load from. It only makes sense to have as background images maps in one of the projections that GPSMan implements.

Tcl/Tk accepts both the GIF and PNM graphic formats. GPSMan tries to load the Img Tcl/Tk library that provides support also for JPEG, TIFF and other formats. This library has two problems when saving an image:

Geo-referencing a background image consists in selecting a projection and a coordinates transformation and in placing control waypoints in the image in order to fix the values of the parameters of the projection and the transformation. Only then is it possible to compute map coordinates from geodetic coordinates or the inverse. In fact, to convert from geodetic coordinates (i.e., coordinates in the spheroid, typically as latitude and longitude) into pixel coordinates in the screen there are two operations:

  1. a projection, that from geodetic coordinates computes Cartesian plane coordinates, and
  2. a coordinates transformation, that from Cartesian plane coordinates computes pixel coordinates.
This last operation is needed because the image can be rotated or distorted.

When geo-referencing an image to be loaded from a file in GIF or PNM format, the following information must be known:

If the image is that of a map, the first two will hopefully be described in it. The corresponding options should be selected from the two menu-buttons at the left on the bottom of the map window, if the map window is the main window, or the Datum and Projection menu-buttons of the map window, if the lists window is the main window. As to the datum, it must be emphasised that some maps have a cartographic datum (the one used for projecting the map elements) and then one or more sets of grid lines projected using other different datums. The datum to be selected in GPSMan is the cartographic one, not any of the grid ones. On the other hand, if the intersection points of a grid are to be used as control points for geo-referencing the image, the datum for the grid should be used when creating the corresponding waypoints. More information on datums can be found below

The transformations presently available in GPSman are

Along with this information, 2 or 3 control waypoints with known coordinates will be needed to be placed over the image to geo-reference it. These waypoints can either be selected from the existing ones, or be defined when geo-referencing the image; in the latter case only the name and position will be asked for, and if no name is given one is automatically generated. If they are defined beforehand it is a good idea to use either no symbol, or to use the Mark, x symbol so that later on they can be placed exactly where they should be in the image. If the transformation is the "affine conformal" one 2 waypoints will be needed, otherwise 3. In the latter case, the waypoints should be chosen so as to form an almost equilateral triangle, in order to minimise positioning errors.

After these preliminary steps, either the entry Map->Background->Load from the Map menu-button (if main window is the map window), or the entry Load of the Background menu-button (if main window is the lists window) should be selected. The file to be loaded is then chosen. This may be a GPSMan image information file (containing geo-referencing information) in which case the image is loaded with no further ado.

If it is a GIF or PNM file, dialog windows will allow for the selection of the transformation to be used and the 2 or 3 waypoints that will serve as control points. The image is then presented in the map window.

In the case of the "affine" and "affine conformal" transformations each waypoint is then placed by the user over the image where it should be and its name and position entered if it did not exist.

If the "affine conformal no rotation" transformation was selected, the user is asked first for the names and positions of the control waypoints to be defined if there are any. One of the waypoints is placed first and 2 lines will de drawn. Each of the other 2 waypoints must be over each of these lines. When the mouse is moved, the 2 wayponts will move over these lines until the user clicks the left-button to place them both at the same time.

The operation is finished by clicking on the Ok or Cancel buttons of the dialog window. The map scale cannot be changed if there is a background image, and an image can only be loaded to an empty map.

After geo-referencing an image, it can (should) be saved through the entry Save geo-ref info (under either Map->Background, or Background menu-buttons) so that the next time it can be loaded with no need for geo-referencing.

It is a fact that for the "affine conformal no rotation" transformation, 2 waypoints would be sufficient. However GPSMan asks for 3 to be placed so that the user may place 2 of them at the same time, in this way having more control on positioning errors. The 3 waypoints should form an almost equilateral triangle that can be shown in the map window. The order of the 3 waypoints is important, as the first one cannot be moved after being placed. This waypoint, then, should be such that there are no doubts on where it should go. It will be shown together with lines that will contain the other two, and will be placed by clicking the left-button. The other two will be placed as a pair in the same way, scale changes being displayed.

Other background images can be loaded after having one image geo-referenced by using the Change option of the map Background menu.

All images must have the same datum, projection and coordinates transformation as the first image. Each image will be described by the path of its file.

In order to load different sheets of a map to the background, images assumed to have exactly the same size as the first image can be loaded to a slot in a grid. This is done by selecting the grid slot in the diagram that is shown and using the Load button. Selecting a non-empty slot will show the file path of the corresponding image.

For loading images that cannot be taken as being in a grid (overlapping other images or having different sizes) the Load button in the right panel of the dialog should be used. A single control waypoint is needed to be placed over the new image and can be either selected from the data-base or defined before being placed. The list of file paths for the images loaded in this way is shown in a list. Selecting one of them will create a representation of the image in the diagram of the left panel. It will appear only when the cursor is on the right panel, and it may be too far away to be seen.

The Clear buttons in the dialog will remove the selected images in either panel. The first image cannot be removed.


GPSMan User Manual
©Miguel Filgueiras, mig_at_ncc.up.pt, DCC-FC & LIACC, Universidade do Porto, 2003

Datums and ellipsoidsUsing GPSMan in graphical modeMapMap background images