logo separator

[mkgmap-dev] [PATCH] Again NullPointerException

From WanMil wmgcnfg at web.de on Sun Feb 12 11:05:55 GMT 2012

Hi Gerd,

thanks for the patch.

The verifiedAreaToShapes should replace the areaToShapes method. The 
only reason it should not replace is if the performance is noticeably 
slower.

The clockwise check before reversing is superfluous:
    Way w = new Way(0, coords);
    if (w.clockwise() != (realAreaSize <= 0)){
       Collections.reverse(coords);
     }
     outputs.add(coords);

The direction might change in both situations so it should also be 
checked if the direction changes from ccw to cw. Do you agree?

WanMil

> Hi,
>
> as a result of previous discussions here is th new patch.
>
> http://gis.19327.n5.nabble.com/file/n5471749/verify_boundary_v3.patch
> verify_boundary_v3.patch
>
> Changes:
> Verify if rounding errors change the direction of a way
> (clockwise/counterclockwise order), if that happens,
> change the order so that Way.clockwise() returns the wanted result.
>
> The patch introduces a new method
>
> Java2DConverter.verifiedAreaToShapes()
>
> instead of changing the existing
>
> Java2DConverter.areaToShapes(area)
>
> I did this because Java2DConverter.areaToShapes(area) is called in other
> places and I wanted to avoid side effects. Maybe someone who knows the
> sources in
> PolygonSplitterBase.java and PolygonClipper.java
> can look at this and see if they benefit also from the verified routine?
>
> Gerd
>
> --
> View this message in context: http://gis.19327.n5.nabble.com/PATCH-Again-NullPointerException-tp5471749p5471749.html
> Sent from the Mkgmap Development mailing list archive at Nabble.com.
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev




More information about the mkgmap-dev mailing list