ThinkGeo.com    |     Documentation    |     Premium Support

The input GeoImage object is not a valid GeoImage type

Hi,

I am having an odd exception thrown that I do not know what the cause is. I am using Desktop Edition with WorldMapKit both 10.2 (and I am using Nuget Package Manager to stay updated). This issue only appears when zoomed in and ONLY on one layer. I have broken out the tables of the WorldMapKit into their own layers. Here is the exception and the call stack (some other debug information).

Request Drawing Transportation Exception thrown: 'System.ArgumentException' in ThinkGeo.MapSuite.dll The input GeoImage object is not a valid GeoImage type. at ThinkGeo.MapSuite.ValidatorHelper.CheckGeoImageIsValid(GeoImage image, String parameterName, GeoCanvas canvas) at ThinkGeo.MapSuite.Drawing.GeoCanvas.DrawWorldImage(GeoImage image, Double centerXInWorld, Double centerYInWorld, Single widthInScreen, Single heightInScreen, DrawingLevel drawingLevel, Single xOffset, Single yOffset, Single rotateAngle) at /hs=.GUQ=.DrawCore(IEnumerable`1 features, GeoCanvas canvas, Collection`1 labelsInThisLayer, Collection`1 labelsInAllLayers) at ThinkGeo.MapSuite.Styles.Style.Draw(IEnumerable`1 features, GeoCanvas canvas, Collection`1 labelsInThisLayer, Collection`1 labelsInAllLayers) at ThinkGeo.MapSuite.Styles.CompositeStyle.DrawCore(IEnumerable`1 features, GeoCanvas canvas, Collection`1 labelsInThisLayer, Collection`1 labelsInAllLayers) at ThinkGeo.MapSuite.Styles.Style.Draw(IEnumerable`1 features, GeoCanvas canvas, Collection`1 labelsInThisLayer, Collection`1 labelsInAllLayers) at ThinkGeo.MapSuite.Styles.ValueStyle.DrawCore(IEnumerable`1 features, GeoCanvas canvas, Collection`1 labelsInThisLayer, Collection`1 labelsInAllLayers) at ThinkGeo.MapSuite.Styles.Style.Draw(IEnumerable`1 features, GeoCanvas canvas, Collection`1 labelsInThisLayer, Collection`1 labelsInAllLayers) at ThinkGeo.MapSuite.Styles.CompositeStyle.DrawCore(IEnumerable`1 features, GeoCanvas canvas, Collection`1 labelsInThisLayer, Collection`1 labelsInAllLayers) at ThinkGeo.MapSuite.Styles.Style.Draw(IEnumerable`1 features, GeoCanvas canvas, Collection`1 labelsInThisLayer, Collection`1 labelsInAllLayers) at ThinkGeo.MapSuite.Layers.ZoomLevel.DrawCore(GeoCanvas canvas, IEnumerable`1 features, Collection`1 currentLayerLabels, Collection`1 allLayerLabels) at ThinkGeo.MapSuite.Layers.ZoomLevel.Draw(GeoCanvas canvas, IEnumerable`1 features, Collection`1 currentLayerLabels, Collection`1 allLayerLabels) at ThinkGeo.MapSuite.Layers.FeatureLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers) at ThinkGeo.MapSuite.Layers.StiSqliteFeatureLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers) in *ObfuscatedFilePath*\StiSqliteFeatureLayer.cs:line 736 11/1/2017 6:07:35 PM: ThinkGeoMapControl - Drew Transportation Request Drawing Construction 11/1/2017 6:07:36 PM: ThinkGeoMapControl - Drew Construction Request Drawing Boundaries 11/1/2017 6:07:36 PM: ThinkGeoMapControl - Drew Boundaries Request Drawing Poi 11/1/2017 6:07:36 PM: ThinkGeoMapControl - Drew Poi Request Drawing Labels 11/1/2017 6:07:37 PM: ThinkGeoMapControl - Drew Labels

Here is my code:

protected override void DrawCore(GeoCanvas canvas,
Collection labelsInAllLayers)
{
try
{
FeatureSource.Projection.Open();
try
{
DrawingExceptionMode = Drawing.DrawingExceptionMode.DrawException;
base.DrawCore(canvas, labelsInAllLayers);
}
catch (Exception e)
{
Debug.WriteLine(e.Message);
Debug.WriteLine(e.StackTrace);
}
}
catch (Exception e)
{
Debug.WriteLine(e.Message);
Debug.WriteLine(e.StackTrace);

       }
        
    }

There is some extra try catch for debugging purposes. The extra drawingexceptionmode was to try to force the map to draw the exception, but it does not change whether the exception is thrown or not. Zooming out causes the exception to go away. EDIT: I should have mentioned that the same canvas is used for all layers, and the same canvas apparently passes validation for the other layers at the same zoom as the one layer throwing the exception.

Lastly, I did move this code unchanged from one computer to another. The old computer did not have this issue. The map data was copied to the exact same location from the old computer to the new. I’m not sure what the missing factor is that is causing this exception to be thrown by one layer but only when zoomed in. The exception is not being thrown in code that I have control over. I’m having trouble figuring this one out. Any assistance would be appreciated.

Hi Brandon,

Thanks for your detail description, just like you mentioned, that’s only in one special machine and when zoom in to special layer, so it’s hard to be reproduced in our side.

From your exception, it looks that’s caused by the input image cannot pass validation, if you can easily reproduce that in your new machine, please double check which level it’s thrown, and whether that only be thrown in some special area on map. So we can guess what’s the reason of it.

For now, it looks your workdmapkit is the sqlite version, so you can make sure whether the Sqlite(data provider) is the same copy, then please check all the dll versions include the dlls in system folder, I am not sure whether you copy them at the same time or reinstall the same version of our product in new machine.

After that, you can comment the code which add the other layers into map, just keep the problem layer, which can be helpful for exclude confounding factors, then you can show us which layer it is and view it’s code to make sure whether it need render some special image for example some icon as label.

Any update please let us know.

Regards,

Ethan

Okay, I managed to figure this thing out. All the evidence did seem to point to some environment problem, but I just couldn’t see what was different. I was hoping the error might trigger a memory in someone who ran into the same issue.

It turns out that the icons folder wasn’t moved to the new output location. I forgot that the transportation layer uses icons as well. I thought it was only the POI layer so I didn’t think it would be missing icons that could cause an issue. The error message wasn’t all the helpful, but I am guilty of that myself.

Thanks for your assistance. Hopefully, this will help someone else.

Hi Brandon,

Thanks for your share and suggestion, I think our developer will try to make the exception information shows more exact in future version.

Please keep support our product and any question please let us know.

Regards,

Ethan