I can’t seem to get this to work. Building a RTG based on MultipleShapeFileFeatureSource always fails for me. It doesn’t seem to matter if I use Tiger or OSM. Geometries are snapped, cleaned, plannerized, and indexed. Also, I can build rtg files just fine for individual areas.
Files are too large to upload (~254 mb zipped).
Code Example:
string[] routeShapes = Directory.GetFiles(routeablePath, “*_route.shp”);
MultipleShapeFileFeatureSource multipleShapeFileFeatureSource = new MultipleShapeFileFeatureSource(routeShapes);
RtgRoutingSource.GenerateRoutingData(@“D:\workspace\data\OSM\routeable\FastestPath.rtg”, multipleShapeFileFeatureSource, BuildRoutingDataMode.Rebuild, GeographyUnit.DecimalDegree, DistanceUnit.Mile);
Resulting Error:
System.IndexOutOfRangeException was unhandled
HResult=-2146233080
Message=Index was outside the bounds of the array.
Source=MapSuiteCore
StackTrace:
at ThinkGeo.MapSuite.Core.MultipleShapeFileFeatureSource.GetFeaturesByIdsCore(IEnumerable`1 ids, IEnumerable`1 returningColumnNames)
at ThinkGeo.MapSuite.Core.FeatureSource.GetFeatureById(String id, IEnumerable`1 returningColumnNames)
at ThinkGeo.MapSuite.Core.FeatureSource.GetFeatureById(String id, ReturningColumnsType returningColumnNamesType)
at vBM=.RBQ=.aRQ=(String bRQ=, FeatureSource bhQ=, BuildRoutingDataMode bxQ=, GeographyUnit cBQ=, DistanceUnit cRQ=)
at ThinkGeo.MapSuite.Routing.RtgRoutingSource.GenerateRoutingData(String rtgFilePathName, FeatureSource featureSource, BuildRoutingDataMode buildRoutingDataMode, GeographyUnit geographyUnit, DistanceUnit distanceUnit)
at RouteFileBuilder.Form1.BuildRouteFile()
at RouteFileBuilder.Form1.BtnGenClick(Object sender, 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.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(IntPtr 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 RouteFileBuilder.Program.Main()
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: