Very large rasters

Jan 31, 2014 at 4:27 PM
So, I have a very large set of high resolution areal photos, that I'd like to use as background imagery on my Mapwin app. Problem is that if I try to load them, I crash the program (MapWindow GIS). So Looking for a solution, I was wondering if I need to manually load only those tiles that cover the specific area I'm viewing, or is there a more elegant solution?

Feb 3, 2014 at 6:38 PM
Edited Feb 3, 2014 at 6:38 PM
Hi Doug,

What file format are those photos?
Which version of MapWinGIS are you using?
You might want to try to create a VRT-file of your photos. This can be loaded as one image layer. The command is in the Utils class.
More about the VRT format:

At this moment we are in the process of updating MapWinGIS to use the latest supporting libraries. We're almost done. Then you should be able to load even more (and hopefully faster) image formats.

Feb 3, 2014 at 7:55 PM
They are Mr. Sid format, around 500 files totaling 9 GB in size (on disc).
Feb 4, 2014 at 10:48 AM
Hi Doug,

The MrSid format is one of the formats we'll be using new SDKs for.

But I'm not sure if loading 9GB at once is still a good idea. Did you look at the VRT option I mentioned?
This is an XML file which holds the filename and extents of the files and is smart enough to only load the files that are needed.

Feb 6, 2014 at 6:20 PM
Thanks for the response Paul. I'm not really sure how to deal with the VRT, but I think I can handle the concept of managing which tiles are needed and loading as necessary. The problem I'm running into now is that when I try to load a Mapwindow Project file that contains a couple Mr. Sid images, MapWin throws an "Exception in LoadRaster Function" and then my application crashes. I created the Mapwindow project in MapwindowGIS, (the desktop application) and it loads fine, but it crashes when I load it into MapWinGIS (ActiveX). Any ideas?
Feb 10, 2014 at 10:38 AM
Which version of MapWinGIS are you using? The current trunk version is not yet ready to load MrSid or ECW files.
We're working very hard on this.

Feb 10, 2014 at 3:14 PM
Feb 12, 2014 at 3:18 PM
Hi Paul,

Thanks for working on this, you (all) are doing a great service to the GIS community. One question, I thought that Mapwindow was constructed from MapWinGIS? If so, why is it that I can load the MrSid files in Mapwindow, but not MapWinGIS?

Feb 14, 2014 at 12:17 PM
Hi Doug,

You are right. If you can open your files in MapWindow Desktop you should be able to open them using MapWinGIS.
As long as you use the same versions!

So to summarize.
You can open the MrSid files in MapWindow but when opening them in your own code it is crashing. Am I right?
If so can you post your code to open the files?

Feb 14, 2014 at 3:21 PM
Edited Feb 14, 2014 at 3:23 PM
So, I am building a Mapwindow project, with multiple layers in it, formatted the way I want. I then load that project in my MapWinGIS application with the following line of code:

hndBasemap = mapObj.LoadMapState(FnDbFolderPath & "MapData\BaseMap16.mwprj", CallBack)

The program crashes on the above line of code with an "Exception in LoadRaster Function” error. I’ve tried stripping the project down to just a single MrSid file, and it still crashes. Doug