1
Vote

Loading large SID files failes due to pointer error

description

During the MWI creation process, trying to load a 358mb SID file it fails at 2.14GB with this message
 
      Error: An attempt was made to move the file pointer before the beginning of the file.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.SeekCore(Int64 offset, SeekOrigin origin)
at System.IO.FileStream.Seek(Int64 offset, SeekOrigin origin)
at DotSpatial.Data.PyramidImage.WriteWindow(Byte[] bytes, Int32 startRow, Int32 startColumn, Int32 numRows, Int32 numColumns, Int32 scale, ProgressMeter pm) in C:\Users\robbinj\Documents\Visual Studio 2010\Projects\Mobile\src\DotSpatial\DotSpatial.Data\PyramidImage.cs:line 530
at DotSpatial.Data.PyramidImage.WriteWindow(Byte[] bytes, Int32 startRow, Int32 startColumn, Int32 numRows, Int32 numColumns, Int32 scale) in C:\Users\robbinj\Documents\Visual Studio 2010\Projects\Mobile\src\DotSpatial\DotSpatial.Data\PyramidImage.cs:line 500
at DotSpatial.Data.Rasters.GdalExtension.GdalImageProvider.OpenFile(String fileName) in C:\Users\robbinj\Documents\Visual Studio 2010\Projects\Mobile\src\DotSpatial\DotSpatial.Data.Rasters.GdalExtension\GdalImageProvider.cs:line 291
at DotSpatial.Data.Rasters.GdalExtension.GdalImageProvider.DotSpatial.Data.IDataProvider.Open(String fileName) in C:\Users\robbinj\Documents\Visual Studio 2010\Projects\Mobile\src\DotSpatial\DotSpatial.Data.Rasters.GdalExtension\GdalImageProvider.cs:line 87
at DotSpatial.Data.DataManager.OpenFile(String fileName, Boolean inRam, IProgressHandler progressHandler) in C:\Users\robbinj\Documents\Visual Studio 2010\Projects\Mobile\src\DotSpatial\DotSpatial.Data\DataManager.cs:line 375
at DotSpatial.Data.DataManager.OpenFile(String fileName) in C:\Users\robbinj\Documents\Visual Studio 2010\Projects\Mobile\src\DotSpatial\DotSpatial.Data\DataManager.cs:line 312
at DotSpatial.Controls.MapLayerCollection.Add(String fileName) in C:\Users\robbinj\Documents\Visual Studio 2010\Projects\Mobile\src\DotSpatial\DotSpatial.Controls\MapLayerCollection.cs:line 153
at DotSpatial.Controls.Map.AddLayer(String fileName) in C:\Users\robbinj\Documents\Visual Studio 2010\Projects\Mobile\src\DotSpatial\DotSpatial.Controls\Map.cs:line 540
 
Trying to run it in debug mode causes it to fail due to out of memory exception after writing just the first chunk.

comments

mudnug wrote Jun 2, 2012 at 4:01 AM

Looks like that Pyramid approach won't work when the output file is larger than ~2GB. That causes the Int32 to overflow to Int32.MinValue and doesn't work.