Skip to content

Instantly share code, notes, and snippets.

@justacec
Last active April 20, 2020 03:43
Show Gist options
  • Save justacec/e2e3346bd2b74821f24b4e25bdfcabe4 to your computer and use it in GitHub Desktop.
Save justacec/e2e3346bd2b74821f24b4e25bdfcabe4 to your computer and use it in GitHub Desktop.
Akima vs Interp Interpolation
library(sf)
library(sp)
library(akima)
library(interp)
load('depth_data.RData')
result = akima::interpp(sf::as_Spatial(grid_points), z='z', xo=sf::as_Spatial(line_points))
grid_coords = sf::st_coordinates(grid_points)
line_coords = sf::st_coordinates(line_points)
result2 = interp::interp(grid_coords[,1], grid_coords[,2], grid_points$z, line_coords[,1], line_coords[,2])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment