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
878 stars 183 forks source link

AggregateError: Request failed / 416 (Range Not Satisfiable) #285

Closed Rskut closed 2 years ago

Rskut commented 2 years ago

Hi,

I'm getting the following error at a specific zoom level in OpenLayers using the new GeoTiff Source:

Uncaught (in promise) AggregateError: Request failed
    at BlockedSource.fetch (blockedsource.js?79f4:155:1)
    at async GeoTIFFImage.getTileOrStrip (geotiffimage.js?78f4:358:1)

I do convert the tiff images with gdal to epsg 3857, cog and I add overviews likes this:

gdalwarp -t_srs EPSG:3857 -r near -of GTiff source.tif target.tif
gdal_translate source.tif target.tif -co TILED=YES -co COPY_SRC_OVERVIEWS=NO -co COMPRESS=DEFLATE
gdaladdo  source.tif

I get the error code 416 (Range Not Satisfiable) as a response from my server at the specific zoom level, I'm not sure why he gets confused with the byte range, any idea?