Open ukalpa opened 2 years ago
Have you solved this problem? I also met
I met the problem too
+1
+1
Hi all,
I had a similar problem:
Failed to read from url or blob tracker_data/sea_ice_conc_6km_cog/asi-AMSR2-s6250-20230208-v5.4.tif TypeError: Cannot read properties of undefined (reading 'offset')
at blockedsource.js:271:29
at Array.map (<anonymous>)
at BlockedSource.readSliceData (blockedsource.js:259:19)
at BlockedSource.fetch (blockedsource.js:160:17)
at async GeoTIFFImage.getTileOrStrip (geotiffimage.js:385:20)
at async Promise.all (:3000/index 110)
at async GeoTIFFImage._readRaster (geotiffimage.js:517:5)
at async GeoTIFFImage.readRasters (geotiffimage.js:611:20)
I patched this problem for me by subtracting one from the high block id at line 262:
diff --git a/node_modules/geotiff/dist-module/source/blockedsource.js b/node_modules/geotiff/dist-module/source/blockedsource.js
index 5630efb..8099b16 100644
--- a/node_modules/geotiff/dist-module/source/blockedsource.js
+++ b/node_modules/geotiff/dist-module/source/blockedsource.js
@@ -262,7 +262,7 @@ export class BlockedSource extends BaseSource {
top = Math.min(this.fileSize, top);
}
const blockIdLow = Math.floor(slice.offset / this.blockSize);
- const blockIdHigh = Math.floor(top / this.blockSize);
+ const blockIdHigh = Math.floor((top-1) / this.blockSize);
const sliceData = new ArrayBuffer(slice.length);
const sliceView = new Uint8Array(sliceData);
I think when the requested slice was an exact number of blocks, it would give this error because it was trying to request one more block than needed.
Problematic file is at https://data.seaice.uni-bremen.de/amsr2/asi_daygrid_swath/s6250/2023/feb/Antarctic/asi-AMSR2-s6250-20230208-v5.4.tif
+1
I am trying to parse Geotiff data from SRTM (https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/TIFF/srtm_21_06.zip), I can get tiff and image object following the guide however it pops the below error message when calling readRasters, I appreciate for any suggestions.
Source Code:
Error Info: