Problem loading raster files

Jul 21, 2014 at 8:29 AM

I´m facing the following problem. I am trying to load several raster files (*.tif). While using the .Net-Image-Library the memory consumption of DotSpatial is blown up until I get a "Memory Overflow Exception". Otherwise when using the GDAL-Plugin the colours of the images are shown wrong. The memory consumption is a little bit better but I`m not able to load more then 5 files each about 1 MB. Am I doing something wrong here? If not is there a way to support the development of this feature? Am I facing the same problem which is discussed here: Workitem 22214?

Many thanks and greets,
Jul 21, 2014 at 8:33 AM
Hello Martin,
5 files each about 1 MB - it is a not large files :) And DotSpatial must load even 100 files each 1 MB. The problem may be in another place.

Jul 21, 2014 at 8:46 AM
Thanks for your quick respond. That is what I was wondering about. Can you give me any hint what I can try now to understand the problem? I already tested differnent files with different formats und sizes. But I was not able to load more than 3 - 5 MB in sum. I already tested to load the files in MapWindow 4 which was no problem.

Jul 21, 2014 at 8:50 AM
What DS version are you using? Are you trying DemoMap application, or your own?
Jul 21, 2014 at 2:31 PM
I am using the DemoMap Application of Version 1.6
Jul 22, 2014 at 6:03 AM
I just loaded into 1.6 about 20 tiffs each about 4MB. Everything works fine. And total memory using is about 300MB.
Can you share your files, maybe something wrong with them? Also you can try version from latest source code, it contains some memory optimizations.
Jul 22, 2014 at 6:35 AM
Ok, I will try to use the latest source code. Thank you! I will give you feedback.
Jul 31, 2014 at 12:35 PM
Hi Maxim,

I have tried to load the files with the DemoMap Application Version 1.7. But I am still facing the same problems. I have also tried it on another machine. But no success. So I just mailed you some example files. I hope you can give me an hint where to search for a solution.

Thanks and greets,
Aug 1, 2014 at 12:53 PM
Hi Martin,

thanks for the files. Yes, you are facing the same problem which is discussed in issue 22214 (large rasters support).
At the moment DotSpatial not optimized to use large rasters. E.g. for your rasters from Example 3 folder (34005756.TIF, ...) the memory using for every file will be:
  1. (ncols * nrows) bytes for raster data (assuming that raster values has Byte type)
  2. (ncols * nrows * 4) bytes for raster image.
    So for 6299x6299 raster total memory using will be (6299 * 6299 * 5) bytes = 200 MB. So it is not surprising, that you are getting OutOfMemoryExceptions after 5-6 files.
At the moment you can try to use x64 PC with more RAM memory, or use rasters with less number of cells.

Aug 5, 2014 at 12:42 PM
Hi Maxim,

thank you very much for your great support! Then I will follow the discussion on issue 22214.