How to create map with coutours ?

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.

Hi,

I raised -Xmx to -Xmx3074m (my system has 4GB RAM) … in this settings my system was heavily loaded for 4hours … no error message, but also nothing happened … I mean task wasn’t finished, no progress at all.

Some interesting ideas here:
http://article.gmane.org/gmane.comp.gis.openstreetmap.mkgmap.devel/7626/match=coastlinefile

Maybe cut coastlines_planet-latest.osm.pbf file to some smaller containing just for my case important part.
Or generate my own coastline file just from some smaller area.

Any thoughts/suggestions?

regards

mira

You could also try to split the south america abstract from http://download.geofabrik.de/osm/ directly with your splitter areas.list file (I suppose you’ve splitted now Argentina?)

java -Xmx1500m -jar splitter.jar --output=pbf --split-file=areas.list --overlap=3000 south-america.osm.pbf

The idea is that the coastline outside of the countryborders are complete and not broken.

Hi,

I tried split my patagonia.osm file differently
before --max-nodes=450000
now --max-nodes=1500000
This generated just one osm.gz file because patagonia.osm is just 180MB.

Then builded img with my srmt files bring me map without “flooding”

I tried this because I wanted fix some error from mkgmap and this came as nice side effect, not solution in all cases but helped me.

Now I would like improve my map even more.

Are there somewhere hiking TYP and Style files? I need them for inspiration.

Is it possible have also shading for a map?
http://wiki.openstreetmap.org/wiki/Relief_maps
http://wiki.openstreetmap.org/wiki/Hillshading_with_Mapnik

regards

mira

You can search for a hiking map and look further to find their styles (or ask the developer):
http://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/Download

Mkgmap has a few examples to use hiking route relations:
http://www.mkgmap.org.uk/svn/wsvn/mkgmap/resources/styles/

About shading:
http://forum.openstreetmap.org/viewtopic.php?pid=198599#p198599
Better use the Garmin basemap on your gps…

Is it possible convert txt and TYP there and back easily?
I would like to use polygon part which I already did with line and poit parts from other TYP file.
Doing copy/paste on txt file would be easy.

unspecified (0x00) VS english (0x04) ?
I would like to have one-language map (english) … What is better choise for me?

I will go into latter :wink:

mira

A detailed description of TYP files and their underlying text files can be found in the cgpsmapper manual, and they can be compiled with cgpsmapper free. AFAIK TYP files created with cgpsmapper work with mkgmap compiled IMG files.

Yes, you can do it with typ viewer:
http://opheliat.free.fr/michel40/TYPViewer3.5/

Thank you TYPViewer works fine for me.

As I am not still satisfied with contours (lot of holes in srtm for my area) I downloaded data from Aster (they are free for personal usage):

http://asterweb.jpl.nasa.gov/gdem-wist.asp

I got bunch of files …

ASTGTM2_S50W068.zip ASTGTM2_S50W068.zip.xml
ASTGTM2_S50W069.zip ASTGTM2_S50W069.zip.xml
ASTGTM2_S50W070.zip ASTGTM2_S50W070.zip.xml
and so on

each zip file contain tif files:
ASTGTM2_S50W068_dem.tif
ASTGTM2_S50W068_num.tif
README.pdf

Is it possible proceed them to obtain contours? Did I downloaded right data?

regards

mira

I am now trying convert aster data to contour osm by modified perl script contour.pl which get here:
http://gis.638310.n2.nabble.com/contour-map-error-td5183094.html#a5238778

Unfortunately having some java related problem (probably classpath):
Caused by: java.lang.ClassNotFoundException: Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: Main. Program will exit.

maybe somebody here can help me fix this?

BTW: Is it possible to post attachment here? I would like to send here contour.pl script when I finish it.
Maybe someone here can help me tune it better.

regards

mira

Hi,

I just want to inform all who was following this thread that I succeeded to make contour from Aster v2 and Cgiar too.
Cgiar is the far best source of elevation data at the moment ( fixed all anomalies ).

I want to publish here perl script I did for data conversion, maybe they can be useful for someboby, maybe somebody can improve them.


Perl script for converting Aster dem.tif to hgt:

#!/usr/bin/perl -w

while (< *.tif>) {

$tile = $_;
$tile =~ s/dem.tif//;
$tile =~ s/ASTGTM2
//;
$tile =~ m/([SN])(\d+)([EW])(\d+)/;

`gdalwarp -of GTiff -srcnodata 32767  -rcs -order 3 -ts 1201 1201 -multi ASTGTM2_${tile}_dem.tif ${tile}.tif` ;

`gdal_translate -of SRTMHGT ${tile}.tif ${tile}.hgt` ;

`rm ${tile}.tif ${tile}.hgt.aux.xml` ;

}


Perl script for converting cgiar 1 degree tiles to hgt:

#!/usr/bin/perl -w

while (< *.zip>) {
$file_asc = $_;
$file_asc=~ s/.zip//;

unless (-e “${file_asc}.asc”) {unzip $_};
open(READ, “${file_asc}.asc” ) or die $! ;
@lines = ;
close (READ);

  $x = $lines[2];
  $y = $lines[3];

  $x =~ s/xllcorner     //;
  $y =~ s/yllcorner     //;

if ($x > 0 ) {
$lat = “N”;
} else {
$lat = “S”;
}

if ($y > 0 ) {
$lon = “E”;
} else {
$lon = “W”;
}

$rx = sprintf(“%.0f”, $x);
$ry = sprintf(“%.0f”, $y);

$arx = abs $rx ;
$ary = abs $ry ;

$tile = “$lat” . “$ary” . “$lon” . “0” . “$arx” ;

`gdalwarp -of GTiff -rcs -order 3 -ts 1201 1201 -multi ${file_asc}.asc ${tile}.tif` ;

`gdal_translate -of SRTMHGT ${tile}.tif ${tile}.hgt` ;

rm ${file_asc}.asc ;

`rm ${tile}.tif ` ;
`rm ${tile}.hgt.aux.xml ` ;

}

And have you then converted the HGT files to OSM? If so, how?

I am using Srtm2osm.exe program normally to make contours.osm

Srmt2osm.exe program download hgt files from server and store them in srtm/SrtmCache directory.
If these files are alredy in directory program use them instead of downloading them from server.

So I am just put “my_hgt” to srtm/SrtmCache dir and rest workflow is same :wink:

mira

Hi,

while building my map I am getting a lot of errors like this:
SEVERE (RoadNetwork): 63240020.osm.gz: Road (ser, http://www.openstreetmap.org/browse/way/50972288)) contains zero length arc at http://www.openstreetmap.org/?mlat=48.72715&mlon=21.24674&zoom=17

Is it fine to use “–remove-short-arcs” option for mkgmap?
I mean no broken route-ability? No missed details?

mira

Hi

I am building map of Scandinavia now.
Having hgt files from this excellent sites :
http://www.viewfinderpanoramas.org/dem3.html#scand

Problem is that when I build contour.osm file between N55 to N73 and E3 to E33 degrees there are missing tiles in sea.
This cause minimal height -9999m and a lot of extra computing. (not finnished over night)
$ mono Srtm2Osm/Srtm2Osm.exe -large -step 20 -cat 400 200 -bounds1 55.00 3.00 73.00 33

Some workaround/rightworkflow for this?

Is somewhere Srtm2Osm.exe manual page with all possible options?

mira