pysal / tobler

Spatial interpolation, Dasymetric Mapping, & Change of Support
https://pysal.org/tobler
BSD 3-Clause "New" or "Revised" License
145 stars 30 forks source link

Faster raster #70

Closed knaaptime closed 4 years ago

knaaptime commented 4 years ago

need to do some more extensive profiling, i think, but this resolves #2

knaaptime commented 4 years ago

on second thought im not sure this first attempt will be faster because im rebuilding the table

renanxcortes commented 4 years ago

Could you make a benchmark comparing both performances? I think you could a small set of polygons.

knaaptime commented 4 years ago

will do. For now, i've just been running the dasymeric unit test, a la pytest tobler/tests/test_interpolators.py -k "masked", but i can add some more detailed tests.

currently, this PR helps us move to a single function rather than separating area_interpolate from _slow_area_interpolate but doesnt yield the performance boost. I'm still a little optimistic about the alernative approach i sketched out in the bottom of #2, so gonna continue exploring that

knaaptime commented 4 years ago

ok, i've been down several rabbit holes on this one and my current view is that we can't optimize our current implementation much more. Right now we're dealing with the raster side quite efficiently, and any speedups we might gain on the vector side by using area_tables_binning are far outweighed by the additional raster processing we need to get there

renanxcortes commented 4 years ago

Any advances in the scanlines approach?

knaaptime commented 4 years ago

no the scanlines stuff has been quiet for awhile, but this is a good reminder to revisit that stuff. Closing this as I'm confident i cant optimize until we get a really fast raster polygonizer