1

I am trying to write a python script with help of GDAL to a red point shapefile and considering a field value as z vales where I need interpolation to get raster with interpolated values. I am using scipy grid data for interpolation.

My interpolation code is:

zi = scipy.griddata((x, y), z, (xi, yi), method='cubic')

then I tried to write the interpolated data to raster and I got the following result as screen shot: enter image description here

It shows interpolation inside points. But, I want to interpolate my points to cover the whole rectangular space.

Does anyone have idea how it works?

whyzar
12.1k23 gold badges41 silver badges72 bronze badges
asked Oct 31, 2016 at 13:51

1 Answer 1

2

The function is interpolating only inside the convex hull of data points https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.griddata.html.

Here smoothing results from scipy griddata interpolatioin is an example about how to add extrapolation but I do not understand why to do so because extrapolated values are meaningless. But if you want, I suppose you can also fool the algorithm easily by adding fake points to the corners of your area of interest.

answered Oct 31, 2016 at 14:19

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.