Contour lines

Contour lines

I wanted to make my own contour maps for my Garmin eTrex Vista HCx GPS using data from the Shuttle Radar Topography Mission. I tried using dem2topo, but because I got an out of memory error, I searched an utility to split GeoTIFF files. I found one in the Geospatial Data Abstraction Library (GDAL). In this way I discovered that there is a GDAL utility to make contour maps too. This utility produces shapefiles, but fortunately GPSMapEdit can import shapefiles and export the Polish Map files that cGPSmapper requires.

To make things easier I wrote software to automate the complete process. The software takes a GeoTIFF file as input, splits it into smaller tiles, generates contours, simplifies contours, converts shapefiles into Polish Map files and calls cGPSmapper for the conversion to Garmin format. This makes it very easy to make contour maps, even for inexperienced users. I am sharing this software here under the GNU General Public License.

To make your own contour map, follow these steps:

  1. Download and unzip Tif2mp
  2. Download and install Microsoft .NET Framework 3.5
  3. Download and install FWTools
  4. Download and unzip cGPSmapper
  5. Download and unzip MapSetToolKit
  6. Download and unzip pre-processed data of your choice from CGIAR-CSI or ASTER
  7. Start Tiff2mp (double click the .exe file)
  8. Select the unzipped .tif file
  9. Select the cGPSmapper executable
  10. Select the ‘Convert!’ button and have patience
  11. Create a directory to install the map into (usually C:\Garmin\…)
  12. Start MapSetToolKit (double click the .exe file)
  13. Select ‘Select IMG’ and select the folder where you unzipped the GeoTIFF file
  14. Highlight the .img file and select the ‘Add –>’ button
  15. Select the ‘…’ button after ‘Mapset directory’ and select the install directory
  16. Type a ‘Mapset name’
  17. Type a ‘Family ID’
  18. Select ‘cgpsmapper/cpreview folder’ and select the correct directory
  19. Check ‘Install in MapSource’
  20. Select  the ‘START’ button
  21. Start MapSource, select the new map and transfer it like usual

The generated maps will have five levels, one for minor, intermediate and major contour lines, one with a single POI in the middle of the map with the id of the map and one empty level.

The default settings should be okay for most uses, but it is possible to alter the contour intervals and associated zoom levels. It is also possible to adjust in how many parts the GeoTIFF will be split. The default value is 5×5, which results in 25 tiles of 1° (about 100 km2). Furthermore it is possible to adjust the simplify accuracy of the Ramer-Douglas-Peucker algorithm. The default value will be set to half of the minor contour interval. You can easily check what the result of the simplification process is, by making a map again with the simplification accuracy set to zero and ‘Depth contours’ checked (this results in another colour contour lines). Open one of the maps in GPSMapEdit and add the other one to see the differences.

Tif2mp was written using Microsoft Visual Studio 2008 in the C# language. You can download the entire project here.

Comments, corrections and remarks are very welcome, also if you just succeeded making your own map.

Change log

Version 1.6

  • Added multiple select for batch conversion
  • Changed way identifiers are generated

Version 1.5

  • Added option to override/specify tile size
  • Modified zoom levels

Version 1.4

  • Added support for ASTER data

Version 1.3

  • Changed ‘GDAL Tools’ into ‘FWTools’
  • Increased all zoom levels by one

Version 1.2

  • Workaround WPF scroll bug
  • Added ‘Current tile’

Version 1.1

Version 1.0

  • Initial version
VN:F [1.8.5_1061]
Rating: 0 (from 0 votes)

Geonames Turkey

Geonames Turkey

I have been figuring out how to make custom Garmin maps using the names from geonames.org for use on my Garmin eTrex Vista HCx GPS. This is useful for areas for which no Garmin maps exist.

I couldn’t find any software to convert the data, so I wrote my own software. I am sharing the software here under the GNU General Public License.

To make your own places map, follow these steps:

  1. Download and unzip Gn2mp
  2. Download and install Microsoft .NET Framework 3.5
  3. Download and unzip cGPSmapper (a version that supports indexing)
  4. Download and unzip MapSetToolKit
  5. Download and unzip names of your choice from geonames.org
  6. Start Gn2mp (double click the .exe file)
  7. Select the unzipped geonames text file
  8. Select the cGPSmapper executable
  9. Select the ‘Convert!’ button and have patience
  10. Create a directory to install the map into (usually C:\Garmin\…)
  11. Start MapSetToolKit (double click the .exe file)
  12. Select ‘Select IMG’ and select the folder where you unzipped the geonames text file
  13. Highlight the .img file and select the ‘Add –>’ button
  14. Select the ‘…’ button after ‘Mapset directory’ and select the install directory
  15. Type a ‘Mapset name’
  16. Type a ‘Family ID’ (don’t use product codes, else indexing want work!)
  17. Be sure ‘CodePage’ is 1252
  18. Select ‘cgpsmapper/cpreview folder’ and select the correct directory
  19. Check ‘Install in MapSource’
  20. Select  the ‘START’ button and have some more patience
  21. Start MapSource, select the new map and transfer it like usual

The generated map is a POI only map and has two levels. The bigger places (marked administrative or capital) are on the second level. The default zoom levels should be okay for most cases.

Even if you don’t select the cGPSmapper executable, Gn2mp generates an intermediate .mp file. This file can conveniently be edited by GPSMapEdit. In this way you can add more information to the map (for example VMap0 data) or edit the zoom levels.

If your trial period has been expired and you don’t want to buy cGPSmapper, you can compile your maps online in Mapcenter2.

The provided file geonames.map translates the feature codes of geonames.org to Garmin object types (see the user manual of cGPSmapper, section 12.3.1). Gn2mp will show unmapped features in the messages box. Unmapped features are by default mapped as miscellaneous points (0×0700) with the feature code appended to the name (separated by a dash). If you add to or correct geonames.map, please let me know, so I can update it. The feature map is originally based on the information here.

Indexing works, but ‘Find Address’ on my GPS does not (‘Find Cities’ and other functions do work). If you know how to make ‘Find Address’ working, please let me know. This seems to be called global indexing.

To check if a map id (family id) is in use, check this list.

Gn2mp was written using Microsoft Visual Studio 2008 in the C# language. You can download the project here.

Comments, corrections and remarks are very welcome, also if you just succeeded making your own map.

Change log

Version 1.2

  • Workaround WPF scroll bug

Version 1.1

  • DOS window removed
  • cGPSmapper runs at lower priority
  • GUI layout improved

Version 1.0

  • Initial version
VN:F [1.8.5_1061]
Rating: 0 (from 0 votes)

Voor de reis naar Marokko had ik mijn trouwe Garmin eTrex Euro GPS meegenomen met de bedoeling om de afgelegde weg zichtbaar te maken met behulp van Google Maps. Dit is aardig gelukt, maar het had nog leuker geweest als ik meer gegevens dan de locatie van de kampen had kunnen verzamelen. Vooral voor het nauwkeuriger bepalen van de plaats waar de foto’s zijn genomen. Na het toevoegen van geografische informatie aan foto’s, wat geotagging wordt genoemd, kan de plaats van de foto’s in de vorm van kleine miniaturen ook met behulp van Google Maps zichtbaar worden gemaakt.

Het grootste probleem is dat mijn Garmin GPS teveel batterijen nodig heeft om continu aan te staan. Ik had mij dus voorgenomen om uit te kijken naar een betere GPS. Ik ontdekte dat er inmiddels speciale appraatjes voor geotagging op de markt zijn gekomen. Na enige vergelijken, heb ik de GiSTEQ PhotoTrackr Lite uitgezocht en besteld bij Snel’s WebShop. Voordelen boven mijn Garmin GPS zijn:

  • Er is slechts één penlite nodig die meer dan 22 uur zou moeten meegaan (mede dankzij een trilsensor)
  • Het appraatje is klein (73,35 x 33,2 x 31,2 mm) en licht (slechts 67 gram inclusief batterij)
  • De ontvanger is veel gevoeliger en zal dus ook in moeilijkere omstandigheden werken (bv in een bos)
  • Er wordt prima Windows software voor geotagging meegeleverd

Een nadeel is dat het apparaatje niet waterdicht is.

Het downloaden en converteren van de gegevens onder Ubuntu lukt prima met iTU4l. Geotagging onder Ubuntu kan bijvoorbeeld met GPSCorrelate of met Geotag. Trips zichtbaar maken kan ook online met GPS Visualizer. Downloaden en geotagging werkt ook zonder problemen op mijn Eee PC 700 onder Ubuntu.

Veel informatie over geotagging vind je op het Tweakers.net forum ‘Geotaggen: Waar ben jij geweest, en waar nam je je foto’s?‘.

Download, convert to GPX, merge tracks, geotag:

iTU4l.pl -a -e -o xxx.sr
sr2x.pl -i p gpx xxx.sr
gpsbabel -i gpx -f xxx.gpx -xtrack,merge,title="yyy" -o gpx -F yyy.gpx
gpscorrelate-gui

To simplify (merged) tracks (documentation):

gpsbabel -i gpx -f xxx.gpx -xsimplify,error=0.025k -o gpx -F yyy.gpx
VN:F [1.8.5_1061]
Rating: 0 (from 0 votes)
Bear