logo separator

[mkgmap-dev] [PATCH v1] Merge similar lines and ways

From Mark Burton markb at ordern.com on Sat Aug 15 12:45:48 BST 2009

Thilo,

> Am 15.08.2009 um 13:04 schrieb Mark Burton:
> 
> > Will this cause a problem with ways that have been split on purpose
> > because they are longer than the maximum allowed arc length?
> 
> No, not at all. The reason is that the merging of the ways is done  
> before they are split again if necessary. The net effect is still a  
> size reduction of the map (with the style I'm using). I hope that I  
> also got everything else right: relations, turn-restrictions, etc.  
> Please test and complain ;). Note that the argument "--merge-lines" is  
> needed for the merging to take place.
> 
> The more detailed the OSM data becomes, the more the merging will be  
> helpful. The main reason are the route relations. Here in my hometown  
> all the bus routes are mapped and of course they go all over the  
> place. Each time a bus route enters or leaves a street, the street has  
> to be chopped up. Add to that a lot of cycle routes, hiking routes  
> etc. and you see that the street gets chopped up into tiny bits.  
> Depending on the map you try to create, you will ignore most of those  
> relations and they will make no difference, so all those tiny bits  
> have the same attributes. Merging them again will reduce the number of  
> ways. This at least reduces the size of the map slightly and probably  
> also helps routing and improves the drawing speed somewhat.

I understand the potential benefits of this patch.

However, looking at the code it seems to me that the merging happens
after StyledConverter.addRoad() is called and that is where the way
lengths are limited. So you either have to do the merging earlier, or
you need to add a constraint to limit the length of the merged way.

Actually, there are several constraints in StyledConverter: 

	// limit arc lengths to what can currently be handled by RouteArc
	private final int MAX_ARC_LENGTH = 25000;

	private final int MAX_POINTS_IN_WAY = 200;

	private final int MAX_NODES_IN_WAY = 16;

Cheers,

Mark



More information about the mkgmap-dev mailing list