GeoTIFF / georaster-layer-for-leaflet

Display GeoTIFFs and soon other types of raster on your Leaflet Map
https://geotiff.github.io/georaster-layer-for-leaflet-example/
Apache License 2.0
283 stars 57 forks source link

Heavy memory usage on small CoG (Tiffs) files #143

Open cr3a7ure opened 3 months ago

cr3a7ure commented 3 months ago

Describe the bug I am noticing great memory usage when loading even small COG files in the band of 3~6MB. I see a bump up to 300MB in memory usage after loading on map just one COG. In my scenario I have to interchange between a lot small TIFF files loaded. This results to great memory overhead, which might lead to possible crash.

My files are required to have a good resolution at zoom level of 21 in order to see some details. As such I am using resolution: 256. Can I do something to reduce the memory overhead with preprocessing of data? ( gdal, or other COG related tools ).

Also the zoom in/out in high zoom values ( 19~21) is not smooth. Is this something within tool limits? Is there space of optimization within the code to try to spent some time on?

I am using nuxtJS ( vueJS 3) without the vuejs-leaflet module.

To Reproduce Steps to reproduce the behavior:

  1. Load a COG file to the map
  2. Navigate to the browsers developer tools and take a memory snapshot.

Expected behavior A multiplier for 3MB tiff file could be in the range of 10X but not 100X in memory consumption.

Screenshots Soon to come

Desktop (please complete the following information):