Disclaimer: I have very little GIS experience
I've been working on a project in R that involves displaying large raster maps in an R Shiny interface. I am using the leaflet package for display. The displaying process (grabbing the raster from the stack, removing the old raster and adding the new one to the map) takes 4 or 5 seconds, and I'd like to bring that down as much as possible. The data is quite large, but it comes to me in small pieces, maybe keeping it in small pieces could be helpful.
I've already taken a few steps that speed up the display:
- I aggregate the data ahead of time so that I'm not aggregating when I display it
- I project the rasters for leaflet ahead of time so leaflet doesn't need to reproject when it displays them
- I set my <= 0 values to NA ahead of time (my values should be strictly positive, NA values should be transparent on the map)
This means there's no actual processing when the map is displayed, it's just the displaying itself that takes time.
People often ask why I don't "tile the data like google maps" and truthfully that's because I don't quite know what that means and couldn't figure it out online. To the best of my knowledge it lowers the resolution as you zoom out? That would be perfect for me, my data is large but you only need the high resolution once you're zoomed in to a specific area.