How to create map with coutours ?

Hi,

I have data.osm file 107 MB and srtm.osm file for same area 2.2 GB.
Can somebody advice me how to merge them in one garmin map on linux?
osmosis , splitter , mkgmap

I am mainly confused how to split them right way for mkgmap and missing knowledge about args and TYP files.

thank you for help

mira

A very comprehensive guide about splitting, mkgmap and typ files can be found at http://www.cferrero.net/maps/maps_index.html
On my website you can find a step by step description how to combine osm data with contour lines: http://sites.google.com/site/openfietsmap/procedure

Thank you for links,
I already checked you sites before :wink: first link is very nice, all information on one place … very helpful!

Now I am trying split my srtm.osm file (4.1 GB) and having some troubles, any advice for me how to fix this.

$ java -Xmx2500m -jar splitter-r180/splitter.jar --max-nodes=900000 --description=Patagonia --mapid=63250001 --mixed --output=xml srtm.osm
[snip]
Processing srtm.osm
Exception in thread “main” java.lang.IndexOutOfBoundsException: Index (31250001) is greater than or equal to list size (31250001)
at it.unimi.dsi.fastutil.objects.ObjectArrayList.get(ObjectArrayList.java:258)
at uk.me.parabola.splitter.SparseInt2ShortMapInline.put(SparseInt2ShortMapInline.java:128)
at uk.me.parabola.splitter.SparseInt2ShortMultiMap$Inner.put(SparseInt2ShortMultiMap.java:81)
at uk.me.parabola.splitter.SparseInt2ShortMultiMap.put(SparseInt2ShortMultiMap.java:31)
at uk.me.parabola.splitter.SplitProcessor.writeNode(SplitProcessor.java:209)
at uk.me.parabola.splitter.SplitProcessor.processNode(SplitProcessor.java:118)
at uk.me.parabola.splitter.OSMParser.endElement(OSMParser.java:243)
at uk.me.parabola.splitter.AbstractXppParser.parse(AbstractXppParser.java:57)
at uk.me.parabola.splitter.Main.processMap(Main.java:412)
at uk.me.parabola.splitter.Main.writeAreas(Main.java:368)
at uk.me.parabola.splitter.Main.split(Main.java:190)
at uk.me.parabola.splitter.Main.start(Main.java:118)
at uk.me.parabola.splitter.Main.main(Main.java:107)
[snip]

EDIT 1
I found this:
http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2011q3/012049.html
Just trying 1.8 (no ext) version of Srtm2Osm … So I will see soon

EDIT2
works with older Srtm2Osm
topo.openstreetmap.de/Srtm2Osm-1.8.14.10.zip

regards

mira

Hi,

Now I have both maps (osm and srtm) ready and splitted.
osm map 63240001.osm.gz
srmt map 63250001-63250074.osm.gz

I tryied to merge them in gmapsupp.img by mkgmap (merged manually template.args and area.list).
$ java -ea -Xmx2500m -jar mkgmap-r2049/mkgmap.jar --gmapsupp --route --style-file=GPS-hiking -c template.args hiking.TYP

resulting gmapsupp.img has just 6.7 MB and no contours.

Any advice?

regards

mira

Depends how your template.args looks, it might help to use higher tile numbers for your contours, and maybe put them last on the list?

That’s what I did:

You can set the family id for the map

family-id: 5000
product-id: 1

Following is a list of map tiles. Add a suitable description

for each one.

mapname: 63240001
description: Patagonia
input-file: 63240001.osm.gz

mapname: 63250001
description: Patagonia
input-file: 63250001.osm.gz

mapname: 63250002
description: Patagonia
input-file: 63250002.osm.gz

mapname: 63250003
description: Patagonia
input-file: 63250003.osm.gz

mapname: 63250004
description: Patagonia
input-file: 63250004.osm.gz

mapname: 63250005
description: Patagonia
input-file: 63250005.osm.gz

and so on …

And similar in areas file:

List of areas

Generated Sun Oct 23 06:52:25 CEST 2011

63240001: -2617344,-3526656 to -2326528,-3014656

: -56.162109,-75.673828 to -49.921875,-64.687500

63250001: -2437120,-3502080 to -2412544,-3469312

: -52.294922,-75.146484 to -51.767578,-74.443359

63250002: -2412544,-3411968 to -2392064,-3346432

: -51.767578,-73.212891 to -51.328125,-71.806641

63250003: -2433024,-3424256 to -2412544,-3403776

: -52.207031,-73.476563 to -51.767578,-73.037109

63250004: -2367488,-3436544 to -2355200,-3407872

: -50.800781,-73.740234 to -50.537109,-73.125000

and so on …

I found some more magics here:
http://thebird.nl/tutorials/osm_garmin.html

java -Xmx1500m -ea -jar mkgmap-r1543/mkgmap.jar’
mkgmap --gmapsupp
–family-id=10010
–product-id=1
–family-name=Cycle
–index
–draw-priority=25
–style-file=cycle.zip 10010.TYP
data.osm
–family-id=10011
–product-id=1
–family-name=contours
–draw-priority=28
–transparent
srtm.osm

I didn’t tried yet … I will in evening
Can you comment on this dfferent switchers/family ID for both maps?

I also didn’t check in device yet … just in software (qlandkarte).
I am surprised that over 4GB boiled down to 7MB and TOPO Czech map has 80MB for much smaller area.

regards

mira

I cant see anything wrong in your args file.
About the different family ID’s, thats not necessary, in my older versions I used different ID’s for the contour maps to make it selectable in the GPS but this caused to a lot confusion for the users (thay wondered why there were two maps installed?) so I dropped it later. I also dont use transparent anymore.
4GB is the whole world extract I suppose? I think Patagonia is so empty in OSM that 7mb is all you need.

Hi ligfietser,

I was using style and TYP from Charlie Ferrero, I tried style and TYP file from your sites and it is working now :slight_smile: Hooray!
I still have some artifacts in contours probably cause these errors during building img.

$ java -ea -Xmx2500m -jar mkgmap-r2049/mkgmap.jar --gmapsupp --route --style-file=fiets -c template.args fiets-2.TYP
SEVERE (RoadNetwork): 63240001.osm.gz: Road (Avenida Independencia (Y-580), http://www.openstreetmap.org/browse/way/122279427)) contains zero length arc at http://www.openstreetmap.org/?mlat=-53.15874&mlon=-70.98833&zoom=17
SEVERE (Polyline): 63240001.osm.gz: Problem writing line (class uk.me.parabola.imgfmt.app.trergn.Polyline) of type 0x1e containing 2 points and starting at http://www.openstreetmap.org/?mlat=-52.41036&mlon=-68.40350&zoom=17
SEVERE (Polyline): 63240001.osm.gz: Subdivision shift is 1 and its centre is at http://www.openstreetmap.org/?mlat=-53.45080&mlon=-66.79752&zoom=17
SEVERE (Polyline): 63240001.osm.gz: deltaLong = -37422
SEVERE (Polyline): 63240001.osm.gz: Problem writing line (class uk.me.parabola.imgfmt.app.trergn.Polyline) of type 0x1e containing 2 points and starting at http://www.openstreetmap.org/?mlat=-52.41039&mlon=-68.40350&zoom=17
SEVERE (Polyline): 63240001.osm.gz: Subdivision shift is 0 and its centre is at http://www.openstreetmap.org/?mlat=-53.45080&mlon=-66.79752&zoom=17
SEVERE (Polyline): 63240001.osm.gz: deltaLat = 48487
SEVERE (MapSplitter): 63250026.osm.gz: Area too small to split at http://www.openstreetmap.org/?mlat=-50.56535&mlon=-73.35082&zoom=17 (reduce the density of points, length of lines, etc.)
SEVERE (MapSplitter): 63250026.osm.gz: Area too small to split at http://www.openstreetmap.org/?mlat=-50.56535&mlon=-73.35082&zoom=17 (reduce the density of points, length of lines, etc.)
SEVERE (MapSplitter): 63250026.osm.gz: Area too small to split at http://www.openstreetmap.org/?mlat=-50.56535&mlon=-73.35082&zoom=17 (reduce the density of points, length of lines, etc.)
[split]

There are small places on the map which looks like not drawn properly (I mean contours, looks like small empty spots) usually in some very rocky areas.
Any Idea how to fix them?

Aha … that makes sense to me now … my software showed also two maps.

No, just srtm.osm was 4.1GB
$ mono Srtm2Osm/Srtm2Osm.exe -large -step 20 -cat 25 5 -bounds1 -56.17 -75.64 -50.0 -64.7
You are right Patagonia is very empty compare to Europe, but anyway I have now about 220MB img file.

I very like your style of maps (very neat) , I will try just add some more details to nature are areas (because I need them for hiking), urban areas looks great.
Only problem is that I don’t have sea colored in blue … just white space there … hmm

regards

mira

I’m glad it all worked out. Those artefacts on rocky areas are an issue that comes with the srtm, you can’t do anything about it.
Maybe use another source (Aster data) but I don’t know how ‘open’ that data is. If the map is only for your own use maybe they allow it to use. The sea Ihave rendered with the mkgmap option:

generate-sea: extend-sea-sectors,close-gaps=6000,floodblocker,land-tag=natural=background

natural=background is in my polygons file [0x010100 resolution 14]

The sea is natural=sea [0x32 resolution 14]

In the typ file you can set the draw order for the sea 1 and 0x010100 at 2, residential areas at 3 and the rest 4 and higher.

You can also use the general world routable styles that are still in development:
http://code.google.com/p/mkgmap-style-sheets/source/browse/#svn%2Ftrunk%2Fstyles%2Fworld-test
http://code.google.com/p/mkgmap-style-sheets/source/browse/#svn%2Ftrunk%2Ftyp%2Fworld-test
http://code.google.com/p/mkgmap-style-sheets/downloads/list

Yeah, I haven’t bothered with contours for a while and have updated my style and TYP a lot, so it may well not work properly.

Hi,

I found a lot of info in one place on yours pages … thank you :wink:

mira

That’s work here :slight_smile:

If I understand right it works like a sandwich … upper covering lower … Is it right?

I will definitely chech them.

My img file now rises in size to 330MB and my device became quite sluggish.
The reason can be in size of file itself or because of drawing too much contours all the time.
I have three type of contours and would like to set different resolutions for them to not be displayed all the time, but only in appropriate resolution.

lines file
contour=elevation & contour_ext=elevation_minor
{ name ‘${ele|conv:m=>ft}’; }
[0x20 resolution 23]
contour=elevation & contour_ext=elevation_medium
{ name ‘${ele|conv:m=>ft}’; }
[0x21 resolution 21]
contour=elevation & contour_ext=elevation_major
{ name ‘${ele|conv:m=>ft}’; }
[0x22 resolution 17]
contour=elevation | contour_ext=elevation
{ name ‘${ele|conv:m=>ft}’; }
[0x21 resolution 20]

Any hint here? I don’t understand mainly 4th entry. :frowning:

regards

mira

The last line is catching any elevation lines that haven’t been caught by the previous rules, but it looks a little odd to me.

I removed 4th entry totaly:

contour=elevation & contour_ext=elevation_minor
{ name ‘${ele|conv:m=>ft}’; }
[0x20 resolution 24]
contour=elevation & contour_ext=elevation_medium
{ name ‘${ele|conv:m=>ft}’; }
[0x21 resolution 23]
contour=elevation & contour_ext=elevation_major
{ name ‘${ele|conv:m=>ft}’; }
[0x22 resolution 19]

It still looks like contours appears/disappear in same moment when changing resolution (no difference).
And more over … I have brown dotted line for elevation_minor 0x20, brown full 1 pixel line for elevation_medium 0x21 and black full 1 pixel line for elevation_major 0x22
But all contour are displayed same way … full black line.

BTW what is range of values for resolution?

mira

The values for the resolution are set in the option style file:
http://www.mkgmap.org.uk/svn/wsvn/mkgmap/resources/styles/default/options

In the default mkgmap settings are
levels = 0:24, 1:22, 2:20, 3:18, 4:16

By coincidence today I discovered a glitch in mine,
levels = 0:24, 1:23, 3:22, 4:21, 5:20, 6:18, 7:16 but it should be
levels = 0:24, 1:23, 2:22, 3:21, 4:20, 5:18, 6:16

Maybe this is also the reason why they dont respond as expected in your map, because my settings differ from the default mkgmap settings. The colours are set in the typ file btw, so you can play with them too to make it appear the way you want.

Hi,

I solved problem with contours … my fault :confused:
before: $ mono Srtm2Osm/Srtm2Osm.exe -large -step 20 -cat 20 10 -bounds1 -56.17 -75.64 -50.0 -64.7
now: $ mono Srtm2Osm/Srtm2Osm.exe -large -step 20 -cat 400 200 -bounds1 -56.17 -75.64 -50.0 -64.7

“cat” values are not multipliers of “step” value !

All contour has been handled like major :confused:

Now I would like to solve problem with sea … In some areas sea is “flooding” land.
It is happen on the edge of the map and it looks like it is “flooding” from this edge not from costline.

I am using these options to generate sea:
–generate-sea=extend-sea-sectors,close-gaps=6000,floodblocker,land-tag=natural=background

what about these options, might help?
polygons
no-sea-sectors

regards

mira

Ah, the flooding problem…therefore you need another trick :wink:
The generate sea option is ok, you will have to download an extra set of coastlines, because in your extract the seacoast is incomplete.
See http://www.mail-archive.com/mkgmap-dev@lists.mkgmap.org.uk/msg10351.html

Download the coastlines_planet-latest.osm.pbf from http://fabianowski.eu/osm/coastlines/
In your mkgmap options --coastlinefile=coastlines_planet-latest.osm.pbf

This might help, otherwise the coastline could be broken somewhere inside the map and you need to fix it first.
Btw it improves the looks of the map too, because it shows more coastline & land outside the map

Hi,

Havinig some errors here with --coastlinefile option:

java.lang.OutOfMemoryError: Java heap space
at java.util.HashMap.addEntry(HashMap.java:753)
at java.util.HashMap.put(HashMap.java:385)
at uk.me.parabola.mkgmap.reader.osm.ElementSaver.addPoint(ElementSaver.java:111)
at uk.me.parabola.mkgmap.reader.osm.bin.OsmBinHandler$BinParser.parseDense(OsmBinHandler.java:101)
at crosby.binary.BinaryParser.parse(BinaryParser.java:105)
at crosby.binary.BinaryParser.handleBlock(BinaryParser.java:50)
at crosby.binary.file.FileBlock.process(FileBlock.java:109)
at crosby.binary.file.BlockInputStream.process(BlockInputStream.java:15)
at uk.me.parabola.mkgmap.reader.osm.bin.OsmBinMapDataSource.load(OsmBinMapDataSource.java:61)
at uk.me.parabola.mkgmap.reader.osm.CoastlineFileLoader.loadFromFile(CoastlineFileLoader.java:90)
at uk.me.parabola.mkgmap.reader.osm.CoastlineFileLoader.loadFile(CoastlineFileLoader.java:119)
at uk.me.parabola.mkgmap.reader.osm.CoastlineFileLoader.loadCoastlinesImpl(CoastlineFileLoader.java:133)
at uk.me.parabola.mkgmap.reader.osm.CoastlineFileLoader.loadCoastlines(CoastlineFileLoader.java:79)
at uk.me.parabola.mkgmap.reader.osm.SeaGenerator.init(SeaGenerator.java:134)
at uk.me.parabola.mkgmap.reader.osm.OsmMapDataSource.pluginChain(OsmMapDataSource.java:162)
at uk.me.parabola.mkgmap.reader.osm.OsmMapDataSource.setupHandler(OsmMapDataSource.java:130)
at uk.me.parabola.mkgmap.reader.osm.xml.Osm5MapDataSource.load(Osm5MapDataSource.java:69)
at uk.me.parabola.mkgmap.main.MapMaker.loadFromFile(MapMaker.java:144)
at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:56)
at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:222)
at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:219)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

How to fix this?

regards

mira

I think you have to ask this on the mkgmap mailing list, this is getting too complicated :wink:
Out of memory, maybe helps setting java xms or xmx settings lower or higher?

java -Xms1500m -Xmx1500m -ea -jar etc

Yep, the -Xmx option should do it. The units are in megabytes (sort of) so you can’t set it higher than your actual RAM.