logo separator

[mkgmap-dev] Explanation of the is_in function

From Gerd Petermann gpetermann_muenchen at hotmail.com on Wed May 20 09:53:56 BST 2020

Hi Ticker

the problem is in mkgmap. I can reproduce it with the attached simple example.

I think the bug is in the distance calculation in isPointInShape(), see attached patch. It returned ON for a point which is clearly inside.
I've also changed the way how test points are calculated so that the rounding tolerances are less likely to produce a problem.
I don't understand the meaning of the comment
                                        // there is a small area between the square EPS_HP*2 and the circle within, where, if polygon vertex and
                                        // segments are the other side, it might still be calculated as ON.
so maybe my patch makes things worse in other situations?
My understanding is that we can use a² + b² = c² , so maybe the comment can be removed as well?

Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Joris Bo <jorisbo at hotmail.com>
Gesendet: Dienstag, 19. Mai 2020 21:12
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] Explanation of the is_in function

Hi Ticker,

Thx for the update, off course no problem.

Gr Joris



-----Oorspronkelijk bericht-----
Van: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> Namens Ticker Berkin
Verzonden: dinsdag 19 mei 2020 18:57
Aan: Development list for mkgmap <mkgmap-dev at lists.mkgmap.org.uk>
Onderwerp: Re: [mkgmap-dev] Explanation of the is_in function

Hi Joris

I can't do anything in the next few days to investigate this but I'll have a look when I can.

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: isin2.osm
Type: application/octet-stream
Size: 1421 bytes
Desc: isin2.osm
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20200520/d21e1f70/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: isPointInShape.patch
Type: application/octet-stream
Size: 1965 bytes
Desc: isPointInShape.patch
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20200520/d21e1f70/attachment-0001.obj>


More information about the mkgmap-dev mailing list