Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Speeding up point-in-polygon

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


in reply to Re^2: Speeding up point-in-polygon
in thread Speeding up point-in-polygon

If you can reduce the data to cartesian coords. and the entire zone can reside into RAM, PDL is the faster solution.

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:

$area = $zone->slice("$xmin:$xmax,$ymin:$ymax"); $coord_points = wichND( $area );
Now, you will have the coords of all points into the $area:
@x_coords = list $coord_points->slice("(0),:"); @y_coords = list $coord_points->slice("(1),:");
This is the fast clipping method if you can reduce the data universe to cartesian coords.

And PDL is a C compiled library.


Comment on Re^3: Speeding up point-in-polygon
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2015-07-30 09:11 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 (270 votes), past polls