<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,<br><br>I read again this discussion <br>http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2012q4/015264.html<br><br>I still don't have a good idea what is_closed() should return in case of special cases.<br><br>Assume these different ways in the input file:<br>input file contains nodes :<br>n1 to n9 , nx is missing in the file but exists in OSM planet, <br>n1 is equal to n9, means, the coordinates rounded to map units are equal<br><br>way 1 : n1,n2,n3...,n8,n9<br>way 2 : n1,n2,n3...,n8,n1<br>way 3: nx,n1,n2,n3,nx<br>way 4: n1,n2,n9<br>way 5: n1,n2,n1<br>way 6: nx,n2,nx<br><br>What result do you expect from the is_closed() style function?<br>I really don't know what to say for the special cases.<br><br>My understanding is this:<br>a) the style author should not be bothered with the question about <br>incomplete data. If the way is not complete, mkgmap might try to <br>close it, but when style processing starts the way is either closed or not,<br>and <b>closed means first and last point are identical</b>. <br>If the incomplete ways (3 and 6) cannot be closed by mkgmap,<br>they should be dropped beforre style processing.<br>b) A way should not be passed to the polygon rules if it is not closed or <br>has less than four points (three points form a line)<br>c) the style function is_closed() should return true for all<br>ways passed to the polygon style rules<br>d) is_closed() should not return true for a way that cannot be <br>passed to the polygon rules.<br><br>In other words, I'd prefer to have a rule is_polygon() which returns<br>true if the way has more than 3 points AND first and last point are identical.<br>This can be used in the lines rules to decide that a polygon rule might match better.<br><br>Comments?<br><br>Gerd<br><br><div><hr id="stopSpelling">From: gpetermann_muenchen@hotmail.com<br>To: mkgmap-dev@lists.mkgmap.org.uk<br>Date: Tue, 17 Dec 2013 17:29:36 +0100<br>Subject: Re: [mkgmap-dev] Way.isClosed()<br><br>
<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}
.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}
--></style>
<div dir="ltr">> > Do you agree?<br><div>> ><br>> <br>> Yes. I wonder if hasEqualEndPoints() is required?<br><br>not If all routines that create shapes make sure that<br>they add the identical point to close the shape. In trunk,<br>this is not always the case, so I use it find those cases.<br>I'll post a patch later to show my results.<br><br>> <br>> But you need to take care about any way copy made within mkgmap. I think <br>> the closed flag is copied very seldom (which is wrong).<br>> <br>hmm, yes, and the docu for is_closed says<br>"+true+ the way is closed. +false+ the way is not closed and cannot be processed as polygon."<br>that would imply that we should use something like<br>way.getPoints.size() > 2 && way.hasIdenticalEndPoints()<br>to evalute is_closed() <br><br>Gerd<br></div>                                            </div>
<br>_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</div>                                            </div></body>
</html>