MapIt!
-> Deutsch
   

Installing Data

In principle, MapIt! works with arbitrary raster data which can be split into one or more tiles. MapIt! can also work with raster maps for multiple resolutions. To be able to switch between different zoom levels for the same region and to mark objects on the map, MapIt! needs information about the transformation from world-coordinates (e.g. UTM) to the pixel coordinates of the raster data.

This document describes the conventions used by early versions of MapIt!. It is likely that there will be changes in the future. In particular, the formats of the files that describe the raster data and the objects should be redesigned.

Directory Structure of the Raster Data

MapIt! expects all raster data under a specific directory which is configurable with the variable tile_dir in mapconfig.py. The directory examples/simple/tiles in the MapIt! archive has the appropriate structure.

Under tiles/ is one subdirectory for each available zoom level. The directory names are the corresponding scales. In the current version the names have to be numbers because MapIt! needs them to sort the scales correctly.

In one such scale-specific directory are the tile files in a standard raster format. Formats that work well here are PNG and BMP. The tiles have file names of the form <x>x<y>.<ext>. <x> and <y> are the indices and <ext> is the file name extension of the fie format. Which extension MapIt! actually uses can be configured with the variable tile_ext in mapconfig.py.

Furthermore there's file named info in each scale specific directory. Its format is best described with an example:

2000
2000
# [1,1]
457367411.900
580137962.900
460754078.567
583524629.567
# [1,2]
457367411.900
583524629.567
460754078.567
586911296.233

The first two lines are the width and height of the individual tiles in pixels. After that there's a block for each tile. Such a block starts with the line marked with a hash (#) character and the two numbers in that line are the indices of the tile that are also used in its file name (the second tile in the example has the filename 1x2.png). The following four numbers are the coordinates of the lower left and upper right corners of the tile.

For good results, it is necessary that tiles don't overlap and that the tiles for different scales cover the same are in world coordinates, otherwise there may be some undesired effects. A userfriendly solution of this problem is planned.

Objects and Markers

To be able to mark objects on the map, MapIt! needs information about the objects (their position and name) and marker symbols that are pasted into the generated raster map.

The description of the objects in the sample data set is in the file data/simple/markerdefs. Which file MapIt! actually uses is defined in mapconfig.py with the variable marker_locations.

The markerdefs file is a text file with line oriented format. Empty lines and lines starting with a hash (#) are ignored. The other lines contain either object or group definitions.

A group is defined with a line starting with the keyword "group:", followed by four comma separated values. For example (the examples here are in German because the example data is in German at the moment):

group: db,bahnhof,http://bahnhof/,Bahnhöfe
The first value is the name of the symbol to use. The filename of the symbol image is built from the values of the configuration variables marker_dir (the directory) and marker_ext (file name extension). A good file format for the symbol images is PNG because it can contain transparency information.

The second value is the identifier of the group. This identifier has to be unique and should only contain characters that can be used in URLs and HTML without quoting (even though MapIt! treats them properly).

The third parameter is a URL to be used in the client side image map for all markers of the group that don't define their own URL. The URL may be empty.

The fourth value is the label of the group. It is used in the list box where the user can select which objects to show in the map. This label doesn't have to be unique, although several objects and groups with the same label will be confusing for the user.

Only the first three commas are significant, so that the label may contain commas without special quoting.

An object is defined by a line with six comma separated values. For example:

      458862396.00,583250959.00,db,bahnhof,http://bahnhof/,Berlin-Hermsdorf

The first two values are the coordinates of the object. The two following values have the same meaning as the symbol name and identifier of a group. If the identifier of an object is the same as the identifier of a previously defined group, the object is associated with that group. Otherwise the identifier is only used for that object. The last two values are again a URL and the label used in the HTML-page.

If a marker contained in group does not define a URL, i.e. if the field is empty, the URL of the group is used, if the group has a URL associated with it.

Only the first five commas are significant, so that the label may contain commas without special quoting.

   

MapIt!

Examples
Herne
Europa
City Map Berlin (a)
City Map Berlin (b)
City of Geyer (extern, german)

Download

Installation

»Installing Data

FAQ

Mailing-Lists

CVS

 
 
last modified:
Bernhard Herzog <bh@intevation.de>