I am trying to add multiple raster files to winformsMap control. I am getting "Parameter is not valid" exception when trying to call "Refresh()" method. Can someone help me out to display multiple raster files (tiff files) with world files?
Here is my code
RectangleShape rectExtent = new RectangleShape(0.0, 0.0, 0.0, 0.0); foreach (string strFilename in strFileNames) { GdiPlusRasterLayer imageLayer = new GdiPlusRasterLayer(strFilename); imageLayer.UpperThreshold = double.MaxValue; imageLayer.LowerThreshold = 0; imageLayer.Open();
I can’t recreate your issue. I added 2 tif files and the map shows fine. Can you find out which tiff file, or which tiff files case that issue and send those files to me so we can recreate it here?
Thanks for the reply. Is my code provided in the original mail is correct? If so then I will send the tiff images I am trying to display. I am trying to display from the UNC path.
Your code is correct. I tried to open files in another machine with UNC paths and it worked fine. Are your files in a remote machine? If yes can you copy the file to your local machine and have a try first? There might have some issues when getting a remote file like does not have access permission or something.
Also there are some known issues about opening tiff files with Map Suite. There are several kinds of tiff files, though they are all suffixed with .tif, Map Suite might have issues dealing with one of them. So if problem still exists, please send your file(s) to support@thinkgeo.com and ask to forward to Ben, we will have a look here.
You didn’t send me the World Files so I created them myself. With the world files, your data works fine using the code in your original message. Here is the result and you can see the 2 pics are all added to map. You can change the position/size of the 2 images by modifying the World File. For more info about world file, please see here.
They are geotiff images and world file info is in the file. You use the listgeo utility on that file and it will list the world file info. Can MapSuite handle the cases where the world file is with in the file itself?