logo separator

[mkgmap-dev] Resurrect adjust-turn-headings

From Gerd Petermann gpetermann_muenchen at hotmail.com on Tue Oct 20 10:25:11 BST 2020

Hi Ticker,

my understanding is that original Garmin maps use compact dirs a lot, so I think it is not a good idea to disable them. My problem with the patch is that NodCheck complains a lot more
Steve and I are not sure how Garmin calculates the encoded angles, so we are still just guessing. Your approach might well be the best so far.
The code in NodCheck has one big problem: It uses the data stored in RGN to calculate the bearings, and that means 24 bit precision. So for nearby nodes the rounding errors are too big and NodCheck uses a fallback algo which selects another point.
I guess Garmin also calculates the NOD data with more than 24 bit precision, so they probably also have some kind of angle fixer.
How did you test your changes? I think I used fake data that contained two alternative routes. That helped me  to find the threshold values for the penalties.
I also used real world OSM data to check special cases like roundabouts or *_link  roads.
Unfortunately it is very difficult to create unit tests for this, and the risk is high that a change improves 10 cases but worsens another 10, esp. with other styles or in other countries.

Maybe there is only one way to find out. I commit your patch and we wait for comments here or in the Garmin forum...

Gerd





________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap at jagit.co.uk>
Gesendet: Dienstag, 20. Oktober 2020 10:46
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] Resurrect adjust-turn-headings

Hi Gerd

Yes, with --x-ignore-sharp-angles, the compactDirs format is disabled.
Some of the example problems I looked at behaved much better when not
using compactDirs, so it seemed reasonable, to avoid more developer "-
-x-" type options, to have it this way.

I thought about having another option to control this when "ignore
-sharp-angles", with options to force on, force off and auto mode that
looks for the cases of 2 roads being in the same sector or where the
road continuation isn't in the opposite sector but some other way is.

I can do something like this if you think it worthwhile.

Ticker

On Tue, 2020-10-20 at 08:10 +0000, Gerd Petermann wrote:
> Hi Ticker,
>
> sorry for the delay. I've started to compare the results of the
> patched and the original version. I think there might be a problem
> with --x-ignore-sharp-angles.
> I assume that patch disables the compact dirs when this undocument
> option is used?
>
> Gerd
>
> ________________________________________
> Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag
> von Gerd Petermann <gpetermann_muenchen at hotmail.com>
> Gesendet: Mittwoch, 14. Oktober 2020 19:26
> An: Development list for mkgmap
> Betreff: Re: [mkgmap-dev] Resurrect adjust-turn-headings
>
> Hi Ticker,
>
> thanks for the patch. I'll have a closer look at the weekend.
>
> Gerd
>
> ________________________________________
> Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag
> von Ticker Berkin <rwb-mkgmap at jagit.co.uk>
> Gesendet: Mittwoch, 14. Oktober 2020 10:24
> An: Development list for mkgmap
> Betreff: Re: [mkgmap-dev] Resurrect adjust-turn-headings
>
> Hi Gerd
>
> I've been looking at turn pop-ups and routing decisions and attach a
> patch that makes improvements:
>
> Move decision about when to use compactDir initialHeadings from
> RouteNode to AngleChecker.
> The current code checks if any headings from a RouteNode share the
> same
> compactDir/4-bit sector and, if so, revert to the full/8-bit value.
> Overlaid roads triggered this, also sharp angles that couldn't be
> widened, probably when many paths converge at a road.
>
> AngleChecker::fixSharpAngles was coded on the basis that compactDirs
> are used and it tested/increased angles based on this 4-bit step, but
> if these are then represented in 8-bit format, the encode angle could
> be much (up to 22.5 degrees) less that the code was expecting and
> result in turning delays in route calculations.
>
> Recode fixSharpAngles to work in degrees but choose the thresholds to
> be good for compactDirs. Test the resultant angles and only use
> compactDirs if there are no roads in the same or adjacent 4-bit
> sectors.
> Not allowing Adjacent is necessary because, in compactDirs format, if
> there is a path in the opposite sector to the road and the road
> continuation is the adjacent sector, Garmin gives a "turn to stay on
> road" pop-up, but with 8-bit headings it doesn't. This is slightly
> different from the following case because this concerns an angle that
> doesn't need to be "unsharpened" as it isn't permitted for vehicles
> to
> make this turn.
>
> When increasing an angle, change the heading of the lower class/speed
> road in preference to the major road.
> This helps prevent the "turn to stay on road" type pop-ups when the
> lead-off road was more straight-on than the main road and one-way
> tagging possibly missing.
>
> Handle simple (<= 2 RouteArcs) RouteNodes as special cases, giving
> slight efficiency improvements.
>
> Add some diagnostics for showing RouteNodes and RouteArcs in an area.
>
> Tidy up normalisation of headings.
>
> Fix some bugs.
>
> Ticker
>
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


More information about the mkgmap-dev mailing list