
From: gpetermann_muenchen@hotmail.com To: daveswarthout@gmail.com Subject: RE: [mkgmap-dev] Lines distorted Date: Fri, 30 Jan 2015 09:02:45 +0100 Hi Dave, up to now the reduce-point-xxx options are used for the DouglasPeuckerFilter which smoothes lines at lower resolutions. They are ignored for resolution 24, in which the WrongAngleFixer is used to guess how an object can be placed on the Garmin raster so that it looks as much as possible like the OSM described by the OSM data. If you want to play with that: The WrongAngleFixer has a few constants, e.g. you may increase the value MAX_DIFF_ANGLE_STRAIGHT_LINE = 3; or change the method calcMaxErrorDistance() to allow larger errors. Gerd From: daveswarthout@gmail.com Date: Fri, 30 Jan 2015 07:14:07 +0700 To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] Lines distorted I want to continue Enrico's questioning a bit. I have a similar issue with the way polygons display on my Garmin device. What appears as a smooth curve on the OSM slippy map are very blocky on the device. I have played with the reduce-point-density=4 and reduce-point-density-polygon=8 parameters in an attempt to smooth those curves but they seem to have no effect. I can live with the distortion but I wonder, what do these two parameters actually control? Cheers,Dave On Fri, Jan 30, 2015 at 12:22 AM, Andrzej Popowski <popej@poczta.onet.pl> wrote: Hi Enrico, Garmin maps have limited resolution, about 2.4m. One can't draw precisely a line, which length is near to this resolution. You can try to assign the same Garmin object type to all these segments, then probably mkgmap will be able to merge them and smooth. -- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -- Dave Swarthout Homer, Alaska Chiang Mai, Thailand Travel Blog at http://dswarthout.blogspot.com _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi GerdP, excuse me, how I can concretely apply the MAX_DIFF_ANGLE_STRAIGHT_LINE = 3 parameteres? Thanks. --enrico -- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831907.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Enrico, you have to modify the java sources and compile your own binary. If you can't do that I can post a quick patch to implement some options for that. Gerd
Date: Fri, 30 Jan 2015 01:49:36 -0700 From: e.rossini73@alice.it To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] FW: Lines distorted
Hi GerdP, excuse me, how I can concretely apply the MAX_DIFF_ANGLE_STRAIGHT_LINE = 3 parameteres? Thanks. --enrico
-- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831907.html Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

ehm, I don't know how to modify the java source and compile my own library... -- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831910.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Enrico, attached is a quick patch that implements three new experimental options: --x-waf-max-bearing-error=15 --x-waf-max-angle=3 --x-waf-max-error-percentage=100 Meaning: --x-waf-max-bearing-error=15 The algo calculates the delta of the displayed baring and the real bearing in OSM. If the delta is larger than this, it tries to correct something. Try values between 10 and 20. --x-waf-max-angle=3 This is used to detect obsolete points. If the 3 consecutive points (P1,P2,P3) in a line form an angle < x-waf-max-angle, it is a candidate for removal. The point P2 is removed if the distance to the straight line between P1 and P3 is small enough. A higher value means that more points may be removed. Reasonable values are probably between 1 and 5. --x-waf-max-error-percentage=100 This value is used in the method that decides if the distance to the straight line is small enough. A higher value means more points are removed. Reasonable values are probably between 50 and 200. The binary based on r3430 is here: http://files.mkgmap.org.uk/download/243/mkgmap.jar If you find better values than the defaults, please let us know. The defaults are a compromize of calculation time and quality. Gerd
Date: Fri, 30 Jan 2015 01:57:31 -0700 From: e.rossini73@alice.it To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] FW: Lines distorted
ehm, I don't know how to modify the java source and compile my own library...
-- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831910.html Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Enrico, I forgot to mention that the options are not used for shapes, only for lines. Gerd From: gpetermann_muenchen@hotmail.com To: mkgmap-dev@lists.mkgmap.org.uk Date: Fri, 30 Jan 2015 10:47:07 +0100 Subject: Re: [mkgmap-dev] FW: Lines distorted Hi Enrico, attached is a quick patch that implements three new experimental options: --x-waf-max-bearing-error=15 --x-waf-max-angle=3 --x-waf-max-error-percentage=100 Meaning: --x-waf-max-bearing-error=15 The algo calculates the delta of the displayed baring and the real bearing in OSM. If the delta is larger than this, it tries to correct something. Try values between 10 and 20. --x-waf-max-angle=3 This is used to detect obsolete points. If the 3 consecutive points (P1,P2,P3) in a line form an angle < x-waf-max-angle, it is a candidate for removal. The point P2 is removed if the distance to the straight line between P1 and P3 is small enough. A higher value means that more points may be removed. Reasonable values are probably between 1 and 5. --x-waf-max-error-percentage=100 This value is used in the method that decides if the distance to the straight line is small enough. A higher value means more points are removed. Reasonable values are probably between 50 and 200. The binary based on r3430 is here: http://files.mkgmap.org.uk/download/243/mkgmap.jar If you find better values than the defaults, please let us know. The defaults are a compromize of calculation time and quality. Gerd
Date: Fri, 30 Jan 2015 01:57:31 -0700 From: e.rossini73@alice.it To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] FW: Lines distorted
ehm, I don't know how to modify the java source and compile my own library...
-- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831910.html Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ 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

sorry, how can I apply your patch? thanks very much. --enrico -- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831926.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Enrico, please read the complete post, it contains a link to the binary as well. Gerd demon.box wrote
sorry, how can I apply your patch? I found the command:
patch < patch-name
but I don't understand very much how I have to apply it... thanks very much. --enrico
-- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831930.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

sorry, thanks very much for your patience, now I understand, it's just because the new 3 options are usable alternatively, right? I make some test but the new mkgmap ignore my style for lines, why? <http://gis.19327.n5.nabble.com/file/n5831936/nuovo-1.jpg> -- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831936.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Enrico, I have no idea. The patch is not likely to cause that, so probably your test environment is the problem. You can try any combination of the three options, but not all of them will produce good results. Gerd demon.box wrote
sorry, thanks very much for your patience, now I understand, it's just because the new 3 options are usable alternatively, right?
I make some test but the new mkgmap ignore my style for lines, why? <http://gis.19327.n5.nabble.com/file/n5831936/nuovo-1.jpg>
-- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831937.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

ok I found the problem with my style... sorry again. then I make some test but unfortunately I can't find any difference with many values of the new options... thanks --enrico -- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831940.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Enrico, I just tried the binary. I see different img file size with parameter --x-waf-max-error-percentage=200, so I think it works as expected. Are you sure that you use the patched binary? Gerd demon.box wrote
ok I found the problem with my style... sorry again. then I make some test but unfortunately I can't find any difference with many values of the new options... thanks --enrico
-- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831948.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

yes I use your patched binary because it accept the new options but I see the same img file size... and the same rendered result. <http://gis.19327.n5.nabble.com/file/n5831958/image477.jpg> -- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831958.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Enrico, please double check. Every mkgmap version will accept these options because they start with "x-" Gerd demon.box wrote
yes I use your patched binary because it accept the new options but I see the same img file size... and the same rendered result. <http://gis.19327.n5.nabble.com/file/n5831958/image477.jpg>
-- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831960.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

ah ok, I understand but I'm sure that I'm using your mkgmap.jar.... (I rename the normal version) -- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831965.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Enrico, okay, don't know what's wrong, the binary works for me. In the mean time I was able to find out what data your screen shot shows. If I got it right, you are interested in "Via Ronchi Di San Francesco Di Paola" which consists of many very small parts with alternating types. Maybe this is a special case, the options don't help to straight out these lines. 'll have a look at this during the next days. Gerd demon.box wrote
ah ok, I understand but I'm sure that I'm using your mkgmap.jar.... (I rename the normal version)
-- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831970.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

yes you'are right, I'm interested to straight out the line "Via Ronchi Di San Francesco Di Paola". would be great if you'll find something to do this. THANKS. --enrico -- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831971.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Enrico, I fear I can't change mkgmap to fix this problem. The problem is more or less bad luck. In some cases, you have placed the points of the ways more or less exactly between the points of the Garmin grid, others are very near to the grid points. If I got it right, we can only produce a straight line in the garmin format when we allow to move certain points by more than 2 metres, and in that case the WrongAngleFixer will prefer the correct position to the bad angle. I''ve attached the grid as a gpx file, if you load that into JOSM you probably see what I mean. If you prefer "nicer" rendering on the Garmin map you may move some points closer to the grid to solve the problem. Gerd
Date: Fri, 30 Jan 2015 09:40:37 -0700 From: e.rossini73@alice.it To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] FW: Lines distorted
yes you'are right, I'm interested to straight out the line "Via Ronchi Di San Francesco Di Paola". would be great if you'll find something to do this. THANKS. --enrico
-- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831971.html Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

I'm still reading this thread but haven't tried the new mkgmap.jar yet. I was hoping for a way to smooth polygons and Gerd's reply to Enrico indicates that the patch and new binary only help smoothing lines, so I stopped paying attention. But I'm interested in learning more about mkgmap and the map making process in general. I saw another post a while back where Gerd says something along the lines of "people still don't know how to use a patch". The documentation for mkgmap itself is pretty thin. There's the style manual, and the little blurb about TYP files but nothing to tie it all together. And I've not found anything about how to use mkgmap other then the options text file. The explanatory statements in there are helpful but leave a lot unsaid. A careful reading of the "Optimization Options", for example, left me with more questions than answers. You are the developers of the program, so many of these things must seem glaringly obvious. But they are not. How is one supposed to know how to utilize a patch? Is there a users manual somewhere? Thanks, Dave On Sat, Jan 31, 2015 at 4:41 PM, Gerd Petermann < gpetermann_muenchen@hotmail.com> wrote:
Hi Enrico,
I fear I can't change mkgmap to fix this problem. The problem is more or less bad luck. In some cases, you have placed the points of the ways more or less exactly between the points of the Garmin grid, others are very near to the grid points. If I got it right, we can only produce a straight line in the garmin format when we allow to move certain points by more than 2 metres, and in that case the WrongAngleFixer will prefer the correct position to the bad angle.
I''ve attached the grid as a gpx file, if you load that into JOSM you probably see what I mean.
If you prefer "nicer" rendering on the Garmin map you may move some points closer to the grid to solve the problem.
Gerd
Date: Fri, 30 Jan 2015 09:40:37 -0700 From: e.rossini73@alice.it To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] FW: Lines distorted
yes you'are right, I'm interested to straight out the line "Via Ronchi Di San Francesco Di Paola". would be great if you'll find something to do this. THANKS. --enrico
-- View this message in context: http://gis.19327.n5.nabble.com/Distorted-lines-tp5831842p5831971.html Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ 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
-- Dave Swarthout Homer, Alaska Chiang Mai, Thailand Travel Blog at http://dswarthout.blogspot.com

El 01/02/15 a las 07:04, Dave Swarthout escribió:
How is one supposed to know how to utilize a patch? Is there a users manual somewhere? Dealing with patches has nothing to do with mkgmap but with develop in general. In a Linux system typing "man patch" in a console is the way to get the manual.
participants (5)
-
Carlos Dávila
-
Dave Swarthout
-
demon.box
-
Gerd Petermann
-
GerdP