If you can reduce the data to cartesian coords. and the entire zone can reside into RAM, PDL is the faster solution.
in reply to Re^2: Speeding up point-in-polygon
in thread Speeding up point-in-polygon
Example: If $zone is a piddle of bytes with an 1 where the point's coords, you can retrieve the coords of points into polygon's box limits with:
Now, you will have the coords of all points into the $area:
$area = $zone->slice("$xmin:$xmax,$ymin:$ymax");
$coord_points = wichND( $area );
This is the fast clipping method if you can reduce the data universe to cartesian coords.
@x_coords = list $coord_points->slice("(0),:");
@y_coords = list $coord_points->slice("(1),:");
And PDL is a C compiled library.