ThinkGeo.com    |     Documentation    |     Premium Support

Load large ECW - InvalidOperation exception

I'm trying to load a very large ECW image - 680MB. It displays fine in Map Suite Explorer. I had problems with this image in version 2 but another even larger worked fine (in V2). I can send it to you if you have an ftp address.


Here is the exception. It is thrown when I call Refresh.


 System.InvalidOperationException was unhandled

  Message="This method will return too many cells that might cause performance problem. Please using GetIntersectingRowColumnRange method instead."

  Source="MapSuiteCore"

  StackTrace:

       at ThinkGeo.MapSuite.Core.Matrix.GetIntersectingCells(RectangleShape worldExtent)

       at ThinkGeo.MapSuite.Core.BitmapTileCache.GetTiles(RectangleShape worldExtent)

       at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xf12dc5c7e687c240(Boolean x991dc8ddc7528b44, RectangleShape x178b193eec228e6e)

       at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x9ac8c50f434f4b39(Int32 xb565f4681f05557a)

       at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.Refresh()

       at HelloWorld.Form1.button1_Click(Object sender, EventArgs e) in C:\Source\HelloWorld\HelloWorld\Form1.cs:line 40

       at System.Windows.Forms.Control.OnClick(EventArgs e)

       at System.Windows.Forms.Button.OnClick(EventArgs e)

       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

       at System.Windows.Forms.Control.WndProc(Message& m)

       at System.Windows.Forms.ButtonBase.WndProc(Message& m)

       at System.Windows.Forms.Button.WndProc(Message& m)

       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)

       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)

       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

       at System.Windows.Forms.Application.Run(Form mainForm)

       at HelloWorld.Program.Main() in C:\Source\HelloWorld\HelloWorld\Program.cs:line 18

       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)

       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

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

       at System.Threading.ThreadHelper.ThreadStart()

  InnerException: 

  


Here is the code:



winformsMap1.MapUnit = GeographyUnit.DecimalDegree;

string imgPath = @"c:\images\Mildura_photos2006.ecw";
EcwRasterLayer ecwImageLayer = new EcwRasterLayer(imgPath);
ecwImageLayer.Open();
winformsMap1.CurrentExtent = ecwImageLayer.GetBoundingBox();

ecwImageLayer.UpperThreshold = double.MaxValue;
ecwImageLayer.LowerThreshold = 0;

LayerOverlay imageOverlay = new LayerOverlay();
imageOverlay.Layers.Add("EcwImageLayer", ecwImageLayer);
winformsMap1.Overlays.Add(imageOverlay);

winformsMap1.Refresh();
 
 


Any ideas?


Cheers


Steve



Fixed by changing units from DecimalDegree to Meter.



Steve, 
  
 That is right, that would be the problem! 
  
 Thanks for your post and sharing! 
  
 Any more questions just let me know. 
  
 Thanks. 
  
 Yale