logo separator

[mkgmap-dev] [PATCH] Again NullPointerException

From Gerd Petermann gpetermann_muenchen at hotmail.com on Sun Feb 12 11:25:37 GMT 2012

Hi WanMil,

> Date: Sun, 12 Feb 2012 12:05:55 +0100
> From: wmgcnfg at web.de
> To: mkgmap-dev at lists.mkgmap.org.uk
> Subject: Re: [mkgmap-dev] [PATCH] Again NullPointerException
> 
> 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.

I did not see a notble impact during my tests.

> 
> 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?

No.
I think the code is exactly doing what you want. It reverses the order if way.clockwise() returns
a wrong result, no matter if ccw or cw is correct. At least that's what I want it to do.
Are you sure that it doesn't work?

> 
> 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
> 
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20120212/01f2bf8d/attachment.html 


More information about the mkgmap-dev mailing list