Hello,
I am trying to use an in-memory spatial index and got into trouble.
File-based RtreeSpatialIndex works without errors but it is too slow for our needs, so I thought of handling StreamLoading event and assigning a MemoryStream to args.AlternateStream. This approach fails when I try to open the index:
System.IndexOutOfRangeException occurred
HResult=-2146233080
Message=Index was outside the bounds of the array.
Source=MapSuiteCore
StackTrace:
at hxQ=.RU4=.khQ=(BinaryReader SU4=)
Extended stack trace:
MapSuiteCore.dll!hxQ=.RU4=.khQ=(System.IO.BinaryReader SU4=) + 0x10c bytes
MapSuiteCore.dll!hxQ=.h0A=.khQ=() + 0x90 bytes
MapSuiteCore.dll!hxQ=.PjY=.VzY=() + 0x14 bytes
MapSuiteCore.dll!hxQ=.PjY=.Dxg=(string UzY=, bool VDY=, ThinkGeo.MapSuite.Core.RtreeSpatialIndex.q0Y= VTY=) + 0x97 bytes
MapSuiteCore.dll!ThinkGeo.MapSuite.Core.RtreeSpatialIndex.OpenCore() + 0x7f bytes
MapSuiteCore.dll!ThinkGeo.MapSuite.Core.SpatialIndex.Open() + 0x22 bytes
I also tried to use RtreeSpatialIndex.CreatePointSpatialIndex(filePath,...) and initialize the memory stream with the content of the .idx file. That got me past Open() but failed on Add():
System.NullReferenceException occurred
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=MapSuiteCore
StackTrace:
at hxQ=.YE4=.bE4=(String bU4=)
at ThinkGeo.MapSuite.Core.RtreeSpatialIndex.bUY=(Double bkY=, Double b0Y=, String cEY=)
at ThinkGeo.MapSuite.Core.RtreeSpatialIndex.bUY=(PointShape cUY=, String ckY=)
at ThinkGeo.MapSuite.Core.RtreeSpatialIndex.AddCore(Feature feature)
at ThinkGeo.MapSuite.Core.SpatialIndex.Add(BaseShape baseShape)
I also looked for samples or at least posts on handling Rtree's StreamLoading event but didn't find any.
Any suggestions would be appreciated.
Thanks in advance,
Raul