<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 Steve,<br><br>I agree that the GType should not be copied, I never felt happy with it.<br>It is probably better to create a new Class like ConvertedRoad<br>which extends Way and contains some exra fields like speed and class <br>which are modified in StyledConverter. The RoadMerger<br>also uses something like this.<br><br>Gerd<br><br><div>> Date: Sun, 19 Jan 2014 21:38:12 +0000<br>> From: steve@parabola.me.uk<br>> To: mkgmap-dev@lists.mkgmap.org.uk<br>> Subject: Re: [mkgmap-dev] Weird road speed<br>> <br>> On 19/01/14 20:06, WanMil wrote:<br>> > @Gerd: StyledConverter.postConvertRules can change the road speed in the<br>> > type. But this hasn't been copied before so I guess it's changing the<br>> > global type of the rule. Can you check that?<br>> > I added<br>> > type = new GType(type);<br>> > at line 202 but this didn't change the overall result. So it seems not<br>> > to be the only problem.<br>> ><br>> <br>> The way I see it is that the GType is simply a representation<br>> of the type declaration in a rule. It is static and should<br>> not be modified or copied per way.<br>> <br>> The Converter converts Way -> MapRoad<br>> <br>> The rules produce a Gtype and a set of variables, V (that we happen<br>> to implement by adding mkgmap:* tags to the way).<br>> <br>> You use the GType and V to initialise the MapRoad.<br>> <br>> So to override the road_speed should be done in addRoadWithoutLoops()<br>> where it is currently initialised directly from the GType.<br>> <br>> ..Steve<br>> _______________________________________________<br>> mkgmap-dev mailing list<br>> mkgmap-dev@lists.mkgmap.org.uk<br>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev<br></div>                                            </div></body>
</html>