Running into process out of memory on readRGB
See original GitHub issueHi, I’m trying to convert a GeoTIFF to PNG, and I’m getting the error message “FATAL ERROR: v8::ArrayBuffer::New Allocation failed - process out of memory” when I call the readRGB function. I’m doing this on the back-end (Node-Server):
The size of the tiff-file is about 700 MB.
Here is a code-snippet:
const tiff = await geotiff.fromArrayBuffer(fileProm.buffer);
const image = await tiff.getImage();
const width = image.getWidth() as number;
const height = image.getHeight() as number;
const geoKeys = image.getGeoKeys();
console.log('height:', height);
console.log('width:', width);
const rgb = await image.readRGB();
console.log('rgb:', rgb);
console.log result for the size is:
height: 25576 width: 27035
I don’t get a result from the last console.log.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to solve process out of memory in Node.js | by Vuong Tran
This error occurs when the memory allocated for the execution application is less than the required memory when run application.
Read more >Node JS Process out of memory [closed] - Stack Overflow
I am using forever JS to run my node JS server continuously, however occasionally the server crashes and site goes down for some...
Read more >Running out of memory – General - Astro Pixel Processor
I am having memory exhaustion issues when working with larger mosaic projects, and hoping for some guidance.
Read more >How to read and captures an image directly from a
Then you can read the file with the function READRGB. Then you can process the image data. It's more challenging, though I think...
Read more >Out of memory error at train network · Issue #662 - GitHub
Hi, I'm getting an out of memory error when I try to train the network, using either my data or the example data...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m talking about the Image itself. Actually, it does not make sense to move tiff images around the map but yeah. My current solution is f. e. to move the image I have to calculate a new extent or to rotate I have to rotate the projection of the layer source etc. I would try that with the tile layer too. Thank you so far.
I’m sure that the user would like to see the whole TIFF file, but unless he has some very, very expansive hardware he will not be able to. Usual screen resolutions are something like 1920x1080, which is 2 million pixels, so around 0.3% of your image. What I’m trying to say is that it is not possible to visualize the whole image in a single pass.
I’m not sure of your use-case, but typically when you have such a large image it is adviseable to read the image piecewise, and use a mapping library to allow users to zoom and pan around in your image. OpenLayers recently has added support for geotiff.js and there are some examples there on how to use it: https://openlayers.org/en/latest/examples/cog-overviews.html
I’ll close this image now as it is unrelated to geotiff.js. Feel free to still ask questions here.