Hi mohammad,
In your scenario, you don't need to modify *.rtg file, you can add a column to shape file and modify column's value to meet your requirement, just as the code did in "How Do I Samples/Edit Routing Index file". Please check the following steps:
1. Add your own column to shape file
featureSource = new ShapeFileFeatureSource(@"..\..\..\SampleData\Austinstreets.shp", ShapeFileReadWriteMode.ReadWrite);
featureSource.Open();
featureSource.AddColumnString("yourColumn", 50);
featureSource.Close();
2. Use your own logic to modify customized column's value (for example, modify the clicked feature)
routingSource.Open();
Collection<RouteSegment> routeSegments = routingSource.GetRouteSegmentsNearestTo(clickedPosition, featureSource, winformsMap1.MapUnit, 1);
if (routeSegments.Count > 0)
{
string featureId = routeSegments[0].FeatureId;
featureSource.Open();
Feature feature = featureSource.GetFeatureById(featureId, ReturningColumnsType.NoColumns);
feature.ColumnValues["YourColumn"] = "YourColumnValue";
featureSource.BeginTransaction();
featureSource.UpdateFeature(feature);
featureSource.CommitTransaction();
}
Please let me know if you have further questions.
Regards,
Ivan