Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Speeding up point-in-polygon

by explorer (Chaplain)
on Jul 23, 2006 at 19:10 UTC ( #563147=note: print w/ replies, xml ) Need Help??


in reply to Speeding up point-in-polygon

  1. Install Math::Geometry::Planar
  2. Edit Planar.pm and add
    use Memoize; memoize('CrossProduct');
  3. Buy more RAM :)
  4. Insert: "next polygon if point's coords are out of polygon's box limits" (2 conditionals)
  5. Use the isinside function of Math::Geometry::Planar.

Update: Added the 'point out of the box' line.
Update: I used this solution the last year. Other solution is to use the clipping routines of GPC library (in CPAN also) or use Inline::C.


Comment on Re: Speeding up point-in-polygon
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://563147]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2015-07-31 04:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls