ThinkGeo.com    |     Documentation    |     Premium Support

Exceptions when panning

We are getting a couple of exceptions thrown when panning around the map. This appears to be related to enabling caching.


"A generic error occurred in GDI+."


   at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)

   at System.Drawing.Image.Save(String filename, ImageFormat format)

   at ThinkGeo.MapSuite.DesktopEdition.ClientCache.SaveImageToCache(Image image, String filename)

   at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.x17dceb203ee9599b(GeoCanvas x31c084515ae9393f, Boolean xa37df917bc29073e)

   at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.xbe0da0c2fd06aa90(GeoCanvas x31c084515ae9393f, Boolean xa37df917bc29073e)

   at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas)

   at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas)

   at ThinkGeo.MapSuite.DesktopEdition.xf0380b1a0bc40ca6.StartDraw()

   at ThinkGeo.MapSuite.DesktopEdition.x601a5561df898600.x7510a5c148e0acfd(Object x19b0b2213afc2289)

   at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)

   at System.Threading.ExecutionContext.runTryCode(Object userData)

   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)

   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)

   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)


AND ALSO


"Parameter is not valid."




   at System.Drawing.Bitmap..ctor(String filename)

   at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.x17dceb203ee9599b(GeoCanvas x31c084515ae9393f, Boolean xa37df917bc29073e)

   at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.xbe0da0c2fd06aa90(GeoCanvas x31c084515ae9393f, Boolean xa37df917bc29073e)

   at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas)

   at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas)

   at ThinkGeo.MapSuite.DesktopEdition.xf0380b1a0bc40ca6.StartDraw()

   at ThinkGeo.MapSuite.DesktopEdition.x601a5561df898600.x7510a5c148e0acfd(Object x19b0b2213afc2289)

   at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)

   at System.Threading.ExecutionContext.runTryCode(Object userData)

   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)

   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)

   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)



Gordon, 
  
 Maybe a dumb question but did you set the CacheDirectory on the cache object?  Do you see any images in there at all? 
  
 David

 


Yes we have set it, and can see images in the cache directory..   It can work for several seconds before anything happens since it's intermittent ...but we get this quite often after just a few pans.


It might be worse if the cache image type is changed (but hard to be sure).


 


 


 


 



Gordon, 
  
   You seem to have the most problems with the Desktop Edition at this point.  Can you give me an idea of the specs of your machine.  Like how many core it has.  Also can you give me an idea what kinds of command you use to make the threading race conditions?  Anything you can offer would be great.  You can also do all of this on your ticket if you like.  If any other information is not something you want to share with the community. 
  
 David

Hi. 



Specs are Core 2 Duo 2.4G with 4G ram, Windows Vista 32 SP1. (It's a Dell Precision M6300). We compile using VS2008, and using the beta release from yesterday.



I was going to open this on a ticket but had no tickets available, but there is nothing confidential here. 



We are just setting up the map, with caching, and then panning around.. It works for a little while (sometimes up to 10 times panning) .. and then one or other of these exceptions occurs. The panning may be happening before a previous pan has finished, or been written to disk. 



Without cacheing we don't see it. 





 



Another one we get (same details apply as previously): 
  
 "The shape you provided does not pass our simple validation.A ring should has more than 4 vertexes." 
  
    at ThinkGeo.MapSuite.Core.x6d719af406ea4c2c.xff365c684fff1baa(BaseShape x873d2ddd87022b07) 
    at ThinkGeo.MapSuite.Core.AreaBaseShape.GetIntersection(AreaBaseShape targetShape) 
    at ThinkGeo.MapSuite.Core.AreaStyle.x058be914ee08a82d(RectangleShape xd0f957683ea7e4da, List`1 x270614f58cc86658) 
    at ThinkGeo.MapSuite.Core.AreaStyle.DrawCore(IEnumerable`1 features, GeoCanvas canvas, Collection`1 labelsInThisLayer, Collection`1 labelsInAllLayers) 
    at ThinkGeo.MapSuite.Core.Style.Draw(IEnumerable`1 features, GeoCanvas canvas, Collection`1 labelsInThisLayer, Collection`1 labelsInAllLayers) 
    at ThinkGeo.MapSuite.Core.ZoomLevel.DrawCore(GeoCanvas canvas, IEnumerable`1 features, Collection`1 currentLayerLabels, Collection`1 allLayerLabels) 
    at ThinkGeo.MapSuite.Core.ZoomLevel.Draw(GeoCanvas canvas, IEnumerable`1 features, Collection`1 currentLayerLabels, Collection`1 allLayerLabels) 
    at ThinkGeo.MapSuite.Core.FeatureLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers) 
    at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers) 
    at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.xa6cb874f7090c07f(GeoCanvas x31c084515ae9393f) 
    at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas) 
    at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas) 
    at ThinkGeo.MapSuite.DesktopEdition.xf0380b1a0bc40ca6.StartDraw() 
    at ThinkGeo.MapSuite.DesktopEdition.x601a5561df898600.x7510a5c148e0acfd(Object x19b0b2213afc2289) 
    at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state) 
    at System.Threading.ExecutionContext.runTryCode(Object userData) 
    at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) 
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) 
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
    at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack) 
    at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)

Gordon, 
  
   This seems data related.  It seems as if one of your polygons does not have four poitns to it.  The reason it is found is becasue in the polygon the first and last point must match.  You may want to check your data on this one. 
  
 David


 The shapefiles are all from RenderWorld (cover, cntry02, latlong, evergreen, grass, crop, tundra, snowice, sand, inlandwater) with the exception of a road network layer which is ours.  We will check that, but these have been working for some time now, and are (apparently) fine without the cache enabled.

Gordon, 
  
   A possible stupid question but are all of these layers in one Overlay or are they all in separate Overlays?  Also can you check to make sure there is space on your disk just in case you have run out of space? 
  
 Also I want to verify that if you turn caching off then everything is better. 
  
 Could you put the code you use to load up all the layers and send that to me at support@thinkgeo.com and have them forward it to Ben & David.  I am interested to see if there is something I am missing here. 
  
 David

David, 
  
 No problem with disk space. All in the same overlay (Static). Yes, appears to work fine without the cache. 
  
 We have separated out the last exception posted above. This is happening on a specific layer. I’ll need to do some more tests to get more information on that one, but the former two exceptions still occur with that layer disabled. 
  
 I’ll get the issue checked on a seperate differently specced machine and try to get together a minimal case version of the code for you. 
  
 Gordon

Gordon,  
  
 Thanks for your codes and data, which is very helpful to recreate the issue. 
  
 We tried your application and it runs fine on a Single Core machine but throw exceptions on a Dual-Core system. I think that’s because the new threading we added to the latest Beta is having problem which would cause random error messages. We are going to release a refresh in two weeks without the threading and I think it will solve the problem, after we fix all the multithreading related issues and then we turn it back. Seems we didn’t have enough tests for the multi threading stuff and sorry for the inconvenience now. 
  
 Thanks, 
  
 Ben. 


Hello, 
  
 I ran into the similar panning issues running my 64Bit Vista OS and compiling my mapping application with the Any Cpu profile.  If I compile my mapping application in the x86 cpu profile application the issue does not crop up…  
  
 I am unsure if others have tried this but I thought I would post my experience… 
  
 Ian.

Ian, 
  
 We will have a new release late this week or early next week in which multi-threading can be turned off. So please work with that version for now and we will keep working on the threading stuff. Thanks for letting us know your case and we will test that when working on it. 
  
 Thanks, 
  
 Ben