# Interpolation of data points

I have a layer of points that represent bus stops. Each point has a value (quality of service, between `0` and `100`). I need to create a grid (resolution `25m`) by interpolating the points values.

For each cell of the grid, I want to assign the value of the best surrounding stop (search radius of `500m`), but the values of the stops should decrease linearly with the distance between them and the grid cell (`-10%` every `100m`).

For example, a grid cell located `100m` away from a stop with value `30` and `200m` away from another stop with value `80` should have the value `64` (`80 - 0.2*80`). The bus stop with the bad value `30` has no impact on this cell.

I tried IDW interpolation but I'm not getting the result I expect. I'm using QGIS.

• In order to make it more complicated: How do you account for natural or artificial barriers, e.g. highways, or rivers? – Erik Mar 25 at 11:09
• Actually I don't ;) – Romain Mar 25 at 11:11
• If you don't, then both scientific and practical value of your map are at least to be doubted. – Erik Mar 25 at 11:23
• May be a possibility, but i don't have try, and not a lot elegant.. : 1. Create a grid (point with a distance of 25 m) 2. Calculate a distance matrix (N*kx3) betwen bus points and grid. 3. Join quality of service in the distance matrix. 4. Calculate a new field with something like CASE WHEN "Distance"<500 then "bus_stops_quality" -("Distance" * "bus_stops_quality" /1000) ELSE 0 END. 4.Join atttributes by location, select max values. – Christophe Mar 25 at 14:19
• Thank you Christophe, your solution is very interesting and suits my needs. I'm currently testing it. Could you develop how to select only the max values for each grid point ? Is it something you do during the attributes joining by location or an other step that you do after? – Romain Mar 25 at 16:17

For those who are interested on the solution, I tried what Christophe suggested, but with a minor modification. To summarize:

1. Create a grid and calculate a distance matrix between bus stops and grid points (only the closest 500 for each stop)
2. Join quality of service in the distance matrix and calculate a new field that accounts for the distance between stop and grid point
3. Export to CSV and use Python to eliminate duplicates and keep only the max value for each grid point
4. Load the new CSV in QGIS, join with grid layer and display the results!

The reason I did step 3 this way is that the attribute joining by location was far too slow to process with QGIS.