ThinkGeo.com    |     Documentation    |     Premium Support

Tiff Exception on 9.0.0.541

I’m trying to open TIFF file and throw the following exception:

My MapSuiteCore version is 9.0.0.541

Please fin a sample file in the attachment.

Exception classes: 
   System.IO.FileNotFoundException
   System.Reflection.TargetInvocationException

Exception messages: 
   The file specified does not exist.
   An exception occurred during the operation, making the result invalid.  Check InnerException for exception details.

Stack Traces:
   at xRM=.NSs=.fSs=(String pathFileName)
   at ThinkGeo.MapSuite.Core.GdiPlusRasterSource.OpenCore()
   at ThinkGeo.MapSuite.Core.RasterSource.Open()
   at ThinkGeo.MapSuite.Core.Layer.Open()
   at Core.Contract.Sources.RasterSource.CalculateExtend() in D:\Development\Core\Core.Contract\Sources\RasterSource.cs:line 49
   at Core.Contract.Sources.RasterSource.Initialise() in D:\Development\Core\Core.Contract\Sources\RasterSource.cs:line 77
   at Core.Contract.Sources.RasterSource..ctor(String[] filePaths, ProjectionArgs projectionArgs) in D:\Development\Core\Core.Contract\Sources\RasterSource.cs:line 30
   at Core.ViewModel.MainViewModel.<>c__DisplayClass197_0.<CombineSource>b__0(Object sender, DoWorkEventArgs e) in D:\Development\Core\Core\ViewModel\MainViewModel.cs:line 1106
   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
--- Next Call Stack:
   at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
   at Core.ViewModel.MainViewModel.<>c__DisplayClass197_0.<CombineSource>b__1(Object sender, RunWorkerCompletedEventArgs e) in D:\Development\Core\Core\ViewModel\MainViewModel.cs:line 1123
   at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

HY31.zip (1.3 MB)

Hi Behnam,

I opened your tiff file succeed, I think you should want to update your unmanaged dlls. Please download this package then install it and try again:

https://ap.thinkgeo.com:5001/sharing/obwwfTvI2

Regards,

Don

Hi Don,

Thanks for your reply, I have installed the package and the problem still exists.
how can I become sure the application using new API?

Hi Behnam,

Please try using development branch and have a try again.

Thanks,
Peter

Hi,

I have downloaded WpfDesktopEditionFull9.0.602.0DllPackage.zip and the problem still exist.

Regards,
Behnam

Hi Behanam,

Please show us your render code.

I want to test that with your code and your data.

Regards,

Don

Hi,

Please check the attached project.
the app has two buttons which one working and one not working and searching for tfw file which doesn’t exist on new tiff format.

Regards,
Ben

ps: It seems there is a problem to attach a file. so this is my code, and you can use sample file i have attached in the past:

var layer = new GdiPlusRasterLayer(@"D..\..\Sample\HY31.tif") { LowerThreshold = 0, UpperThreshold = double.MaxValue };
            var staticOverlay = new LayerOverlay()
            {
                TransitionEffect = TransitionEffect.None,
                TileType = TileType.SingleTile
            };
            staticOverlay.Layers.Add("layer", layer);
            WpfMap.Overlays.Add(staticOverlay);


            layer.Open();
            WpfMap.CurrentExtent = layer.GetBoundingBox();
            layer.Close();

            WpfMap.Refresh();

Hi Behnam,

I found the reason of your exception, that’s because your tiff file don’t have its TFW file.

If you use my code as below, that will works well:

            Map1.MapUnit = GeographyUnit.Meter;

        var layer = new GeoTiffRasterLayer(@"HY31.tif");
        var staticOverlay = new LayerOverlay()
        {
            TransitionEffect = TransitionEffect.None,
            TileType = TileType.SingleTile
        };
        staticOverlay.Layers.Add("layer", layer);
        Map1.Overlays.Add(staticOverlay);


        layer.Open();
        Map1.CurrentExtent = layer.GetBoundingBox();
        layer.Close();

        Map1.Refresh();

Regards,

Don

Hi,
Create it’s working.

It would be nice if GdiPlusRasterLayer internally manages this and support all raster files.

Regards,
Ben

Hi Behnam,

Thanks for the suggestion, we will keep enhancement our product.

Regards,

Don