If you want to create your own contourline maps, here is a quick overview about the process I used – attention this is an advanced topic and will require you to install quite a lot of software – if you want to get contourlines for a large country (say Norway or France) I advise using x64 systems because on x86 systems you will run out of RAM – I will not provide a German translation here – because if you don't understand it in english, you are unlikely to succeed (all the required programs need basic command of English language).
When I compiled the contourlines osmconvert and srtm2osmsegmenter didn't exist yet – I will eventually update my contourlines using the approach described in 6b – for right now (december 2011) you can get better results yourself if you follow this guide and do everything correct. I did however by hand correct most of the errors – so maybe at some places your results will also be worse…
1. Get the coordinates of the left lower (south-west) edge and right upper edge (north-east). The easiest way to get hold of them is to put waypoints with Mapsource. To get the correct format go to preferences in Mapsource, tab position and use Grid: Lat/Lon hddd.dddddd°, datum as always WGS 84.
2. Transform the coordinates for srtm2osm. N47.41502 E11.02737 has to be changed to 47.41502 11.02737, S47.41502 W11.02737 becomes -47.41502 -11.02737.
3. Get srtm2osm from here: http://wiki.openstreetmap.org/wiki/Srtm2Osm and install it.
4. Srtm2osm downloads the needed *.hgt DEM information automatically from Nasa to subfolder srtm/srtmcache if not specified differently. Nasa data is however not very good in mountaineous regions. On viewfinderpanoramas.org you can get much better DEM data. Head over there and download all availble 3" DEM for the region you need (you know the coordinaties from step 2). Place them into subfolder srtm/srtmcache of you srtm2osm installation (create theese folders if they don't exist). Srtm2osm will not download DEM from NASA SRTM if we have placed other data to srtmcache beforehand.
5. Call up srtm2osm with the following command (if you don't know where to input this command, I recommend you stop reading here because you will not get far):
srtm2osm.exe -bounds1 57.71690 4.01368 71.19163 31.14427 -cat 400 100 -large -corrxy 0.0005 0.0006 -o no.srtm.osm
- bounds1 57.71690 4.01368 is the lower left edge, 71.19163 31.14427 is the upper right edge
-cat 400 100 specifies the interval for medium and major contourlines to 400 (major) 100 (medium).
-large is needed because big areas will otherwise make you run out of memory instantly.
-corrxy 0.0005 0.0006 is the correction factor I used because the SRTM data seems to be mal aligned/transformed to WGS 84.
-o specifies output file.
This above command would give you osm contourlines for Norway. You would need about 6GB of RAM to run it without swapping. The smaller the region, the fewer mountains – the easier the RAM requirements are.
6a) Quick and dirty… (see 6b for better possibility) .Optional - If you want to cut the contourlines around some given shape, i.e. a country boundary instead of the square you got from above, you need to parse the file with osmosis. Install java sdk and osmosis (attention, this is not easy, best do it on Linux systems because with Windows it's messy) and run the following command:
java -Xmx1500M -jar osmosis.jar –read-xml enableDateParsing=no file="no.srtm.osm" –bounding-polygon file="norway.poly" –write-xml file="nocut.osm"
-Xmx1500M specifies that you give 1500 MB of RAM to osmosis.
file=* specifies your file from step 5.
–bounding-polygon specifies your boundary polygon. Geofabrik lists the boundary polygons they use here: http://download.geofabrik.de/readme.html so I advise you to use the same data.
Note that around the boundaries you are likely to get artefacts because osmosis does not close the contourlines at the boundary – it seems to be a bug that exists since a very long time. The option "completeWays" is not working as expected.
6b) Instead of osmosis use first srt2mosmsegmenter and then osmconvert. This way you omit to get artefacts on tile borders. See also here for instructions: Howto_render_Garmin_countour_layers_with_no_artefacts
7. Split the resulting file (either from step 5 or 6) with mkgmap splitter with the following command (note you need to have Java SDK installed):
–cache=folder (you have to create this subfolder in mkgmap directory) is given to speed up splitting if we notice that the maxnodes are to high.
–max-nodes=* specify the tile size. if 7500000 gives you "not enough space in .img" in step 8 you need to reduce this.
–mapid=%mapid% here functions as a placeholder for a 4 digit number. I advise you to use the %mapid% of the resulting openmtbmap country plus 1000. so for norway this would be 74010000
–mixed has to be given when splitting the output from srtm2osm.
Step 7 is not needed for very small areas – e.g. the Netherlands.
%country%*.osm specifies the input file (output file from step 5 or 6)
8. Run mkgmap on the resulting output files of step 7. (again Java SDK needs to be installed).
–max-jobs=1 is given to restrict mkgmap to use only one CPU core. Calculate that you need up to 3GB of available RAM per Core if you want to increase here (you could decrease the max-nodes in step 7 if you get "out of memory" error here.
–mapname should be higher by 1000 in comparison to the tiles that you need the contourlines for. If this is lower, the contourlines will be displayed behind the maps in Mapsource – hence only visible on GPS.
–style-file=srtm get my srtm style-file from here and put it into mkgmap folder.
9. Optional – If you want to delete the worst artefacts from step 5, you can do so with gpsmapedit, save the corrected files to .mp (polish map) format and recompile with mkgmap
Hello,
Is there a way to add contourlines to the maps when using QLandkarte? I googled the subject but didn’t find a way (or I still don’t know enough about maps etcetera). I bought a Garmin Map CsX60 about 1 month ago. What a fantastic work is OpenStreetmap and OpenMTB map! Keep up the good work. I made a small financial contribution to this project.
Best regards
Anton
Well if you’re using windows you can run the batch files and use the newly created files. On unix you best install mkgmap and create the tdb/overview_map/search_index with mkgmap (you can look up the syntax inside the batchfiles)
Using contourlines….
I have put all maps and contour files in one folde and am able to run the scripts provided by the openmtbmaps such that I can see the contour lines in Mapsource.
I now want to change the srtm*TYP file, which I remaned to wide*.TYP first, using
http://ati.land.cz/gps/typdecomp/editor.cgi
For “Forest” I wanted to change the background color to green insted of white transparent. However, when I do that the green backgroudn is presente on top of the contour lines which consequently are not visible anymore in the “forest ” areas of the map. How do I make the green background transparent or in other words, how do I plot the contour lines ON TOP of the changed green Forst areas ?
With your indications I might be able to better understand how the editor really works.
With kind regards,
1. The editor is not correct. Use maptk instead.
2. the reason for transparent forest is to see the contourlines, if you make forest green, then contourlines are drawn behind in Mapsource, hence invisible.
So, auf dem GPS Gerät bekomme ich jetzt alles richtig angezeigt. Bei Mapsource aber immer
noch nicht. Ich bekomme zwar die Höhenlinien und Karten angezeigt, aber eben nur getrennt.
Und wenn ich es hinbekomme das ich beides in einer Karte vereine, sind die Farben der Karte
nie richtig, obwohl ich die Files von der Karte zu den SRTM-Files hinzu kopiere und damit
doch auch die richtigen Typ-Files haben sollte. Erzeuge ich die Karte einzeln stimmen
die Farben ja auch. (Wald=grün und nicht weiß) Da komme ich nicht weiter. Any Ideas?
MfG ratorst
Das kannst du nur loesen in dem du alle .img Kacheln mit mkgmap neu renderst (vorher mit gpsmapedit als polish map abspeichern). Dann sind sie mit Kartendaten die maximal 28 Tage neuer sind als der Zeitpunkt des neurenderns sichtbar – dann muss man wieder neu kompilieren (also .mp nicht weghaun).
Mit Höhenlinien neu berechnen kann ich nicht viel anfangen, und wenn ich Typfile 3 wähle bekomme ich die Höhenlinien angezeigt, die Farben der Karten stimmt aber nicht mehr.
(wald ist z.B. weiss) Als Anfänger kann man an diesen kleinen Stolperfallen ganz schön verzweifeln und eine Fehlersuche gestaltet sich recht schwer.
MfG ratorst
Hallo,
ich habe versucht die Höhenlinien unter Mapsource einzubinden. Es läuft alles fehlerfrei durch aber die Höhlenlinien werden nicht angezeigt, die Höhenzahlen aber schon. Any Ideas?
MfG ratorst
Typfile 3 waehlen oder Hoehenlinien neu berechnen