Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Speeding up point-in-polygon -- take two (Under 40 seconds!)

by BrowserUk (Pope)
on Aug 28, 2006 at 13:22 UTC ( #569979=note: print w/ replies, xml ) Need Help??


in reply to Speeding up point-in-polygon -- take two

The following shows the output from several runs of a benchmark looking up 5.25 million randomly generated points in a coordinate space of 5000x5000 that contains 1/4 million polygons:

c:\test>569929-b 1 trial of 5,25e6 points in 2.5e5 polys (33.094s total) c:\test>569929-b 1 trial of 5.25e6 points in 2.5e5 polys (36.656s total) c:\test>569929-b 1 trial of 5.25e6 points in 2.5e5 polys (33.250s total) c:\test>569929-b 1 trial of 5.25e6 points in 2.5e5 polys (35.094s total)

The program runs in under 40 seconds and requires ~100MB. No database.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: Speeding up point-in-polygon -- take two (Under 40 seconds!)
Download Code
Re^2: Speeding up point-in-polygon -- take two (Under 40 seconds!)
by punkish (Priest) on Aug 28, 2006 at 17:31 UTC
    > The following shows the output from several runs 
    > of a benchmark looking up 5.25 million randomly 
    > generated points in a coordinate space of 5000x5000 
    > that contains 1/4 million polygons:
    
    Ya but, are your polys regular? If so, that changes the whole game. It is because my polys are irregular that I have to do a definitive test of every point against all the vertices of every poly.

    Please post your code as it may really give me some great ideas.

    --

    when small people start casting long shadows, it is time to go to bed
      Ya but, are your polys regular?

      Using my method, this doesn't affect the performance.

      What does affect it is the size of the coordinate space and the minimum granularity of points.

      Update: I guess someone doesn't believe me ;)


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        > Update: I guess someone doesn't believe me ;)
        
        Only in a "Wow, that is unbelievable" kinda way. ;-).

        Knowing your experience, I am sure you have some seriously innovative mojo going on there. Please post your code. If I can use it, it will be a great help. Eventually I would release my set of scripts (which do much more than just point-in-polys) as an addition to the general set of Geo:: modules on CPAN.

        Many thanks,

        --

        when small people start casting long shadows, it is time to go to bed

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2014-04-20 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (488 votes), past polls