CalCOFI / apps

Shiny app demo for CalCOFI
https://calcofi.io
MIT License
0 stars 0 forks source link

speed up oceano app #22

Open bbest opened 11 months ago

bbest commented 11 months ago
bbest commented 11 months ago

Current approach

Pull all point data from database into R to interpolate to raster before creating contour polygons:

  1. apps:oceano/server.R get_map_data
  2. https://github.com/CalCOFI/apps/blob/b6cafea9a38ccdc243164de2e6078c0fb956f46d/libs/functions.R#L384
  3. calcofi4r::pts_to_rast_idw()

New approach

Generate interpolated raster in the database and the contour polygons in R using previous attempt (that was successful and fast with interpolation to raster, but wonky with contour creation):

https://github.com/CalCOFI/apps/blob/b6cafea9a38ccdc243164de2e6078c0fb956f46d/libs/functions_pgidw.R#L31-L225