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.
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.
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.