ThinkGeo.com    |     Documentation    |     Premium Support

GeoTiffRasterLayer - System.AccessViolationException

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

Hi Dennis,

Our developer will test MrSid with latest development version with your data under MapRasters2008 folder.

Regards,

Don

Hi Dennis,

Sorry for delay.
For the ‘the breakpoint in DrawCore does not get hit while panning the map’.
I have seen your code in the Post named ‘Jpeg2000RasterLayer - Does not Display’, attached shows that.
CodeSnippetJpeg2000RasterLayer.txt (1.8 KB)

I did some tests with our testing TIF Image (just one) and found the key code is ‘TheOverlayRaster.TileBuffer = 1;’, I guess this code cause the issue. Please remove it and try again.

The other issue is in progress, any updates will be updated here.
Thanks,
Emil

Emil,

I set TheOverlayRaster.TileBuffer = 0 and now panning from tile-to-tile works.

Thank you very much.

I’ll watch for what you have to say about the other issues.

Regards,
Dennis

Hi Dennis,

We are glad to hear that works.

Please let us know if you have any question.

Regards,

Don

Don,

It’s working on my WIndows-10 machine, but not under Windows-7.

So I still have to figure out what is going on there with the DLL’s.

Does ThinkGeo have any plans to maybe re-think the design of raster images in terms of the DLL’s? Just seems like this is a frequent issue with the DLL’s.

Thanks,
Dennis

Hi Dennis,

Yes, it looks there are some problem related with raster layer which render by the unmanaged dlls, but I think for 9.0 we don’t have a plan to change this design, for the coming 10.0 there are many changes, so we can think more about this problem after 10.0 release.

But I think I need to let our mangers know the question you asked, whether we can do some optimize about this architecture.

For the exception, our developer still working for it. Any update I will let you know.

Regards,

Don

Hi Don,

Thanks for the update, it all sounds good.

Dennis

Hi Dennis,

Our developer want to double check with the mainly question now, in this post we mentioned three issues:

  1. MrSid and GeoTiff panning issue, which won’t go into DrawCore. This should had been fixed by set TileBuffer equal 0, we tested it both for win7, win8 and win10. Our developer is doing further research about this problem, maybe we can do enhancement it when set TileBuffer.

  2. AccessViolationException issue for Geotiff, it looks for single file it had been fixed.

  3. JP2 open issue, in other post it had been tested and your data format looks don’t been supported now.

So the remain question now should be when open multiply Geotiff or supported JP2 files, your application still throw exception? If I missed information here please let me know.

Or some other further question about this problem please list to us.

Regards,

Don

Hi Dennis,

It’s proved to be a bug which should be fixed in the version 9.0.457.0. Please get it when it’s available and have a try again.

Thanks,
Peter