README - release notes and information about the ctrn-osm-gps map

********************** 2014-03-20 - spring version

Here's a new version, updated with the latest OSM data. Apart from the OSM
update, the map is unchanged.

********************** 2013-11-11 - fine-tuning

A lot of trial and error was spent on finding a good way to display spot heights.
All versions now use the extended type 0x010303, with no TYP file entry. This
displays well on all devices tested.

The copyright messages had to be made more terse inorder to fit on various
splash screens; every effort was made to attribute both the Regione Piemonte
and openstreetmap.

********************** 2013-10-24 - added mapsource version

I have added code to produce a mapsource version of the map. This version uses
install and uninstall routines made with gmt. The mapsource version differs
from the GPS hand unit version insofar as it uses a single FID for all subimages.
This version is intended for use in mapsource and basecamp, it is not intended
that the map installed in mapsource is installed on the GPS unit. The mapsource
version also runs on qlandkartegt. To load it with qlgt, you have to first
load the tdb file and then the mapset.img file.

The finished data are now put into the folder 'etrex'. The mapsource version
is generated into a subdirectory of the etrex folder called 'split', whereas
the gmapsupp.img for the GPS hand unit is in the etrex folder itself.

A lot of work inside this package is now done using gmaptool.

Note that the download address for OSM data from for the Piedmont
has changed; has been changed appropriately.

Further changes were mostly about the copyright and license information; all
subimages are now passed license information, using mkgmap's --license-file
parameter. The tdb file produced by gmt did not use the copyright information
introduced to the subimages by mkgmap's --copyright-message parameter, so I had
to resort to patching the tdb file for the mapsource version using a python script
( which is now inside the dev package. This is an ad-hoc approach and
not very sophisticated, but it's necessary since the copyright has to be accessible
in mapsource, basecamp and qlandkartegt for the map to be acceptable to all
entities contributing data.

Please note that I currently use mkgmap version 2760 and mkgmap 08159. 

********************** 2013-08-31 - now using gmaptool

I built the map today with gmaptool, using the linux version gmt v0.8.159.746b.
The use of gmt was introduced because it's convenient ability to patch
the FID in TYP files, which is used to create variants of the master
TYP file which only differ by FID. These variants are now used for the
different layers of the map. gmt is available from

it's under CC-BY-SA license:

gmt v0.8.159.746b  CC BY-SA (C) 2011-2013 AP

It's a good tool to work on garmin image files and I've decided to
use it in the project's script files from now on. It's also very fast :)

********************** 2013-07-20 - updated OSM data, minor edits

Apart from the OSM update I modified the composition of the final gmapsupp.img
slightly, now avoiding the patching of the family ID and instead using the
product ID to differentiate layers. This is cleaner and more transparent; the
patching script has been removed.

There was also a minor addition to the map content: I added ferry lines.

********************** 2013-07-13 - updated OSM data

The OSM data in the map were updated to a download from which became
available today. I have put the file 'introduction.txt' into the zip file
for download as well, and full text copies of all the licenses involved:

ODBL for OSM data
CC-BY-2.5 it for CTRN data
CC-BY-NC-SA for the finished map

********************** 2013-07-11 - minor edits and refactoring

I have pulled the functionality of the extract_... scripts into
and removed the old scripts from the dev package. So now the CTRN licensee is
put in in, just look for [licenziatario]. I have also combined all
linear data from the CTRN (except for contours) into a single layer; what used
to be two sets of tiles (66* and 88*) is now in one set, 66**.

The final joining of the map in '' is now done slightly differently:
All sets of tiles receive a separate 'family id' and the TYP file is replicated
into several versions which only differ in family id. This improves handling
of the map on the GPS device.

********************** 2013-07-03 - dev package now public and online

I have published the development package for the CTRN-OSM-GPS map yesterday.
This package is meant to be used on a Linux system. The map-generating scripts
are bash scripts and everything was done on Kubuntu 12.04. The scripts *may*
run under other operating systems, but I assume they would have to be modified.

There are still some rough edges, but it should not be too hard to figure out
how to emulate my work. If you make your own map with this development package,
please make sure to put your own name into the copyright messages (particularly
in scripts/extract_area), respect the original licenses for the CTRN and OSM
data - and don't forget to give me credit for the original authorship where
appropriate. I have tried to put proper licensing information wherever it was
feasible. My intention is to make the map development package accessible for
everyone freely and I've licensed the scripts under GPLv3. I don't want to see
my work being exploited commercially.

The most important script is, which is also commented well to
explain what it does: it converts the original CTRN data into garmin .img
format. will download and convert OSM data for the Piedmont, and will put it all together into the final gmapsupp.img.

There are various additional scripts and data in the sub-folders of this
package, some are not directly used for the map (like the QGIS style files) but
are nice to have when working on the CTRN data.

The intended way of using the package is by cloning the mercurial repository;
this will recreate the whole package with all sub-folders on the target system.
Just follow the instructions from the bitbucket page to clone the repo to your
machine. For now I am the only person who can modify the data in the repo. Since
mercurial is a tool for software developers, you may not be familiar with it;
basic operations are simple, though. cloning is a one-liner, and updating to the
latest stage by issuing the commands 'hg pull' and 'hg up' is also simple

Please note that this package does not contain any map data! If you want to
process the original CTRN data yourself - for example if you want to apply
different styles to them - you have to download them separately from and adapt the path in I have not included a
mechanism for doing so. OSM data will be automatically downloaded from
when you use

There is also a section on technical details in 'introduction.txt' which may be

********************** 2013-06-22 - updated version available

I have made an updated version today. This version has been built with a recent
download of OSM data from to contain features added since the last
release. Using the Piemonte section file, there is now less content
outside the piemontese borders, because this section file is already cut to the
piemontese borders, instead of being a rectangular section as with my previous
data source. The download size is now a bit smaller. This is the file I used:

and geofabrik given as source in the original README below is now no longer

I have also slightly modified the map display to improve readability on the GPS
device. The trails are now displayed two pixels wide, as I found the one-pixel
display too hard to recognize. I've also made the colour for forest a bit
lighter, also to improve visibility. There were some other minor changes -
mainly adding field descriptions.

To use the map with my etrex vista hcx, I make a folder 'garmin' on the
micro-SD-card and copy the gmapsupp.img into it. Apparently, on other devices,
the name doesn't have to be gmapsupp.img and it can be put alongside other maps,
the maps then can be changed from the GPS device's UI. 

********************** original README from 2012:

The gmapsupp.img in this zip file is a compilation of the CTRN (carta tecnica
regionale numerica) of the Piedmont region, and OSM data. It is a map intended
for those who require great detail and precise topography. It is less suited for
gaining an overview, and quite probably useless for navigating in a car.

The map is a prototype, or, in other words, it's 'beta'. I am offering it for
evaluation and testing. There is no warranty that the map is accurate or useful.

The CTRN data were downloaded from

The dataset I processed is the 'CTRN vettoriale 1:10.000 (1991-2005) - singole
sezioni (CC-BY)', all metadata and the 780 individual sections can be found at
this website.

They are under a CC-BY license:

- see the attached file CTRN_licenzaCC25BY.pdf.

I combined groups of up to 16 individual segments of the CTRN into larger
shapefiles to reduce the number of files to process, since I was experiencing
problems further down the line to work with very large numbers of source files.
The aggregation was performed using ogr2ogr.

To create a garmin map from the data, the shapefiles have been processed with, a python script converting ogr conformant geodata to OSM format. The
resulting OSM-format files were processed with dedicated styles (written by
myself) into garmin .img files using mkgmap.

OSM data for the Piemonte have been retrieved from

- a rectangular section covering roughly the Piedmont has been cut from a
reasonably recent Italy image. OSM data are under Open Database License, see:

OSM data have been processed with a style derived from the 'default' style in
the mkgmap package. Only linear and point features are used, since all polygon
information is taken from the CTRN.

The individual img files have been combined using mkgmap, using a TYP file of my
own design. The point symbols specified in the TYP file for the CTRN symbols are
derived from the symbology given in Manuale_CTR.pdf. They are mainly black on a
white background. Few OSM POIs are specified in the TYP file used for the OSM
data, instead the map relies on the GPS device's default representation as
specified by the 'default' style. I did add some POI symbols relevant for
outdoor activities, and some where I found the default representation lacking.

The resulting map has some advantages and some drawbacks which I would like to
point out:
    topographically accurate due to use of CTRN data
    great detail and good contours
    duplicate representation of features which occur both in CTRN and OSM
    toponomastic information from CTRN isn't feature-bound
    potentially out-of-date where only CTRN data are available
I have tested the map in the field and found it useful, but this may be due to
my specific focus, which is reflected in the map design: I do trekking, and I
map for OSM. My main objectives in using the GPS map are:
    being able to determine if the GPS-generated position is correct by
    cross-referencing it with map features (esp. buildings, roads and streams)
    altimeter calibration, which is why I have included all spot heights
    recognizing small-scale variations in terrain, which is why I have put in
    10m contours
    discovering trails which are no longer used (the CTRN material contains some
    old ways which are now hard to find in the field, and may contain trails
    which are copied from inaccurate maps)
    retracing my steps (which are on OSM)
    spotting inaccuracies in either map - if duplicate features don't line up,
    one or both maps are inaccurate and a double-check at the location should be
    done. If they do line up, the chance that both are accurate is quite good.

I'd like to say more about the toponomastic features in the CTRN. The original
format of the CTRN was a CAD format. All place names were encoded as (bits of)
text at certain positions, with a specific font, size, angle etc.. This is fine
as long as the map is only rendered by the CAD software for a specific
resolution, but in a vector map one would rather attach the toponyms to the
objects they refer to and have the displaying device place the text. To do this
transfer is way beyond my capacity, as it would mean manually editing every
feature in question. I have included the toponomastic information by setting
named invisible POIs where the original map displayed the text. This results in
the toponyms looking at times displaced. To make these toponyms distinguishable
from text resulting from OSM tags, I have colored them red. I find that most of
the time (and at the resolution the map is best suited for) it's quite obvious
what the toponyms refer to. At any rate, this information is very valuable to
have, as the CTRN has many toponyms one doesn't find on newer or less detailed
maps, so I chose to incorporate them regardless of the problem.

The map is currently less suited for gaining an overview - there is too much in
it, and the hierarchy of feature display is as of yet not too well developed. I
also find that I cannot differentiate well between zoom levels which are
relevant to a map with so much small-scale detail; resolution 24 covers too many
different zoom levels for my taste. On my etrex vista hcx I experienced
occasional problems with the drawing order of the various map components - at
times OSM linear features would appear on top of icons. This is not deliberate,
I just haven't found a way to avoid it.

When looking at a split-up version of the map with qlandkartegt, the POIs which
rely on the default symbols the GPS unit provides are only shown as dots with
confusing text. I haven't investigated the matter much - on my GPS all POIs show

I release the GPS map (the combined work) under CC-BY-NC-SA license, see

For attribution purposes, my (the author's) name is Kay F. Jahnke.

I apologize for any mistakes resulting from my insufficient grasp of the italian
language; the texts accompanying the CTRN are at times exceedingly technical,
and the terminology forced my to do intelligent guesswork at times.

I'd like to thank the Regione Piemonte for releasing the CTRN for reuse, and
also for clarifying some points I was unsure about. I'd also like to thank the
OSM project for providing their data - and the makers of the tools without which
this project would have been impossible, specifically ogr2osm and mkgmap. I'd
like to thank the Open Source Geospatial Foundation, specifically for GDAL
(Geospatial Data Abstraction Library). I'd also like to thank the Quantum GIS
project, as QGIS has been extremely valuable to me in analyzing and visualizing
the CTRN data when I first got hold of them.

All work was done on a Kubuntu 12.4 system.