logo separator

[mkgmap-dev] Commit: r888: Add zero to the bit array when the road does not end in a node

From Johann Gail johann.gail at gmx.de on Sun Feb 15 12:59:33 GMT 2009

> I can confirm that your patch works and gives the same results as
> BitWriter would.
>
>   
>> --- RoadDef.java	(revision 887)
>> +++ RoadDef.java	(working copy)
>> @@ -351,8 +351,8 @@
>>  			bits[0] = false;
>>  		for (int i = 0; i < bits.length; i += 8) {
>>  			int b = 0;
>> -			for (int j = 0; j < bits.length - i; j++)
>> -				if (bits[j])
>> +			for (int j = 0; j < 8 && j < bits.length - i; j++)
>> +				if (bits[i+j])
>>  					b |= 1 << j;
>>  			writer.put((byte) b);
>>     
>
>   
Sorry for my patch from yesterday. I was to tired to work it cleanly out.
I've tested the corrected loop code now. It works ok, but doesn't change 
anything in my test case. In my case there are only 3 nodes, so there is 
no change in output.


> I will add this in, and remove the end node code for now, as it was not
> being run anyway.
>
>
>   
I have now fully checked and tested the whole thing:
Even if I do not include 'r883: Add nodes for dead ends' then my patch 
with the end node works very well for my situation. I can't find any 
false drawings of the pink line. The important fact seems to be, that 
the number of nodes has to be increased by one. Even if the bits are set 
wrong, routing and drawing works fine for me.




More information about the mkgmap-dev mailing list