The solution was actually simple: the lines created by Srtm2Osm had a "contour" tag only, but no "contour_ext" tag. It is necessary to supply the "-cat" option, together with values for major, medium, and minor elevation steps.
I.e. I changed the call to
Srtm2Osm.exe -step 25 -cat 500 100 25 -large
and now things work.

Am 13.02.2018 um 19:38 schrieb Bernhard Hiller:
I was trying to create a map of Taiwan including DEM data and elevation contour lines. The DEM part was easy. But strangely, I cannot get elevation contourlines.

I downloaded hgt data from Viewfinder Panoramas, and placed them into the cache directory of srtm2osm.
I called srtm2osm in a batch file:

SET SRTM=:\Program Files (x86)\OpenStreetMap\Srtm2Osm\Srtm2Osm.exe"
SET OUTPUTDIR=\Maps\Raw\Taiwan.DEM\

%SRTM% -bounds1 21.81 120 23.6 122.1 -o %OUTPUTDIR%TaiwanS.osm
%SRTM% -bounds1 23.59 120 25.4 122.1 -o %OUTPUTDIR%TaiwanN.osm

TaiwanS mearures 1554993 kB, TaiwanN 2249418 kB (I must do it in 2 parts, otherwise the program uses more than 7 GB of RAM and causes lots of paging). Next, I sorted one of the files with osmosis (originally I sorted and merged both of them, and then merged with an extract from Geofabrik; that's what I plan to do when I got things working...):

SET OSMOSIS=:\Program Files (x86)\OpenStreetMap\osmosis-0.46\bin\osmosis.bat"
SET INPUTDIR=\Maps\Raw\Taiwan.DEM\
%OSMOSIS% --read-xml %INPUTDIR%TaiwanS.osm --sort --write-pbf %INPUTDIR%Taiwan_Ele.osm.pbf

The output file measures 16670 kB.
Next, I split it with

SET JAVA=:\Program Files\Java\jre1.8.0_121\bin\java.exe"
SET SPLITTER=:\Program Files (x86)\OpenStreetMap\splitter-r590\splitter.jar"
SET INPUTDIR=\Maps\Raw\Taiwan.DEM\
SET INPUTDATA=iwan_Ele.osm.pbf
SET NAME=ernieMap Bike Taiwan"

%JAVA% -Xmx6G -jar  %SPLITTER% ^
    %INPUTDIR%\%INPUTDATA% ^
    --description=AME% ^
    --max-nodes%00000 ^
    --no-trim ^
    --mapidG120001 ^
    --max-threads=^
    --keep-complete=ue

which creates 3 pbf-files.
Finally, I build the map with

SET JAVA=:\Program Files\Java\jre1.8.0_121\bin\java.exe"
SET MKGMAP=:\Program Files (x86)\OpenStreetMap\mkgmap-r4107\mkgmap.jar"
SET PREPROC=\Data\Projects\Projects.Net2\StylePreProcessor\bin\Debug\StylePreProcessor.exe
SET STYLE=\Maps\Development\Style.Mapnik\Mapnik.Bike
SET DEMPATH=\Maps\Raw\Taiwan.DEM
SET NAME=ernieMap Bike Taiwan"
SET TYP=4712.TYP

%PREPROC% /in=\Maps\Development\Style.Mapnik\Mapnik.Base /out=%STYLE% /defines=KE,THAI
copy E:\Maps\Development\Style.Mapnik\%TYP% %TYP%
copy "C:\Program Files (x86)\OpenStreetMap\GMT\gmt.exe" gmt.exe
gmt.exe -wy 4712 %TYP%

%JAVA% -Xmx6G -ea -jar %MKGMAP% ^
    --style-file=TYLE% ^
    --family-name�rnieMapTaiwan ^
    --family-id712 ^
    --product-id=^
     --description=AME% ^
    --series-name=AME% ^
    --name-tag-list=me:en,int_name,name ^
    --latin1 ^
    --add-pois-to-areas ^
    --route ^
    --location-autofill=unds,nearest ^
    --preserve-element-order ^
    --draw-priority% ^
    --index ^
    --nsis ^
    --show-profiles=^
 --generate-sea=ltipolygon,extend-sea-sectors,floodblocker ^
    --max-jobs=^
    --dem-poly=eas.poly ^
    --x-dem=EMPATH% ^
 --x-dem-dists314,4000,6000,8000,10000,15000,20000,30000 ^
    --gmapsupp 4*.osm.pbf ^
    %TYP%

move gmapsupp.img E:\Maps\Use\Taiwan.IMG

which creates an IMG file of 18798 kB.
It is recognized by my Oregon 600.
In the demo mode, I navigate to a waypoint (Luigui, 22.99573 N, 120.63496 E). I expect to see a map of contourlines only. But I get a completely white map. Elevation from DEM is 250m directly adjacent to the waypoint, and other sensible values nearby.

The style file contains:
contour=evation & contour_ext=elevation_major & (ele > 0 | ele < 0) { name '${ele|conv:m=t}'; } [0x20 level 4] contour=evation & contour_ext=elevation_medium & (ele > 0 | ele < 0) { name '${ele|conv:m=t}'; } [0x21 level 2] contour=evation & contour_ext=elevation_minor & (ele > 0 | ele < 0) { name '${ele|conv:m=t}'; } [0x22 level 0]

The TYP file (created and compiled with MapTk) contains:
[Polyline]
Type=20
String=Höhenlinie
String=Elevation
Color=0x000000
Line
[END]

[Polyline]
Type=21
String=Höhenlinie
String=Elevation
Linewidth=
Color=00x000000
[END]

[Polyline]
Type=22
String=Höhenlinie
String=Elevation
Linewidth=
Color=00x000000
[END]
which should cause black elevation contour lines.

What do I do wrong?

Thanks a lot for your hints.

Kind regards,
Bernhard


_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to