Hi Michaël,
line 218 CGAlgorithms.isPointInRing(jPt, coordList) ||
> pointInList(jPt,coordList)
>
The second test is just paranoia that isPointInRing is not robust for
non-fixed point math. I haven't scanned the jts code to see what it
actually does.
@Larry : I replaced a quick 'ring in ring' test based on two consecutive....
>
I agree with your mod. It shouldn't be much of a runtime penalty, however
it might be slightly better to not build the test polygons unless the first
condition is met. Just my 2 cents.
if (!holesCW.contains(jRing) {
Polygon iPoly =
geometryFactory.createPolygon(iRing,noHole);
Polygon jPoly =
geometryFactory.createPolygon(jRing,noHole);
if (iPoly.contains(jPoly)) holesCW.add(jRing);
}
regards,
Larry
2009/5/10 Michaël Michaud <michael.mich...@free.fr>
> Hi,
>
> As I tried to fix a bug in PolygonHandler (see end of e-mail), I noticed
> some other strange pieces of code in this class.
> I'd like to clean it a bit, but it is a very useful class and I don't
> want to break a working code.
> If Larry or somebody else would be kind enough to check the following
> propositions :
>
> line 43/44 (testPoint.x == p.x) && (testPoint.y == p.y) && ((testPoint.z
> == p.z) || (!(testPoint.z == testPoint.z))) //nan test; x!=x iff x is nan
> the test on z sounds very strange (and the comment does not help).
> I think the whole test could be simplified into testPoint.equals3D(p)
> (equals2D woud be probably enough)
> Moreover, if we simplify the test line 218 as proposed hereafter, it
> seems that the whole method can be dropped
>
> line 170 if(points.length == 0 || points.length > 3){
> I don't understand why 1 and 2 points rings are filtered and not 0 point
> rings, but it may be necessary to hold some kind of empty geometries
>
> line 218 CGAlgorithms.isPointInRing(jPt, coordList) || pointInList(jPt,
> coordList)
> Can be simplified into CGAlgorithms.isPointInRing(jPt, coordList)
> because according to the documentation, isPointInRing includes the case
> where jPt lies on the ring formed by coordList.
>
> line 285 same test as above
> Here, I already simplified into CGAlgorithms.isPointInRing(jPt, coordList)
>
> @Larry : I replaced a quick 'ring in ring' test based on two consecutive
> PointInRing tests (I think you gave me the code) by a full
> Polygon.contains(Polygon) test to avoid side effects as the one
> mentionned by Loren on the user list. It may slow down shapefile parsing
> a bit (I did not measure).
>
> Michaël
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
> i700
> Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. http://p.sf.net/sfu/kodak-com
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
--
http://amusingprogrammer.blogspot.com/
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel