logo separator

[mkgmap-dev] RFE --merge-lines only from resolution X

From Johann Gail johann.gail at gmx.de on Tue Nov 2 21:13:35 GMT 2010

Hello Steve,

I'm the origin writer of the mergeline code. It was a try to improve the 
effectiveness of the dp filter. When a nearly straight way consists of 
severeal short pieces, dp filter could not do much. If the segments are 
combined beforehand, dp filter could work much better and combine it in 
best case to a single straight line.

The correct place for calling it would be before generating the 
subdivisions and the routing data. And it should be called only one 
time, not for each resolution. But at the time of writing the filter 
network does not give the possibility for a hook 'in between'. Or at 
least I have not found it.

I will be very happy if you can set the call of the filter at the 
correct place. Feel free to do it, I don't have the time nor a running 
IDE at the moment.

Steve Ratcliffe schrieb:
>> Which file is this in? If so would changing this to
>>
>> if (mergeLines&&   res<   22) {
>> 		LineMergeFilter merger = new LineMergeFilter();
>> 		lines = merger.merge(lines);
>> 	}
>>
>> work out for me? Or do I run into problems on further lines? (I do think
>>     
>
> Yes that should be all thats needed.
>
> I can apply that to trunk too.
>   
I don't think this is a good idea. It seems to minimize the problems at 
first glance, but I'm sure you will find other situations, where a lot 
of ways gets merged, and so the small offset of 1km will be e.g. 10km. 
So at res 21 it is visible again.

Also now I remember of the --mergelines option to be breaking the 
routing because of the differences of the draw and the routing data. 
Does routing on the generated maps work nowadays (except from the wrong 
destination point)?
>   
>>> Currently it does apply at every resolution separately, but I think
>>> that is likely the problem. It is also not done to the road
>>> definitions which can't be right.
>>>       
>> What do you mean by this? In my eyes any road type (e.g. 0x01) could be
>>     
>
> Oh I meant internally, there is a class that keeps track of all the
> roads for routing, separately from the lines that get drawn. So a road
> is held within mkgmap in two places but only one is merged.
>
> Roads at different levels are linked together via NET and well I'd
> have to look at it again to be sure, but it feels like that would
> cause a problem to me.
>   
I don't have enough insight to the file format but this could well be 
the case.
Could you explain in a few words, how it works?
There is the routing data (NOD) and the draw data (NET). To my 
understanding, NOD data exists only one time. It contains the data like 
of res 24 but resolution does not mean anything here. Each segment in 
this data points to a line in the NET data. But how works this with 
lower resolutions? Are there pointers for each resolution?

As felix has written too, the basic idea was to merge the lines as soon 
as possible after reading from osm. So it should not matter if the line 
was one line in osm, or multiple lines merged by mkgmap. But there was 
some problem with it which made it impossible. I cannot remember for the 
moment.


Regards,
Johann



More information about the mkgmap-dev mailing list