OSM Composer/Manual

From OpenStreetMap Wiki
Jump to: navigation, search
Help
Available languages
Deutsch English

Manual page for OSM Composer up to Version 0.60

Contents

Basic Usage

Regions

Each regions is a rectangular area. The coordinates are the same as used in the slippy map/Export feature. The easiest way to enter a region is copying a permalink URL into the bottom URL field and pressing the "Parsen" button.

Maximum region size

Experiments with different region sizes have shown that Composer V0.51 with VM setting -Xmx1600M can handle a region of about 1°x1° and input files of up to 200MB OSM data safely. Anything above this is likely to produce out-of-memory problems. In my experiment the limiting factor was srtm2osm, which crashed generating a 2°x2° area. For a detailed hiking map, the contour lines are necessary, so I guess this is about as large as a region can get. The answer beyond that is defining multiple regions which will be combined into a single map anyway (only if both are active at the same time). Since v.0.52 srtm2osm gets called with parameter --large. Now the limiting factor should in theory be mkgmap. So about 550MB of contourlines in osm format, OR about 300MB of OSM data should be processable (whichever the greater) (this depends on your mkgmap rules, the more tags you include, the smaller). About 1024 MB must be set in java memory request setting, so that mkgmap doesn't crash on creating the map.

Main Window

The buttons above the region list offer shortcuts to the most important lists in Composer. The drop down box allows you to focus your work on one type of map object. When you press the buttons "Gerät" or "Umsetzungsregeln", the lists will not show all items but only those of the selected type. The options are


Settings

Generating maps

MapSource Integration

Composer can prepare map data so that it works with Garmin MapSource. This can be enabled in the Settings. The data files are generated by mkgamp and cgpsmapper.

To add the generated map into MapSource, Composer generates a .reg file with all required entries and installs them into the registry. You can look up the .reg file in the working directory.

MapSource must be closed while Composer works. If it is running you will get a warning message and generation will not start.

The overview map created by the current version of mkgmap is faulty at the moment. Composer renames and patches the files to make them work with MapSource, but they might look differently when created manually on the command line.

To uninstall the map, simply disable MapSource integration in the settings, upon the next generation run the entries will be removed from the registry.

Once the registry entries are in place, MapSource requires the map data to be present. If one of the files is missing, e.g. due to a problem in the generation process, MapSource may crash upon startup. This can be repaired by

Garmin device upload

Composer calls sendmap20 to generate the final map.

Customizing maps

Ignore list

There is an ignore list of tags that are not useful for rendering and are removed by Composer for faster processing, smaller data size and more readable statistics. If you need to process one of these tags, contact me to take it out of the ignore list. Currently the following tags are removed:

"created_by", "source", "note", "opengeodb", "admin_level", "is_in", "addr", "todo", "population", "onkz", "url", "comment", "converted_by", "history"

TYP files

The list "Gerät/TYP" contains all objects displayable on the Garmin device and their IDs. It defines the available building blocks and is the basis for all rule editing and customizing. It is very helpful to enter a description of what the object means and/or how it is displayed here as this text will be shown to select and handle the object. Optionally you can define a custom layout for each item that will be compiled into a typ file to accompany the map. The objects to be used need to be marked as visible "Anzeigen". The unused state is useful to mark items that cannot be used/modified on the device (e.g. the predefined map background) or obsolete items during a rework.

You can use this in two ways.

Creating a TYP file

Composer contains a TYP file editor. The button "Gerät/TYP" opens a list of all map objects defined for the device. Every object needs to listed here. It is possible, but not required to customize the design. Composer generates a TYP definition file from all entries with custom design, compiles it with cgpsmapper and includes it with your map.

There are the following possible customizations:

See the documentation of cgpsmapper for details and limitations of the TYP definitions. Currently Composer supports only one colour set (day colours). If you are using a topo map at night odds are that you are in trouble and the colours of your GPS are the least of your worries. :-) (once 3byte Polyline/Polygon support is added to mkgmap, the limitation for ways and filled ways will be the same as the ones for POIs. Some garmin maps like Topo Germany V2 use this already. 3byte definitions will ONLY show up on map if used with typfile.

No TYP file / External TYP file

If you don't want to use a TYP file or you already have an external TYP file, you can use this list to indicate if and how the various Garmin objects are being rendered. This will help you in getting an overview of what your mkgmap rules are doing.

You can use the test map of mkgmap to check what your device can render and enter a description of the line or icon in "Ansicht". Check "Anzeigen" to indicate the feature is usable in mkgamp mapping rules.

mkgmap rules

Predefined rules

Please note that Composer just adds as a dumb compiler shell in this case. You will not be able to use the internal map conversions and the route support as they depend on adding additional mkgmap rules.

Importing rules

The application comes with some demonstration files I use to create a map for hiking/trail riding. You can start your own work from these or import some other .csv files, e.g. the default files included with mkgmap in the /resources directory. If your map-features.csv uses a custom TYP file, it is recommended that you import a matching file like garmin_feature_list.csv first with "Garmin Objekte importieren" so Composer knows what objects are defined for your device. This will replace the list in "Gerät/Typ". You can import your map-features.csv (or any other working mkgmap rule file) with "Kartenumsetzung importieren". This will replacethe list "Abbildung" and you can work on it with the editor.

Editing rules

If you want to customize the layout of the maps for your needs or for your device, I recommend that you use Composer's editor for managing the mapping rule files used by mkgmap. Composer will generate a new customMapping.csv file from the editor data and use it to compile the map.

The Button "Abbildung" opens a list of all defined tags for points, ways and area ways and the target device objects assigned for visualizing them. Design the map you want here. If an entry is shown in red after generating a map, this means that the assigned target device item is marked as unusable or missing and you need to look for an alternative.

Instead of assigning Garmin objects to rules in the drop down box, you can also select the Object in the list Gerät and select "Use in rule" from the context menu. If the rule dialog is open, the drop down box will be set to use the selected object. This is often faster than browsing the drop down list.

The order of the rules is important. Mkgmap will use the first matching rule and ignore all others. You can display the list in different sort orders, but it will always be generated in its fixed order as shown when your first open it. You can change the position of an entry in the list by moving it up and down with the cursor keys:

Replacements

The "Ersetzung" button opens a list of replacements. OSMap Composer parses the data after downloading or reading it from an input file. The replacements are performed on the OSM data before saving it. This means that the data has to be downloaded/read again in order to see changes done to anything in "Ersetzung".

You can specify one or two tags to check. If you select two, both conditions must be met. The value of the tag is checked using Java regular expressions. If you just want a text comparison, simply enter your text. If you want to do a more complex comparison, you can use the full power of the regex syntax.

For example the condition

oneway=yes|true

would find both correctly and mistagged dead end roads.

If it finds one of the tags listed, it executes a replacement action:

If there are several matching rules for one way, all of them are executed in the order shown in the list. You can change the order by moving rules up and down with Ctrl-Up and Ctrl-Down. If you check "danach abbrechen" no further rules are executed on a way if the current rule did match the tags.

Limitations of available IDs

Notice however that as long as mkgmap doesn't support 3-byte typfile support there is quite a strict restriction on the number of different polylines that you can incorporate into your map. If you use "Outline erzeuge" you have to options: Either you overlay an existing way over it, like railroad tracks (this should still be easy to identify then, wheter the condition is met or if it's a genuine railroad, OR you can copy it to a new Polylines style. While the first option doesn't reduce your limited polylines (0x00 to 0x2b are acceptable values in hexadecimal for Mapsource, while 0x2c to 0x3b will ONLY show up on your unit (tested on Vista HCx) but not in Mapsource (valid for version 6.13.7). 0x17 doesn't show up for me at all, while 0x20 to 0x25 is reserved to contourlines/depth lines and also not freely configurable. For Polygons basicaly the same applies but the all Polygons up to 0x5f show up in Mapsource and 0x4b is the map background and therfore not freely configurable. For POI the possibilities are much larger as 3byte support is already implemented. POI classified wrongly will however show up in wrong categories when searching for features. Therefore including new things as POI into the map that aren't standard for garmin maps, i.e. wlan hotspots) a good category has to be assigned (fitting would for example other/communications). I don't know wheter/how it's possible to defines ones own categories for the search function.

Routes

Composer can process route relations (tagged as type=route) and mark them in a map. You can set a filter in settings what routes your are interested in. The default is hiking routes (route=foot). The setting is a regular expression, so you can specify multiple route types e.g. "foot|bicycle".

Composer will read the description of all matching rules from the OSM data and display them in the route list. Entries contained in the last generation run are shown in black, older entries are in gray and newly found entries are in green. As the OSM data contains no useful information on how to render a route, you need to configure this in the route list and set the "active" checkbox to make the route appear on the map.

There are several ways to mark a route:

After setting up/changing routes you will have to run the map update again, as the changes are done directly in the OSM data.

During generation, Composer evaluates how many meters of this route are in the processed data. It will also show its findings in the statistics.txt. Note that this number can be much smaller if your regions show only a subset of the total extent of the route.

Statistics

Composer runs some statistics on used and unused tags. The statistics are written in the file Statistics.txt after generation.

In additon to the global ignore list, the following tags are not counted in the statistics:

"name", "ref", "int_ref", "layer"

Levels - Problem with Contourlines below Polygons in Mapsource

See here until a definite solution is implemented: Talk:OSM_Composer#mkgmap_--levels

General

Data handling

List handling

In every list in Composer, you have the following tools available:

Changing the list layout

Filtering

Change one data value for several entries simultaneously

Editing

In a list you have the following keyboard shortcuts

There is an entry in the right-click menu for each operation.

In an editing dialog

Logging

There is a log that notes down some details on what Composer is doing. You can call up the log with the menu "Datei/Log". If there is an error or exception detected, the log will popup by itself and show the problem in red.

Do not increase the log level above the default setting, the additional info is internal and will not help you in understanding what Composer is doing.

There is also a file "commands.log" produced in every generation run. It contains all external command line calls for debugging or re-using them manually.


Troubleshooting

Composer runs a complex generation process with many external tools and variables. Things may go wrong, especially until all surroundings are configured properly. Here's some hints on how to find out what's going on.

How to start working if you already have a map-features.csv list and a typfile

Personal tools
Namespaces
Variants
Actions
site
Toolbox