NCC-CNC/wheretowork

potential speedup for rendering rasters?

Closed this issue · 2 comments

I stumbled across the leafem::addGeoRaster() function (see https://www.rdocumentation.org/packages/leafem/versions/0.2.0/topics/addGeoRaster) which claims to provide optimized rendering for large raster datasets. It would seem that it functions as a drop-in-replacement for leaflet::addRasterImage(), so using it should hopefully not be too tricky? When you get a chance @DanWismer, this might be worth looking into?

Was the pane argument native to leaflet::addRasterImage ?

x <- leaflet::addRasterImage(
map = x,
x = d,
opacity = 0.8,
project = project_on_fly,
maxBytes = 1 * 1024 * 1024, # 1MB max size
method = self$legend$get_resample_method(),
colors = self$legend$get_color_map(),
group = id,
pane = pane_id
)

I tried this, but it was mapping the rasters incorrectly.