logo separator

[mkgmap-dev] Weird road speed

From Gerd Petermann gpetermann_muenchen at hotmail.com on Sun Jan 19 21:47:23 GMT 2014

Hi Steve,

I agree that the GType should not be copied, I never felt happy with it.
It is probably better to create a new Class like ConvertedRoad
which extends Way and contains some exra fields like speed and class 
which are modified in StyledConverter. The RoadMerger
also uses something like this.

Gerd

> Date: Sun, 19 Jan 2014 21:38:12 +0000
> From: steve at parabola.me.uk
> To: mkgmap-dev at lists.mkgmap.org.uk
> Subject: Re: [mkgmap-dev] Weird road speed
> 
> On 19/01/14 20:06, WanMil wrote:
> > @Gerd: StyledConverter.postConvertRules can change the road speed in the
> > type. But this hasn't been copied before so I guess it's changing the
> > global type of the rule. Can you check that?
> > I added
> >      type = new GType(type);
> > at line 202 but this didn't change the overall result. So it seems not
> > to be the only problem.
> >
> 
> The way I see it is that the GType is simply a representation
> of the type declaration in a rule. It is static and should
> not be modified or copied per way.
> 
> The Converter converts Way -> MapRoad
> 
> The rules produce a Gtype and a set of variables, V (that we happen
> to implement by adding mkgmap:* tags to the way).
> 
> You use the GType and V to initialise the MapRoad.
> 
> So to override the road_speed should be done in addRoadWithoutLoops()
> where it is currently initialised directly from the GType.
> 
> ..Steve
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20140119/3006575d/attachment.html>


More information about the mkgmap-dev mailing list