You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is actually legal according to the tiff spec, but there seems to be some commonly used software around that produces such files - it simply omits the tile when it only contains nodata.
I have fixed this for our use case by adding this:
if (byteCount === 0) {
const outSize = this.planarConfiguration === 2
? this.getBlockHeight(y) * this.getTileWidth()
: this.getBlockHeight(y) * this.getTileWidth() * this.getSamplesPerPixel(\
);
const data = new ArrayBuffer(outSize);
const bytes = new Uint8Array(data);
bytes.fill(this.getGDALNoData());
return { x, y, sample, data};
}
in geotiffimage.jsgetTileOrStrip just before the fetch. This isn't quite correct - the type of the buffer should be correct for the sample - but it works for the files I've tested with.
Unfortunately I don't have an example file that I can share (and haven't figured out how to produce one).
The text was updated successfully, but these errors were encountered:
This feature was simply not yet requested, and I never came around to actually implement it. The solution you propose looks not too bad to me, I would be happy to accept it as a PR, if you'd like to create one. Of course, we would need to come up with a proper way to test this, though.
We regularly encounter geotiff files that geotiff.js cannot read (it throws an exception in
readRasters
).After some debugging it turns out that the problem is that these images contain tiles or strips with zero bytes:
I'm not sure if this is actually legal according to the tiff spec, but there seems to be some commonly used software around that produces such files - it simply omits the tile when it only contains nodata.
I have fixed this for our use case by adding this:
in
geotiffimage.js
getTileOrStrip
just before thefetch
. This isn't quite correct - the type of the buffer should be correct for the sample - but it works for the files I've tested with.Unfortunately I don't have an example file that I can share (and haven't figured out how to produce one).
The text was updated successfully, but these errors were encountered: