<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi Felix,<br><br>I agree. I am working on a simple patch that tries to detect that the formula doesn't work. <br>I just have to decide what to do in that case, typically it is better to keep the point, so <br>img size might increase.<br><br>Gerd<br><br><div><hr id="stopSpelling">Date: Fri, 25 Jul 2014 11:12:40 +0200<br>From: extremecarver@gmail.com<br>To: mkgmap-dev@lists.mkgmap.org.uk<br>Subject: Re: [mkgmap-dev] Incorrect compilation of grid lines<br><br>
not an idea - but a comment. I think that for such a special
nonusual case, there should be no degradation for the general use.
Wouldn't it be enough to just switch off douglas peucker algo for
maps where you want to include long "straigt" lines?<br>
<div class="ecxmoz-cite-prefix">On 25.07.2014 10:46, Gerd Petermann
wrote:<br>
</div>
<blockquote cite="mid:DUB112-W68D46B916FBD9CF28D9D249EFC0@phx.gbl">
<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}
.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}
--></style>
<div dir="ltr">Hi Roger,<br>
<br>
the problem is caused by the routine that removes obsolete
points from straigt lines. <br>
This routine doesn't care (enough) about the spherical
distortian.<br>
The routine uses herons formula to "calculate distance of point
in the middle to line c1,c2".<br>
This formula is for 2D, but used to work good enough with the
rather short ways <br>
we have in OSM. (The formula is also used in the Douglas-Peucker
filter).<br>
With long lines the as in your data, the errors are too big and
the routine returns garbage.<br>
<br>
If I got that right, we have to use the formula for the
"Cross-track distance" as described here:<br>
<a class="ecxmoz-txt-link-freetext" href="http://www.movable-type.co.uk/scripts/latlong.html" target="_blank">http://www.movable-type.co.uk/scripts/latlong.html</a><br>
<br>
Unfortunately, this routine uses more trigonometrical
calculations, so it will be slower.<br>
<br>
@Programmers: Any other ideas?<br>
<br>
Gerd<br>
<br>
<div>
<hr id="ecxstopSpelling">Date: Wed, 25 Jun 2014 12:12:18 +0100<br>
From: <a class="ecxmoz-txt-link-abbreviated" href="mailto:roger@rogercalvert.me.uk">roger@rogercalvert.me.uk</a><br>
To: <a class="ecxmoz-txt-link-abbreviated" href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a><br>
Subject: [mkgmap-dev] Incorrect compilation of grid lines<br>
<br>
I have a file containing the British National Grid lines, as
printed on Ordnance Survey maps. This can be found at <a href="http://www.rogercalvert.me.uk/osm/GBGrid/GBGrid.zip" target="_blank">http://www.rogercalvert.me.uk/osm/GBGrid/GBGrid.zip</a>
(this contains two files, they are the same except for the
addition of the 'version' tag in the GBGrid06.osm file). I
compile this file with mkgmap and overlay it on my GPS map.<br>
<br>
This works correctly with mkgmap 2654 and It displays
correctly in JOSM.<br>
<br>
With mkgmap version 3241, the lines are misaligned and out of
position. The behaviour is the same on MapSource, BaseCamp and
my device. No error messages are produced.<br>
<br>
(I have not used any versions of mkgmap in between these two).
<br>
<br>
My style file allocates codes in the 0x10300 range to these
lines, but the effect is the same when I use code 0x21
(contour) for all lines.<br>
<br>
Attached are screen dumps for a small part of the map, from
JOSM, mkgmap 2654 and mkgmap 3241, and also the batch file I
used to compile it.<br>
<br>
I would greatly appreciate any advice.<br>
<br>
Many thanks,<br>
<br>
Roger<br>
<div class="ecxmoz-signature">-- <br>
<hr style="width:50%;"><br>
Roger Calvert<br>
<a href="http://www.rogercalvert.me.uk" target="_blank">http://www.rogercalvert.me.uk</a><br>
<hr style="width:50%;"></div>
<br>
_______________________________________________
mkgmap-dev mailing list
<a class="ecxmoz-txt-link-abbreviated" href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a>
<a class="ecxmoz-txt-link-freetext" href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" target="_blank">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a></div>
</div>
<br>
<fieldset class="ecxmimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
mkgmap-dev mailing list
<a class="ecxmoz-txt-link-abbreviated" href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a>
<a class="ecxmoz-txt-link-freetext" href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" target="_blank">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a></pre>
</blockquote>
<br>
<pre class="ecxmoz-signature">--
keep on biking and discovering new trails
Felix
openmtbmap.org & <a class="ecxmoz-txt-link-abbreviated" href="http://www.velomap.org" target="_blank">www.velomap.org</a></pre>
<br>_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</div>                                            </div></body>
</html>