geotiffjs / geotiff.js

geotiff.js is a small library to parse TIFF files for visualization or analysis. It is written in pure JavaScript, and is usable in both the browser and node.js applications.
https://geotiffjs.github.io/
MIT License
859 stars 179 forks source link

angular 10 use pool option is worse then not use #351

Open zipporaSay opened 1 year ago

zipporaSay commented 1 year ago

Hi, I use geotiff to fetch tiff file , read bbox , and rasters - use them to display on mapbox canvas image.readRasters is so much slow. i want to use pool option to improve parsing performance but it's not working: use pool option is worse then not use

I would appreciate advice on improving the performance of image.readRasters. thanks

constantinius commented 1 year ago

Hi @zipporaSay

Using a pool will only improve performance if a CPU intensive compression is used inside the GeoTIFF you are parsing. If no compression is used, then you will likely see no performance improvement, or even a worse performance.

To best improve the performance is to a) optimize the file itself and b) only read portions of the file that you actually need.

a) is best achieved by transforming it to a COG, which you can do using GDAL and b) by using the window or bbox parameter of the readRaster method.

Hope this helps.