I’m trying to create a Routing Index (.rtg) file. My road data is in an SQL Server database, and I’m building a Feature Layer manually by individually adding features (from the SQL data) to an InMemoryFeatureLayer (see code below).
LineShape lineShape = new LineShape(wkt); //wkt comes from sql
Feature feature = lineShape.GetFeature();
InternalFeatures.Add(feature);
The features seem to add fine, but when I try to Generate Routing Data, I get an error:
FeatureSource fs = RoadLayer.FeatureSource;
RtgRoutingSource.GenerateRoutingData(“c:\\Data\\RoutingIndex_Guest.rtg”,fs);
ERROR: Object reference not set to an instance of an object.
What Object hasn’t been initialized?
bob