I get the included error message when trying to load several GeoTiffs. Any suggestions?
Thanks!
Matthew
ThinkGeo_GeoTiff_Error.zip (27 KB)
Barbate.zip (640 KB)
I get the included error message when trying to load several GeoTiffs. Any suggestions?
Thanks!
Matthew
ThinkGeo_GeoTiff_Error.zip (27 KB)
Barbate.zip (640 KB)
Hi Matthew,
I guess there should be something wrong with the tiff attached, when we check it with other GIS softwares, such as GlobleMapper and GeoTiffRasterLayer with “GeoTiffLibraryType = GeoTiffLibraryType.ManagedLibTiff”, we found there is a blank area where missing some data, just like the screenshot shown as following.
We will try doing some enhancements for “UnManagedLibTiff” here to make sure it doesn’t throw the exception in near feature, now can you load this image in “Managed mode”? Following is the demo code for it, please check it out:
Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.StandardColors.White);
Map1.CurrentExtent = new RectangleShape(-5.90956876844757,36.1838448826684,-5.85050239605152,36.1361871564141);
Map1.MapUnit = GeographyUnit.DecimalDegree;
GeoTiffRasterLayer gdiPlusImageLayer = new GeoTiffRasterLayer(@"C:\Barbate.tif", Map1.CurrentExtent);
gdiPlusImageLayer.UpperThreshold = double.MaxValue;
gdiPlusImageLayer.LowerThreshold = 0;
gdiPlusImageLayer.LibraryType = GeoTiffLibraryType.ManagedLibTiff;
Map1.StaticOverlay.Layers.Add(gdiPlusImageLayer);
The boundingBox of the image used for creating the instance of “GeoTiffRasterLayer” is calculated using “GetBoundingBox“ method with “Unmanaged” mode, because “Unmanaged Mode” support embedded tfw file.
Sorry for the inconvenience.
Thanks,
Johnny
Thanks for the input. It seems I have no way of knowing when this error dialog is going to happen so there isn't really anything I can do about it unless I use GeoTiffLibraryType.ManagedLibTiff for all geotiffs.
Is there a reason to use managed over unmanaged or vice-versa?
Hi Matthew,
The difference between the managed an unmanaged is that unmanaged is coded by c or c++, managed is coded by c#, therefore using unmanaged has faster speed. But in your situation, the tif image has some error which is posted in previous post, so the exception will be thrown by unmanaged, so the managed should be a walk-around here. We will try doing some enhancements for “UnManagedLibTiff” here to make sure it doesn’t throw the exception in near future.
Hope it helps.
Johnny