GroundTruth For Dummies

From OpenStreetMap Wiki
Jump to navigation Jump to search

This page contains basic instructions on how to use GroundTruth mapmaking tool.

Quick Installation Instructions

Windows

  1. You need to have Microsoft .NET 3.5 or later (available here) installed on your computer in order to run GroundTruth.
  2. Download the latest version of GroundTruth...
  3. Unzip the package somewhere on your disk.
  4. Download the latest free version of cgpsmapper from http://www.cgpsmapper.com (download the "exe only" zip file).
  5. Unzip the cgpsmapper ZIP file to the same directory where you unzipped GroundTruth files.
  6. If you want to be able to upload maps directly to the GPS unit, also download free SendMap tool from the same site.
  7. Unzip the SendMap ZIP file to the same directory where you unzipped GroundTruth files.

Linux

UPDATE: GroundTruth version 1.0.28.0 (and above) seems to be working on Linux (I haven't done extensive testing, but it works on my OpenSUSE virtual machine). You need to have Mono installed (instead of .NET, of course). Also, you have to use -nonwin command line option. --Breki 17:40, 29 January 2009 (UTC)

It also seems to work on my Kubuntu 8.10. Don't forget to make GroundTruth.sh and cgpsmapper-static executable! Thomas 23:37, 15 February 2009 (UTC)

Mac OS

cgpsmapper didn't run under Mac OS (yet). If you find a way contact me, please. --railrun 19:29, 13 March 2009 (UTC)

Downloading OSM Data

  1. Visit OSM Web map (http://www.openstreetmap.org/)
  2. Move to the area of your choice so that the area you want to cover fills the whole map view. Please do not select a too big an area because it could result in a large quantity of data being downloaded from the OSM server - this could take a long time. There are other ways to cover large areas, please visit GroundTruth Manual for more info.
  3. Click on the "Permalink" on the bottom right corner of the map.
  4. The browser should now display an URL like http://www.openstreetmap.org/?lat=46.4953&lon=15.5392&zoom=12&layers=B000FTF.
  5. Copy this URL to the clipboard.
  6. Open a command line window and go to the GroundTruth's directory.
  7. Execute the following command: (replace url from clipboard with the URL from your clipboard
    groundtruth getdata --bu "url from clipboard"
    
  8. This will download the OSM vector data for your area. Here's an example of GroundTruth's output for my area:
groundtruth getdata -bu="http://www.openstreetmap.org/?lat=46.4951&lon=15.5395&zoom=12&layers=B000FTF"

GroundTruth v1.0.0.0 by Igor Brejc
Generates Garmin maps from OpenStreetMap data
Visit http://wiki.openstreetmap.org/wiki/GroundTruth for more info

Finished downloading data (5.7 MB)
Saved to file output.osm

Now you have the OSM data you need to generate the Garmin map from.

Exporting OSM data directly from the browser

You can also export OSM vector data directly from the browser by selecting the Export tab once you have zoomed in to a map area of your choice.


Generating Maps

  1. Execute the following command:
    groundtruth makemap
    
  2. This is the output for my map area:
GroundTruth v1.0.0.0 by Igor Brejc
Generates Garmin maps from OpenStreetMap data
Visit http://wiki.openstreetmap.org/wiki/GroundTruth for more info

Generate map polish files
Fetching rendering rules from 'Rules\DefaultRules.txt'...
Fetching standard Garmin types dictionary from 'Rules\DefaultRules.txt'...
Fetching character conversion table from 'Rules\DefaultRules.txt'...
Scanning OSM data...
Loading OSM file 'output.osm'...
Hardware levels used: 7
Polyline types used: 14
Polygon types used: 6
Generating polish map file...
---------------------
Map content statistics (by rendering rules):

Rule 'Marsh': 1 features generated
Rule 'Forest': 155 features generated
Rule 'Farm': 147 features generated
Rule 'Fell': 48 features generated
Rule 'Residential': 20 features generated
Rule 'Water': 9 features generated
Rule 'PathMinor': 37 features generated
Rule 'PathMajor': 415 features generated
Rule 'TrackMajor': 171 features generated
Rule 'TrackMinor': 192 features generated
Rule 'Trailblazed': 167 features generated
Rule 'RoadHighZoom': 466 features generated
Rule 'RoadMiddleZoom': 466 features generated
Rule 'RoadLowZoom': 54 features generated
Rule 'Railway': 0 features generated
Rule 'CableCar': 1 features generated
Rule 'AerialwaysMinor': 12 features generated
Rule 'River': 1 features generated
Rule 'Stream': 100 features generated
Rule 'Ditch': 5 features generated
Rule 'NationalBorder': 0 features generated
Rule 'NationalPark': 1 features generated
Rule 'City': 1 features generated
Rule 'Town': 1 features generated
Rule 'Village': 25 features generated
Rule 'Locality': 0 features generated
Rule 'PlaceOfWorship': 5 features generated
Rule 'Peak': 8 features generated
Rule 'ParkingNode': 25 features generated
Rule 'GuestHouse': 5 features generated
Rule 'TodoContinue': 187 features generated
Rule 'TodoJunction': 140 features generated
---------------------
Generate polish TYP file
Generate TYP file
Generate map IMG files
Generate preview polish file
Generate preview map and TDB files
Generate map list file for SendMap
Copy product files to the output directory
Generate MapSource registry file
Want to create a hiking map?

If you want to create a hiking map instead of the driving one, simply tell the GroundTruth to use different rendering rules:

groundtruth makemap -rules="http://wiki.openstreetmap.org/wiki/GroundTruth_Hiking_Map"

In this case it will download latest rules from the OSM Wiki. You can also use rules stored on your disk:

groundtruth makemap -rules=Rules\HikingMapRules.txt


Results

The map files will be stored in the Maps subdirectory. This is the list of the generated files:

File name Description
1.img preview map (used by MapSource)
1.reg Windows registry file for registering your maps to MapSource
1.tdb MapSource index file
1.typ TYP file containing custom map styles (used both by the GPS unit and MapSource)
12345678.img the actual Garmin map of your area
filelist_1.txt a list of files (can be used to upload the map to the unit using SendMap)

Uploading Maps To The GPS Unit

You can upload generated maps in several ways, here I'll describe the two commonest approaches.

Directly From The Command Line

This can be done by adding the -upload option when generating maps:

groundtruth makemap -upload

NOTES:

  1. This will delete all previous maps you had on your unit (except those which are hard-coded with the unit)!
  2. You need to have SendMap executable in the same directory as GroundTruth in order for the above command to work.

Importing Into MapSource

You can import the generated maps into MapSource by executing the registry file (see more in GroundTruth_Manual#Installing_In_MapSource) which was one of the files generated by GroundTruth. After that you can upload maps using the MapSource uploading feature.

The advantage of this approach is that you can upload several different (unrelated) map products at once.

Generating Maps With Relief Contours

GroundTruthContours Overview.png
GroundTruthContours Detail.png

GroundTruth can generate contour maps using SRTM elevation data (see examples on the right). The process consists of two steps:

  1. Generating contours from the elevation data
  2. Generating Garmin maps with contours

Generating Contours From The Elevation Data

Similarly to steps in #Downloading OSM Data, the easiest way is to find the OSM map URL for the area you want to generate contours for. Then execute the following command: (replace url from clipboard with the URL from your clipboard

groundtruth contours --bu="url from clipboard"

This will generate the contour data for your area. Here's an example of GroundTruth's output for my area:

groundtruth contours --bu="http://www.openstreetmap.org/?lat=46.4951&lon=15.5395&zoom=12&layers=B000FTF"

The contours data will be saved to "output.ibf" file. Now go to the next step...

Generating Garmin Maps With Contours

  1. Execute the following command:
    groundtruth makemap -ibf=output.ibf
    

This will generate contours for the area you specified. Depending on the size of the area, this can take from few seconds to eternity ;). After the maps have been generated, read the #Results subsection above on how to use these maps.

Generating OSM Files With Contours

After generating contours, they can be converted to OSM files (this is what Srtm2Osm used to do, but now it has been superseded):

groundtruth ibf2osm

This will use the generated output.ibf and create several Contours*.OSM files in the Output directory.

See also