funkeinteraktiv / cogran

CoGran - A command line tool for combining data of different spatial granularity
109 stars 7 forks source link

use spatial index to speed up #34

Open fnorf opened 7 years ago

fnorf commented 7 years ago

I worked with rtree in Python recently so the logic was easy to transfer. Don't judge my code, I hate JavaScript and have no idea about anything. Please don't merge it like this, it looks ugly as hell. :]

Adds rbush as dependency!

Results seem identical up to 9-10 places so perfectly fine. https://gist.github.com/fnorf/38e789f37619f47dc9826d848546e1be

Before: real 3m37.833s user 3m39.787s sys 0m0.310s

After: real 0m34.675s user 0m35.260s sys 0m0.160s

Weeeeeeeeeeeeeeeeee! :))))))))))))