<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Gerd,<br>
<br>
Thanks for diagnosing this.<br>
<br>
It would be possible for me to re-structure the file so that lines
are no longer than (say) 10km. This would increase the source (and
presumably .img) file size somewhat, but should be handleable. I
would need to do the same for my latitude/longitude grid generator.
(This might also help with a rather different problem I have had
with Osmand, which does not always show labels on the lines within
the screen area - if the lines were much shorter, the labels would
be more likely to appear on screen.)<br>
<br>
What maximum length of line would produce sensible results?<br>
<br>
Of course, this would not solve the problem for other lines such as
contour lines, mentioned by Felix. Perhaps automatic detection of
excessively long lines, with some default action, combined with a
warning, would be appropriate. This would give the user the chance
to find and perhaps change the offending data.<br>
<br>
Thanks again,<br>
<br>
Roger<br>
<br>
<div class="moz-cite-prefix">On 25/07/2014 09:46, Gerd Petermann
wrote:<br>
</div>
<blockquote cite="mid:DUB112-W68D46B916FBD9CF28D9D249EFC0@phx.gbl"
type="cite">
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
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="moz-txt-link-freetext" href="http://www.movable-type.co.uk/scripts/latlong.html">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="stopSpelling">
<div class="ecxmoz-signature">
<hr style="width:50%;"></div>
<br>
_______________________________________________
mkgmap-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a>
<a class="moz-txt-link-freetext" href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a></div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
mkgmap-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a>
<a class="moz-txt-link-freetext" href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a></pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<hr style="width:50%;float:left;"><br>
Roger Calvert<br>
<a href="http://www.rogercalvert.me.uk">http://www.rogercalvert.me.uk</a><br>
<hr style="width:50%;float:left;"></div>
</body>
</html>