english français


Do not hesitate to contact the technical support of Multiplans if you are having trouble importing a map.

Warning: Most maps are protected by laws on copyright. Before using a map with Multiplans, make sure you have the right to do so!

Importing a map

There are several ways to import a map into Multiplans:

Program MAPC2MAPC (£10, windows) can take a wide range of calibration files (including ECW, GeoTIFF, .MAP, .KAP, .JPR, .CAL, .TAB, .TFW, .JPW, .PGW and KMZ and KAP combined files) and image formats and write different outputs, including an osz map archive that can be imported directly into Multiplans. If needed, MAPC2MAPC reprojects the map to Mercator and cuts the image into tiles. Though writing a ref.txt calibration file is not difficult, MAPC2MAPC allows to import calibrated maps into Multiplans by just pointing and clicking.


Optimization: cutting the map into tiles
When importing a map, Multiplans slices the map image into tiles of size 256x256 pixels (this is needed to display the map on the iPhone). Although the code that slices the map has been carefully optimized, it can take some time on very large maps. To speed up importing very large maps, it is recommended to cut the map image into tiles on a computer before importation into Multiplans. There is no need to do this slicing in the case of maps saved as OSZ because these maps are already cut into tiles.
Instructions for cutting a map into tiles

The next two sections contain more information on the transfer of a map in Multiplans, and on creating a calibration file.

Adding a map into Multiplans

There are two ways to add a map in Multiplans (the map must be an OSZ file, a zip archive, or a simple image file): To transfer a map, open the "Add maps" screen by tapping on the + on the main screen Multiplans.
When the "Add maps" screen is opened, a web gateway is created at the address indicated (http://192.168.1.83:8080 in this example). Connect to this gateway to transfer the map from the computer into Multiplans.
Step-by-step instructions

To transfer a map by USB cable using iTunes:

  1. Open iTunes, and select your iPhone.
  2. Go under "Apps" and select Multiplans.
  3. Click on button "Add..." to add a new map.
  4. After iTunes transfered your map to the iPhone, open the "Add maps" screen in Multiplans. Importation of the map transferred in step 3 should then start right away.
Note: Do not use iTunes to delete maps in Multiplans. For that, use the "Delete map" button in Multiplans.

Calibration of a map

GPS positioning is available only on maps that are calibrated. Calibrating a map amounts to give some information on the map (calibration points and cartographic projection), information that is necessary to locate a point on the map from its geographic coordinates. As already mentioned, maps in OSZ format are calibrated automatically.

The calibration information is often provided with the map. Maps in ECW, GeoTIFF and GeoPDF formats contain the calibration information inside the file. Other maps are supplied with a separate calibration file, such a a .map file, or a world file with extension tfw, jpw or ers. If no calibration file is provided with the map (case of a scanned map sheet for example, or of a map obtained by a screenshot), it is possible to calibrate it manually.

A strong point of Multiplans is that it knowns about a large number of cartographic projections. Thanks to this, it is possible to have very accurate GPS positioning, correct down to a pixel, on all kinds of maps, be it a Swiss map (based on an oblique Mercator projection), and English Ordnance Survey map, or a map of any other country.

For maps whose projection is not known, it is possible to calibrate it approximately by entering a few calibration points; Multiplans then interpolates the coordinates between the given calibration points.

Multiplane accepts two types of calibration files:

Calibration method 1: .map file

As many maps come with a .map calibration file, providing this file to Multiplans is often the easiest method. In the absence of .map file, you can conveniently create such a calibration file using OziExplorer (commercial program, but a demo version fully working for 1 hour is available). Note that though OziExplorer is a Windows program, the free program wine (see also winebottle and Play on Mac ) allows to run OziExplorer on MacOS without problems.

Warning: .map files are only partially supported. Multiplans uses currently always bilinear interpolation with maps that are calibrated via the a .map file method. The bilinear interpolation is performed using the four calibration points that are specified in the lines MMPXY and MMPLL in the .map file. If the map projection indicated during calibration in OziExplorer is "Lat / Long" (which is the most frequent case), the calibration will be as accurate in Multiplans as in OziExplorer. If the map uses a projection other than "Latitude / Longitude" (see line 9 in the .map file after keyword "Map Projection"), there may be differences between the calibration in Multiplans and the one in OziExplorer (especially if the map has a large extent). In the case where the automatic conversion of the .map calibration file did not produce good results, you need to calibrate the map by providing a calibration ref.txt file.

Apart from the case of (pseudo) projection "Lat / Long" (for which the .map calibration method is exact), we can expect, in general, that the .map file calibration method will be accurate if lines of constant longitude, and lines of constant latitude, show no significant curvature and their spacing is regular. The curvature of these lines appear typically on maps that have a geographical extent of more than 100 km.

Calibration method 2: ref.txt file

The method of calibrating maps by writing a ref.txt calibration file is powerful and versatile. The idea is to specify some calibration points on the map (typically 4, but 2 may be sufficient). A calibration point is a point on a map for which one specifies its geographic coordinates (longitude and latitude, or coordinates in a given map projection). In the ref.txt file, one can also specify the cartographic projection used by the map. This information is generally required to obtain good accuracy in the calibration of large maps (covering areas of more than 100 km).

Note that the ref.txt calibration file for maps from some mapping web sites (for instance Google Maps, maps from the French, Swiss and English geoportals, etc..) can be generated automatically! See explanation on page Map viewers .

A ref.txt calibration file is a plain text document that can be written using eg TextEdit (on MacOS) or NotePad (on Windows). Note that Multiplans adopts the convention that the GPS coordinates are given in the order longitude, latitude (and not the reverse order longitude, latitude as in Google Maps).

Two cases may arise:

(A) Case of a map whose cartographic projection is unknown

If the used map projection is unknown, one can calibrate approximately the map by specifying four (or possibly only 2) calibration points on the map. The best results are obtained with four calibration points located near the four corners of the map.

Example: file ref.txt with four calibration points
Bilinear interpolation
0, 0 = 6.708785, 51.233717
0, 8000 = 6.851875, 51.236431
8000, 8000 = 6.856050, 51.146598
8000, 0 = 6.713237, 51.143892

The 1st line of file ref.txt contains the keyword "Bilinear interpolation", which tells Multiplans that it should interpolate or extrapolate the coordinates from the 4 (or 2) calibration points that are given in the next few lines in the file.
The calibration points are entered as lines of the form
x, y = longitude, latitude
where x and y are the coordinates (in pixels) of a point on the map, and "longitude, latitude" are the corresponding GPS geographical coordinates of this point (WGS84 datum). The coordinates x = 0, y = 0 corresponds to the upper-left corner of the image, while the point x = 0, y = 8000 pixels is located 8000 pixels below, on the left edge of the image. In this example, the four calibration points are located at the corners of a map of size 8000x8000 pixels, but it is not mandatory to put the calibration points exactly at the corners of the image. The four points must be put at the vertices of a rectangle or of a quadrilateral that is a "not too distorted" rectangle (technically speaking: the quadrilateral must be convex). If three calibration points are aligned along a straight line, the results will not be good!

To find the coordinates (in pixels) of a point on an image, one can use eg GraphicConverter (on MacOS), menu "Windows -> Contact." Alternatively, one can Multiplans to find these coordinates: Import the map without calibration file, and then create a point-of-interest on the map. The information screen on the point of interest displays the pixel coordinates of that point. (In a future version of Multiplan, it will be possible to indicate graphically the calibration points on the map, without having to write a ref.txt calibration file)

The method of bilinear interpolation with 4 points gives in general good results for maps that have a not too large geographical extent (less than 100 km). In the case where the lines of constant longitude (and those of constant latitude) are aligned along the vertical (respectively along the horizontal) direction, it is sufficient to specify only two calibration points. In that case, choose the two calibration points to lie approximately near two diagonally opposite corners of the map.

(B) Case of a map that uses a known projection

This is the ideal case, where we know the cartographic projection used by the map. We can then specify the projection on the first line of the ref.txt file and enter in the following lines of the file only two calibration points. 2 points are indeed sufficient to obtain an exact calibration when the map projection is known. (Warning: specify only 2 calibration points and not more!)

The map projection can be specified either by the keyword "EPSG:" followed by the EPSG projection number or by the keyword "PROJ", followed by a series of keywords describing this projection in the language PROJ library.

Example: The Swiss map above, like any swisstopo map, uses an oblique Mercator projection with EPSG number 21781. On page map.geo.admin.ch map (Avenches) , one can easily find the geographic coordinates of a point on the map. We determined in this way the geographical coordinates of two calibration points, shown in red in the picture above. With this information, the map can be calibrated by writing one of the following contents in file ref.txt:
Ref.txt file with EPSG map projection number, followed by two entries corresponding to two calibration points (geographic coordinates are expressed in Swiss coordinates)
EPSG: 21781
135,56 = 569000,193000
1136,656 = 574000,190000
Same, but with the coordinates of calibration points given in the WGS84 system (GPS)
EPSG: 21781
135.56 = 7.03193, 46.88734 (WGS84)
1136.656 = 7.09766, 46.8606 (WGS84)

Note that if one enter the geographical coordinates of calibration points in the WGS84 system, that is by their GPS coordinates, we have to add the keyword "(WGS84)" after the coordinates (warning: do not write "WGS 84" with a space, but "WGS84"). The syntax for a calibration point is then
x, y = longitude, latitude (WGS84)
In the absence of keyword "WGS84", the coordinates are interpreted as being expressed in the system of the map projection defined in the first line of file ref.txt.

To find the EPSG number of a cartographic projection, see table on next page .

Instead of specifying the EPSG projection number, the cartographic projection can be described by using the keywords of the library PROJ4. This is particularly useful when the projection has no assigned EPSG number. Another advantage of using the description by the PROJ library is that the various parameters that enter in the definition of the projection are explicitly mentioned. The first line of the file ref.txt begins then by keyword "PROJ" (instead of "EPSG"), as in the following example:
File ref.txt with projection defined using the proj library
PROJ:+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.999601 +x_0=400000 +y_0=-100000 +ellps=airy +units=m +no_defs
135,56 = 569000,193000
1136,656 = 574000,190000
To find how to describe a map projection using the PROJ library, refer to the next page .

In any case, we can check if a ref.txt calibration file is correct by adding a point of interest on the map, and by checking if its shown longitude and latitude coordinates are correct.

Variation: 1-point calibration and resolution
Instead of giving two calibration points, it is possible to give only one point, and to enter in the next line of the file ref.txt, the resolution of the map. For the Swiss map above, we could also write the following calibration files:
Ref.txt file with a single calibration point, followed by the resolution of the map
EPSG: 21781
135,56 = 569000,193000
resolution: 5
Same, the calibration point being located at the center of the map
EPSG: 21781
center = 7.0636, 46.87376 (WGS84)
resolution: 5
The resolution of the map must be entered in "unit of cartographic coordinates" / pixel. For example, if the X and Y coordinates are measured in meters, the resolution must be given in meters per pixel.
If the geographic coordinates of the calibration point are given in the WGS84 system, the concomitant use of keyword "resolution" requires version 1.41 (or later) of Multiplans to work properly.

Note: The syntax of the ref.txt has evolved since the first version of Multiplans. The syntax used by the first versions of Multiplans ( see here ) is still accepted, but it is not recommended for use.

Note: In the current version, Multiplans assumes that the map has not been rotated relative to the cartographic projection defined in the first line of file ref.txt. This means that the lines with coordinate X = constant (or Y = constant) (where X and Y are the coordinates defined by the map projection, such as Swiss coordinates) must be horizontal (resp. vertical), as in the example of the Swiss map above. If the map shows a grid of X, Y coordinates which has been rotated, use a drawing program to compensate for the rotation before calibrating the map. The compensation of the rotation must be done for instance in the case of some scans of IGN map sheets: introduce a rotation so that the small black crosses corresponding to the Lambert grid are aligned horizontally and vertically (the problem of rotation applies only to scans of maps IGN paper, not to the maps coming from the IGN geoportal). See this document of Raymondo.

Converting calibration files

There exists many different formats for map calibration.

Program MAPC2MAPC (£10, windows) can take a wide range of calibration files (MAP, ECW, GeoTIFF, JPR, various CAL,TAB,IMP,GUX,TFW,JPW,PGW calibrations and KMZ and KAP combined files) and image formats and write different outputs, including an osz map archive that can be imported directly into Multiplans. If needed, MAPC2MAPC reprojects the map to Mercator and cuts the image into tiles.

The following information can help to convert manually a calibration file in a format recognized by Multiplans.

Examples of map calibration

Reminder: page Map viewers can generate automatically the calibration file of some mapping web sites.