CalCOFI / apps

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

map contour in db for speed and use in API and app #7

Open bbest opened 1 year ago

bbest commented 1 year ago

PROBLEM: map_contours() in R too slow

The calcofi4r::map_contours() (example, documentation) is finally the "right" level of detail to map interpolated values so as to show an overall trend. This moreso than earlier iterations of the app's map visualization using individual points of oceano app or interpolated rasters of oceano-demo as discovered through "co-design" with Jenn & Erin. However, the bivariate GAM smooth runs in R and this is slow to render: 5-20 seconds.

image

SOLUTION: ST_Contour() in Database

We could implement a button with an estimated progress bar, spinny wheel and/or ETA.

Or we could try run this in the database, which should be much faster:

bbest commented 5 months ago

Now noticing polygonize argument in ST_Contour(), but seeing potential issues / workarounds with its use:

See also: