Re: [OpenMap Users] Speeding Up isPointInPolygon

From: Don Dietrick <dfdietrick_at_gmail.com>
Date: Wed, 2 Jun 2010 16:24:32 -0400

On Jun 2, 2010, at 3:24 PM, Sutphin, William B CIV NUWC NWPT wrote:

> Thanks
>
> Creating the BoundingCirle would have to be done every iteration of the simulation, correct? Because the location of the polygon moves as the sim progresses.

Yes.

>
> Do you mean by "bunch of polys" multiple polygons composing a single check? I have a single polygon for each track, and lots of independent tracks moving over a bunch of victims.

I did mean a set of polygons, but if they are all moving, I wouldn't use an ExtentIndex, since it would have to be reset when the polys changed position.

Also, I'd make sure that the BoundingCircles only get re-created if the track changes. The check for a point in a bounding circle is quick.

- Don


>
>
> Bill Sutphin
> Naval Undersea Warfare Center, Division Newport
> Bldg 1351, Room 211C
> Newport, RI 02841
> (401) 832-5813
> DSN 432-5813
>
>
>
>> -----Original Message-----
>> From: Don Dietrick [mailto:dfdietrick_at_gmail.com]
>> Sent: Wednesday, June 02, 2010 7:59
>> To: Sutphin, William B CIV NUWC NWPT
>> Cc: openmap-users_at_bbn.com
>> Subject: Re: [OpenMap Users] Speeding Up isPointInPolygon
>>
>> 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 - 16:25:08 EDT

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