ThinkGeo.com    |     Documentation    |     Premium Support

GeoTiffRasterLayer - System.AccessViolationException

MapSuite Team,

I am encountering AccessViolationException when attempting to open multiple TIF images under Windows-7. I had this issue once before and it was resolved with a bug fix you had made July 24, 2015. Under Windows-7 the exception is encountered as soon the application attempts to open multiple TIF’s.

Under Windows-10 it is a little different. When I set the LayerOverlay to Multiple the application will work for a while and then will encounter an exception of “Attempted to read or write protected memory”.

Under Windows-10 if I set the LayerOverlay to Single it will not encounter an exception.

I am currently running under V9.0.0.190.

The exception is occurring when invoking the Open. The exception occurs inside the MapSuite level and I am unable to trap the exception in any way. So when the exception is encountered Windows simply states that the application has encountered an error.

Attached are the exception logs for both the above cases.

Would you tell me what the latest DLL’s that are required for TIF? Would you send those to me for X86 and please send them as individual DLL’s and not in an msi file?

Regards,
DenniTiffImageProtectedMemoryCrash.txt (3.3 KB)TifImageCatalogMemoryAccessViolation.txt (11.1 KB)s

Hi Dennis,

I get response from our developer, please try to use ManagedGeoTiffRasterLayer in our Developement package to render your tiff file.

Our developer enhancement tiff in this version and this will be sync to release package when 10.0 release.

So please download the latest development package from our product center, then call ManagedGeoTiffRasterLayer instead of UnmanagedGeoTiffRasterLayer and try again.

Regards,

Don

Don,

Glad to hear there is a fix for this.

But I’m confused as to what I need to do. I currently use GeoTiffRasterLayer and then set TheGeoTiffRasterLayer.LibraryType = GeoTiffLibraryType.UnmanagedLibTiff;

I will be receiving a new set of TIF’s that have the World Files. Will ManagedGeoTiffRasterLayer work in my case?

Does ManagedGeoTiffRasterLayer replace GeoTiffRasterLayer?

Instead of me downloading the Development would you be kind enough to send me the DLL’s that I should be using? Or are you saying I need the whole Development build?

When will this be available in a V9.0.0.??? Production Build because I wanted to update to the latest anyway?

Thanks,
Dennis

Hi Dennis,

  1. I think ManagedGeoTiffRasterLayer can works well for the tiff file if the old UnmanagedLibTiff mode can open them.
  2. That’s not “replace”, just because the render logic get enhancement in Managed lib.
  3. Download dll package from product center is enough.
  4. Because it’s a big change, so I think it can only be found in 10.0 release this year.

Regards,

Don

Don,

When you say to “download dll package” do you mean to download/install the latest Development release and then reference all the standard DLL’s from the Development release?

Thanks,
Dennis

Hi Dennis,

If you open our product center, you can find the daily build package at the middle right side:

Unzip the daily build package, then you can directly reference the dlls in it. Or you can replace them to your original dlls.

Regards,

Don

Thank you Don. I thought that’s what you meant and I just wanted to make sure I had it right.

Looks like 9.0.0.401 will be the last release for V9 as it has a release date of 7/31/2016.

Dennis

Hi Dennis,

Yes, the 401 should be the latest version you can download.

Regards,

Don

Don,

I downloaded/extracted V9.0.408.0.

Do I also need any of the DLL’s that are typically found in C:\Windows\SysWOW64\Map Suite 9.0? Specifically the contents of theGeoTiffX86 & GeoRasterX86 directories? if so how do I get those?

Thanks,
Dennis

Hi Dennis,

The dlls in system folder is unmanaged dlls, you are using ManagedGeoTiffRasterLayer now, so update the referenced dlls is enough.

If you want to update the dlls under system folder, we have a unmanaged setup msi, it’s contained in our installer, so reinstall our latest version can make it update. If you have some special requirement about this msi, please let us know, we can provide you the download link.

Regards,

Don

Don,

I’m now using V9.0.408.0 in my application and it appears to basically work, at least so far it is not encountering any exceptions. However, I have more testing to do to ensure it is okay.

There is an issue though. The issue is that when a TIF is displayed in the visible extent and you then go to pan, the map is not automatically refreshing. So the image is not displayed where you’ve panned to. If at this point you do a zoom out the map is refreshed and the image is displayed. But pan again and the map is not refreshed. This issue is not in V9.0.0.190.

The above issue now occurs with my MrSid Raster.

What do you think?

Thanks,
Dennis

Hi Dennis,

We tested to render a GeoTiff file with GeoTiffRasterLayer under Managed mode, which works well when pan, it will automatic refresh. The dll version is the latest development version. So it looks we cannot reproduced it.

Have you tried to reproduce that in a simple sample?

Regards,

Don

hi Don,

The opening/rendering of a single TIF image works fine. I’m actually opening a Raster Catalog where I have prebuilt a spatial index. I have set a break-point in the protected override void DrawCore method. When the map is initially displayed the breakpoint gets hit, when a zoom in/out is performed the breakpoint gets hit. However, on pan the breakpoint does not get hit.

I’m using V9.0.408.0.

Your thought?

Thanks,
Dennis

Don/Emil,

Any thoughts on this issue?

Thanks,
Dennis

Hi Dennis,

This situation you mentioned we also cannot reproduce.

Please see my test code as below:

    public class MyGeoTiffRasterLayer : GeoTiffRasterLayer
{
    public MyGeoTiffRasterLayer(string imagePathFilename)
        : base(imagePathFilename)
    {
    }

    protected override void DrawCore(GeoCanvas canvas, Collection<SimpleCandidate> labelsInAllLayers)
    {
        System.Diagnostics.Debug.WriteLine("DrawCore works");
        base.DrawCore(canvas, labelsInAllLayers);
    }
}

 private void WpfMap_Loaded(object sender, RoutedEventArgs e)
    {
        wpfMap1.MapUnit = GeographyUnit.DecimalDegree;

        MyGeoTiffRasterLayer gtrl = new MyGeoTiffRasterLayer(@"Your GeoTiff");
        gtrl.LibraryType = GeoTiffLibraryType.ManagedLibTiff;

        LayerOverlay layerOverlay = new LayerOverlay();
        layerOverlay.TransitionEffect = TransitionEffect.None;
        layerOverlay.Layers.Add("WorldLayer", gtrl);
        wpfMap1.Overlays.Add("WorldOverlay", layerOverlay);

        gtrl.Open();
        wpfMap1.CurrentExtent = gtrl.GetBoundingBox();
        wpfMap1.Refresh();
    }

The breakpoint in DrawCore will be fired whenever zoom in/out or pan.

Could you please double check that? I think sometimes if you pan very near distance, maybe DrawCore won’t been hit, because which area had been drawn but hadn’t included in current extent.

Regards,

Don

hi Don,

Your example code uses only one TIF Image. My application uses 1,240 TIF Images. With one image it works fine. But with more than one when a new image has to be brought in while panning it does not work (no breakpoint on DrawCore). Again, when a Zoom In/Out is performed then the breakpoint at DrawCore is hit and the TIF image is opened and drawn.

So the issue presents itself when panning from one TIF Image to another, so to speak.

My application actually works under Windows XP, but not under WIn-7 or Win-10.

Attached is a text file which contains the textual version of my spatial index for the TIF Images. This is then loaded into a spatial index when OpenCore is invoked.

Dennis

RasterCatalogGeoTif20160811.txt (172.8 KB)

Don,

I may have mentioned before that this issue with Panning now is an issue with my MrSid Rasters. My MrSid Rasters work fine with V9.0.0.190, but not with V9.0.408.0. And it’s all the same code, I’m just compiling with different MapSuite DLL’s.

Dennis

Hi Dennis,

I am a little confused now, please let me know whether I misunderstand the issue:

When panning between with multiply GeoTiff files(or MrSid files), the overrided DrawCore function won’t be executed sometimes.
For Mrsid the 9.0.0.190 works well but 9.0.408.0 not. For Geotiff both of them don’t works correct.
And it can be reproduced under windows XP.

Today I tried to find more test data but hadn’t get them, could you please upload a few files which can be tested for the issue?

Thanks,

Don

Don,

Yes, when panning across multiple GeoTiff or MrSid DrawCore is never invoked. Only invoked on Zoom In/Out. MrSid works under 9.0.0.190 for XP, Win-7, & Win-10. GeoTiff works under XP only with 408.

I had previously uploaded 16 MrSid’s which you will find under my OriStarMapping account under /OriStar/Chicago/OriStarVisionMapSuite/MapRasters2008.

Dennis

Don,

I’ve uploaded my Visual Studio prototyping application to the ThinkGeo File Station. You will find it under OriStarMapping–>Applications–>OriStarRaster.zip. There is some documentation for it in the Documentation directory. This application is used to prototype Raster Images and so is coded now to handle MrSid, TIF, and JP2.

Would you look at it please and see with your DLL’s if it will load the various rasters?

All of my MrSid rasters are there as well under OriStar/Chicago/OriStarVisionMapSuite/MapRasters2008. There are a few TIF’s under …\MapRasters2010, and at least one JP2 under …\MapRasters2014. I’m attempting to upload another JP2, but it is nearly 4GB so taking a long time.

Thanks,
Dennis