Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jts-dev] When should I use SimplePointInAreaLocator and PointLocator

Hi Jesse,

I don't think that SimplePointInAreaLocator offers a significative CPU advantage as it is based on CGAlgorithms.isPointInRing which in turn uses locatePointOnRing, the same method as the one used by PointLocator.

But it wraps the areal geometry it is working on and implements PointOnGeometryLocator which is used in classes like PreparedPolygon. So maybe its advantage is to implement an interface giving the opportunity to cache some pre-computation. Even in this case, I don't know why MD has choosen to implement the method which returns only INTERIOR and EXTERIOR and is documented as undetermined for points on boundary.
After checking the code, it seems that SimplePointInAreaLocator should return INTERIOR for points located on the boundary.

Just guesses. Would be interesting to have Martin Davis's insight.

Michaël


Le 01/06/2016 à 17:33, Jesse Eichar a écrit :
I see that SimplePointInAreaLocator only really works for polygon geometries (and collections containing polygons).  However at a glance PointLocator also seems to work for Polygons.  

So I wonder what the point of SimplePointInAreaLocator is?  Does it have better performance characteristics perhaps?  It also says that it might not work for when the point is on the boundary, so unless the performance is significantly better I don't see such a reason for it.

Thanks,

Jesse


_______________________________________________
jts-dev mailing list
jts-dev@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.locationtech.org/mailman/listinfo/jts-dev


Back to the top