logo separator

[mkgmap-dev] [PATCH v1] make DP filter avoid removing points located at nodes

From Johann Gail johann.gail at gmx.de on Thu Nov 26 22:04:49 GMT 2009

>>> So in my opinion the error is in the copy function of the line. If a 
>>> line contains CoordNodes, than also the copy should contain 
>>> CoordNodes. Can you point me to the code, where the lines gets 
>>> duplicated?
>>>     
>>
>> Whenever a routable way gets split to limit the number of points or
>> nodes it makes a new list of points so any changes to the points in the
>> new list will not be visible in the original list.
>>   
> Yes, its true that changes in the copy will not be visible in the 
> original. But this is not my point. My point is: If the original line 
> contains CoordNodes (instead of Nodes) then the copy should also 
> contain CoordNodes.
> I think, this will complicate the split/copy functions in some ways, 
> so maybe your solution is the easier way.

I have now looked into the code and must say, I don't understand why it 
works. Previous for each node was created a CoordNode. Now instead a 
flag is set. I see the difference: The flag is copied, the class 
obviously not.
But I didn't find the place, where this copy occurs. Could you point my 
nose to the file and line number, where the line is duplicated? The only 
place I found is in the round coord filter class (line 55), where it is 
handled correctly.
So why your patch works as expected and the original solution not??

I have another idea of solving this problem.
Instead of do a new Coord or CoordNode call coord.copy(). The function 
could be overwritten in the CoordNode class to return a CoordNode 
object. (BTW. This should be done in the CoordPOI class too). So a 
copied line should contain afterwards the same types as the original.




More information about the mkgmap-dev mailing list