Re: [OpenMap Users] Speeding Up isPointInPolygon

From: Don Dietrick <dfdietrick_at_gmail.com>
Date: Wed, 2 Jun 2010 07:58:53 -0400

Hi Bill,

Are you doing a BoundingCircle check before calling isPointInPoly?
You can create a BoundingCircle that encapsulates the poly, and then
call BoundingCircle.intersects(pnt, 0) on that representative
BoundingCircle.

If you have a bunch of polys, you can load them into a ExtentIndex
(there's an ExtentIndexImpl) that will do the testing for you, and it
does filtering on the front end to save the expensive checks for
later.

All of these classes are in the geo package.

Hope this helps,

Don

On Wed, Jun 2, 2010 at 7:25 AM, Sutphin, William B CIV NUWC NWPT
<william.sutphin_at_navy.mil> wrote:
> Hi
>
> I am doing a simulation that builds a beam pattern as a shape, moves the beam pattern around the surface and counts things inside.  The beam pattern is usually a "V" shape (depending on the horizontal beam width angle) and five degree segments that make the closing arc.  Profiling the application shows a lot of time spent figuring out if things are inside the polygon or not.
>
> Is there anyway I can speed this up?  I'm open to all ideas including accepting a little less accuracy in the "is inside" detections.  Also am not adverse to hacking the method to pass in more reusable objects.  A lot of things tend to be way out of the shape, so some early detection ideas might be good to avoid isPointInPolygon altogether.
>
> Thanks
>
> Bill Sutphin
>
>

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Jun 02 2010 - 07:59:33 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:09 EDT