AIFDR/riab — Issue #155: New interpolation has index out of range in some case.
Author: uniomni
Created: 2011-10-18 07:43:24+00:00
State: open

E.g. running the earthquake ground shaking on OSM building test data gives the error below.
This is reproduced by the unit test: https://github.com/AIFDR/riab/commit/2d2c34f9f9a7a0c80ec95354f09d0c7598f49738

======================================================================
ERROR: test_earthquake_impact_OSM_data (__main__.Test_Engine)
Earthquake impact on OSM building data works
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_engine.py", line 427, in test_earthquake_impact_OSM_data
impact_fcn=IF)
File "/home/nielso/dev/riab/impact/engine/core.py", line 50, in calculate_impact
F = impact_function.run(layers)
File "/home/nielso/dev/riab/impact/plugins/earthquake/BNPB_earthquake_guidelines.py", line 61, in run
H = H.interpolate(E)
File "/home/nielso/dev/riab/impact/storage/raster.py", line 274, in interpolate
return interpolate_raster_vector(self, X, name)
File "/home/nielso/dev/riab/impact/engine/interpolation.py", line 168, in interpolate_raster_vector
return interpolate_raster_vector_points(R, P, name=name)
File "/home/nielso/dev/riab/impact/engine/interpolation.py", line 132, in interpolate_raster_vector_points
values = interpolate_raster(longitudes, latitudes, A, coordinates, mode='linear')
File "/home/nielso/dev/riab/impact/engine/interpolation2d.py", line 165, in interpolate_raster
res = interpolate2d(x, y, A, points, mode=mode, bounds_error=bounds_error)
File "/home/nielso/dev/riab/impact/engine/interpolation2d.py", line 117, in interpolate2d
x1 = x[idx]
IndexError: index 922 out of bounds 0<=index<922