Question: What is the best way to calculate inverted distance interpolation (IDW) in Python for point locations?
Some details: I am currently using RPy2 to interact with R and its gstat module. Unfortunately, the gstat module conflicts with arcgisscripting, which I encountered when running RPy2-based analysis in a separate process. Even if this problem is resolved in a recent / future version, and the performance can be improved, I still want to remove my dependency on installing R.
The gstat site provides a standalone executable that is easier to package with my python script, but I still hope for a Python solution that does not require writing to disk many times and running external processes. The number of calls to the interpolation function, individual sets of points and values, can come close to 20,000 in the processing that I perform.
I especially need to interpolate the points, so using the IDW function in ArcGIS to generate raster sounds is even worse than using R in terms of performance ..... unless there is a way to effectively mask just the points I need. Even with this modification, I would not expect the performance to be so great. I will consider this option as another alternative. UPDATE: The problem is that you are tied to the size of the cell you are using. If you reduce the cell size to get better accuracy, processing takes a lot of time. You also need to keep track of item extraction ..... throughout the ugly method if you want values ββfor specific points.
I looked through the meager documentation , but it doesn't seem like there is a direct way to calculate IDW.
I am thinking about doing my own implementation, perhaps using some functionality to find the nearest points and calculate distances.
Am I missing something obvious? Is there a python module that I haven't seen that does exactly what I want? Is creating my own scipy implementation a wise choice?
python numpy scipy interpolation spatial
Michael A. Jackson Jun 23 '10 at 7:18 2010-06-23 19:18
source share