logo separator

[mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil

From Gerd Petermann gpetermann_muenchen at hotmail.com on Fri Jan 27 08:56:34 GMT 2012



> Date: Thu, 26 Jan 2012 22:42:36 +0100
> From: wmgcnfg at web.de
> To: mkgmap-dev at lists.mkgmap.org.uk
> Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in	BoundaryUtil
> 
> I have checked the Way.clockwise() method and I think it's completely 
> correct. I doubt that it is possible to create an overflow with normal 
> map data.

Correct. There is no problem with overflow. The problem is in the routine 
Java2DConverter.areaToShapes().  
...
                int lat = Math.round(res[1]);
                int lon = Math.round(res[0]);
...

In special cases, this rounding can change a clockwise way to an counter-clockwise 
way or vice versa.

> 
> Also the 4 points example should be completely correct if the points are 
> given as longitude/latitude. In this case it is counterclockwise.
> [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559]

Sorry, the points are given as lat/lon pairs, but that doesn't matter, you are right, the way with these 
(rounded) values is counter-clockwise. The non-rounded values are different and 
describe a way that is clockwise.


> 
> The misinterpretation is caused by errornously assigning longitude to 
> the x axis but it is the y axis.

I know that I tend to misinterpret the names (my patch used height for latitude 
values and width for longitude values :-( , but the result doesn't depend on the
interpretation.

Gerd



 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20120127/d62d523e/attachment.html 


More information about the mkgmap-dev mailing list