Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading files larger than 4gb? #402

Open
max-mapper opened this issue Nov 7, 2023 · 1 comment
Open

Reading files larger than 4gb? #402

max-mapper opened this issue Nov 7, 2023 · 1 comment

Comments

@max-mapper
Copy link

Sorry if this has been asked before, I searched and could not find it. Thank you for the great library. I have a BigTiff file that is 21GB. I can open it in QGIS and read it with gdal etc without a problem. But due to the 4gb limitation of ArrayBuffer I don't understand how to read it using geotiff.js, for example:

> new Uint8Array(new ArrayBuffer(4294967296))
Uint8Array(4294967296)

is ok but

> new Uint8Array(new ArrayBuffer(4294967297))
Uncaught RangeError: Invalid typed array length: undefined
    at new Uint8Array (<anonymous>)

throws an exception. It seems like this library is designed to load an entire file into a single ArrayBuffer, as opposed to being passed a file descriptor and reading the parts it needs into memory as needed, is that correct? If so, what is the point of BigTiff support if files larger than 4gb cannot be read? Thank you

@jcphill
Copy link
Contributor

jcphill commented Jan 26, 2024

You can use fromBlob() to load directly from a File object on demand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants