Re: [mkgmap-dev] max-jobs patch

2018-02-13 Thread Steve Ratcliffe

Hi Mike


I could take out that bit of code, which is just determining how
much physical memory is installed, so that mkgmap won't suggest that the
user increases the available heap too much. It isn't used in determining a
value for maxjobs.


Since it is just used for an informational message, you could just
surround it with a try/catch block.  Then if it doesn't
exist on a particular it isn't a problem when using the
downloaded pre-compiled distribution.

Of course it would fail to compile on such a platform, but then
hopefully someone will let us know and we can decide what to do then.

Steve
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


[mkgmap-dev] Commit r4112: Further constraint on auto block size algorithm

2018-02-13 Thread svn commit
Version mkgmap-r4112 was committed by steve on Tue, 13 Feb 2018

Further constraint on auto block size algorithm

Must ensure that the header fit within 240 blocks.

Bug lead to file corruption for a range of file sizes.


http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap=4112
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] max-jobs patch

2018-02-13 Thread Mike Baggaley
Hi Gerd,

I would expect the code to work on a MAC, because com.sun.management is part
of the JDK, and defines the interface by which specific platforms can
provide subinterfaces with further information (AFAIK there is only one for
UNIX). However, I don't have a MAC, so can't test it on there. If it is a
problem, I could take out that bit of code, which is just determining how
much physical memory is installed, so that mkgmap won't suggest that the
user increases the available heap too much. It isn't used in determining a
value for maxjobs.

Regards,
Mike

-Original Message-
From: Gerd Petermann [mailto:gpetermann_muenc...@hotmail.com] 
Sent: 10 February 2018 15:45
To: mkgmap-dev@lists.mkgmap.org.uk
Subject: Re: [mkgmap-dev] max-jobs patch

Hi Mike,

I've compiled r4107 with your patch:
http://files.mkgmap.org.uk/download/418/mkgmap.jar

I did not yet try it because I am still fighting with the crash in
MapSource.

I am not sure if the usage of classes like
com.sun.management.OperatingSystemMXBean
are supported with openjdk? Will this also work on a Mac?

Gerd




--
Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html


___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Creating a map with contour lines and DEM

2018-02-13 Thread franco_bez
the easiest way to create a contourlines map is   phyghtmap
  

this tool is for creating osm Files containing the contourlines.

In a second step you build the Garmin map with mkgmap

like this:

phyghtmap --start-node-id=1  -start-way-id=1 --max-nodes-per-tile=100 
--max-nodes-per-way=250  --jobs=4  --o5m --no-zero-contour -s 50 -c 500,100 
hgt_files/*.hgt

java  -jar mkgmap.jar --keep-going --max-jobs  --read-config=options
--style-file=contourlines_style --mapname=65188001
--description=contourlines --family-name=Contourlines --draw-priority=16
--gmapsupp *.o5m


options file:
levels = 0:24, 1:23, 2:22, 3:21, 4:20, 5:18, 6:17, 7:16
reduce-point-density=20
transparent
latin1

Ciao,
  Franco




--
Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Strange error in mkgmap

2018-02-13 Thread franco_bez
Hi Steve and Andrzej,

now it works as intended again.

Thanks for the fix :-)

Ciao,
  Franco



--
Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


[mkgmap-dev] Creating a map with contour lines and DEM

2018-02-13 Thread 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="C:\Program Files (x86)\OpenStreetMap\Srtm2Osm\Srtm2Osm.exe"
SET OUTPUTDIR=E:\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="C:\Program Files 
(x86)\OpenStreetMap\osmosis-0.46\bin\osmosis.bat"

SET INPUTDIR=E:\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="C:\Program Files\Java\jre1.8.0_121\bin\java.exe"
SET SPLITTER="C:\Program Files 
(x86)\OpenStreetMap\splitter-r590\splitter.jar"

SET INPUTDIR=E:\Maps\Raw\Taiwan.DEM\
SET INPUTDATA=Taiwan_Ele.osm.pbf
SET NAME="BernieMap Bike Taiwan"

%JAVA% -Xmx6G -jar  %SPLITTER% ^
%INPUTDIR%\%INPUTDATA% ^
--description=%NAME% ^
--max-nodes=250 ^
--no-trim ^
--mapid=47120001 ^
--max-threads=4 ^
--keep-complete=true

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

SET JAVA="C:\Program Files\Java\jre1.8.0_121\bin\java.exe"
SET MKGMAP="C:\Program Files (x86)\OpenStreetMap\mkgmap-r4107\mkgmap.jar"
SET 
PREPROC=E:\Data\Projects\Projects.Net2\StylePreProcessor\bin\Debug\StylePreProcessor.exe

SET STYLE=E:\Maps\Development\Style.Mapnik\Mapnik.Bike
SET DEMPATH=E:\Maps\Raw\Taiwan.DEM
SET NAME="BernieMap Bike Taiwan"
SET TYP=M04712.TYP

%PREPROC% /in=E:\Maps\Development\Style.Mapnik\Mapnik.Base /out=%STYLE% 
/defines=BIKE,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=%STYLE% ^
--family-name=BernieMapTaiwan ^
--family-id=04712 ^
--product-id=1 ^
 --description=%NAME% ^
--series-name=%NAME% ^
--name-tag-list=name:en,int_name,name ^
--latin1 ^
--add-pois-to-areas ^
--route ^
--location-autofill=bounds,nearest ^
--preserve-element-order ^
--draw-priority=25 ^
--index ^
--nsis ^
--show-profiles=1 ^
 --generate-sea=multipolygon,extend-sea-sectors,floodblocker ^
--max-jobs=4 ^
--dem-poly=areas.poly ^
--x-dem=%DEMPATH% ^
 --x-dem-dists=3314,4000,6000,8000,1,15000,2,3 ^
--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=elevation & contour_ext=elevation_major & (ele > 0 | ele < 
0) { name '${ele|conv:m=>ft}'; }   [0x20 level 4]
contour=elevation & contour_ext=elevation_medium & (ele > 0 | ele < 
0){ name '${ele|conv:m=>ft}'; }   [0x21 level 2]
contour=elevation & contour_ext=elevation_minor & (ele > 0 | ele < 
0) { name '${ele|conv:m=>ft}'; }   [0x22 level 0]


The TYP file (created and compiled with MapTk) contains:
[Polyline]
Type=0x20
String=0,Höhenlinie
String=4,Elevation
Color=0,0x00
Line=00..00
[END]

[Polyline]
Type=0x21
String=0,Höhenlinie
String=4,Elevation
Linewidth=1
Color=0,0x00
[END]

[Polyline]
Type=0x22
String=0,Höhenlinie
String=4,Elevation
Linewidth=2
Color=0,0x00
[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
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Re: [mkgmap-dev] Strange error in mkgmap

2018-02-13 Thread Steve Ratcliffe

Hi Franco


a resulting bad map : bad_gmapsupp.img


Just one tile less - no problem - good_gmapsupp.img



Thanks for providing this useful test case.

This is a bug in the recent code used to calculate the best block size 
to use.  It is missing a constraint on the block size to restrict the

number of blocks in the directory file.

The attached patch fixes this and I'll commit this today.

Thanks

..Steve
Index: src/uk/me/parabola/imgfmt/sys/ImgFS.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===
--- src/uk/me/parabola/imgfmt/sys/ImgFS.java	(revision 4111)
+++ src/uk/me/parabola/imgfmt/sys/ImgFS.java	(date 151853066)
@@ -294,6 +294,9 @@
 			log.infof("bs=%d, whole size=%d, hb=%d, fb=%d, blocks=%d\n", blockSize, size,
 	headerBlocks, fileBlocks, totalBlocks);
 
+			if (headerBlocks > SLOTS_PER_ENTRY)
+continue;
+
 			if (totalBlocks > 0xfffe)
 continue;
 
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Re: [mkgmap-dev] Strange error in mkgmap

2018-02-13 Thread Andrzej Popowski

Hi Franco,

there are 2 weird things in your maps. First is a subfile SRT, which 
doesn't belong to any tile or index. It is present in both files, bad 
and good img. It is probably ignored by GPS.


Maybe mkgmap writes SRT even if MDR is not present?

Second distinction is that bad img is missing MPS subfile, which is kind 
of directory with names of combined img. This could be the reason for 
different name in GPS, but I think the map should still work correctly.


Again, maybe there is some kind of limit of tiles, that mkgmap 
remembers, when creating MPS subfile?


So IMHO the problem is with combining your map into single gmapsupp.img. 
You could install map for BaseCamp and then use MapInstall for creating 
combined map.


--
Best regards,
Andrzej
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Error in style since MKGMAP mkgmap-r4106.zip

2018-02-13 Thread lasemax
Yeah, thanks it works.




--
Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Error in style since MKGMAP mkgmap-r4106.zip

2018-02-13 Thread Gerd Petermann
Hi lasemax,

I think this line
manmade=* {add man_made='${manmade}'
is missing a  closing curly bracket.

Gerd


Von: mkgmap-dev  im Auftrag von lasemax 

Gesendet: Dienstag, 13. Februar 2018 09:41:24
An: mkgmap-dev@lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] Error in style since MKGMAP mkgmap-r4106.zip

This is a part of my point file:
It start with line 163
and 169 is "amenity=arzt { set amenity=doctors }"

# Correct wrong tags
amenity=drinking-water { set amenity=drinking_water }
amenity=Bar { set amenity=bar }
leisure=Freibad { set leisure=water_park }
leisure=Schwimmbad{ set leisure=water_park }
manmade=* {add man_made='${manmade}'
amenity=arzt { set amenity=doctors }
amenity=briefkasten { set amenity=post_box }
historic=memorial & memorial:type=stolperstein {delete historic}
historic=memorial & cemetery=grave {delete historic}
tourism=information & name=Parkleitsystem { delete tourism }
man_made=communication_tower { set man_made=communications_tower }





--
Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Error in style since MKGMAP mkgmap-r4106.zip

2018-02-13 Thread Gerd Petermann
Hi lasemax,

please post the complete points file or at least the lines before and including 
line 169.

See also
http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap=4106

Gerd


Von: mkgmap-dev  im Auftrag von lasemax 

Gesendet: Dienstag, 13. Februar 2018 09:21:21
An: mkgmap-dev@lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] Error in style since MKGMAP mkgmap-r4106.zip

You have a solution for me?
Version 4105 works perfect.




--
Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Error in style since MKGMAP mkgmap-r4106.zip

2018-02-13 Thread lasemax
You have a solution for me? 
Version 4105 works perfect.




--
Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev