http://www.perlmonks.org?node_id=563147


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.