in reply to Speeding up point-in-polygon
- Install Math::Geometry::Planar
- Edit Planar.pm and add
use Memoize; memoize('CrossProduct');
- Buy more RAM :)
- Insert: "next polygon if point's coords are out of polygon's box limits" (2 conditionals)
- 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.
|
---|
In Section
Seekers of Perl Wisdom