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
845 stars 175 forks source link

tile cache probably never enabled, likely discarded if it was, and abort signal passed to options argument #382

Open jcphill opened 12 months ago

jcphill commented 12 months ago

The GeoTIFFImage constructor is passed this.cache by GeoTIFF.getImage(), which is set in the GeoTIFF constructor based its options argument, which is passed through by fromSource(), but which is not passed through by fromUrl(), fromCustomClient(), or fromUrls() as they pass their options argument only to makeRemoteSource() or makeCustomSource() and actually pass their signal argument as the second (options) argument of fromSource() so the signal argument isn't doing anything either.

It is possible to set cache=true on a GeoTIFF object after construction. But GeoTIFF.getImage() creates a new GeoTIFFImage object with an empty tile cache on every call and GeoTIFF.readRasters() doesn't re-use images so the cached tiles are are never accessed anyway.