Initializes a new instance of the
RouteInfo class.
Create a routes feature class using the DDL
public void CreateRoutes(SchemaBuilder schemaBuilder)
{
FieldDescription routeIdDescription = FieldDescription.CreateIntegerField("RouteID");
FieldDescription routeNameDescription = FieldDescription.CreateStringField("RouteName", 100);
ShapeDescription shapeDescription = new ShapeDescription(GeometryType.Polyline, SpatialReferences.WGS84) { HasM = true, HasZ = false };
FeatureClassDescription routeFeatureClassDescription = new FeatureClassDescription("Routes", new List<FieldDescription>() { routeIdDescription, routeNameDescription }, shapeDescription);
//Create an M-enabled poly-line feature class
schemaBuilder.Create(routeFeatureClassDescription);
schemaBuilder.Build();
}
Get route information from a polyline feature class with M-values
public void CreateRouteInfo(Geodatabase geodatabase, string routeFeatureClassName = "Roads", string routeIdFieldName = "RouteID")
{
using (FeatureClass routeFeatureClass = geodatabase.OpenDataset<FeatureClass>(routeFeatureClassName))
using (FeatureClassDefinition routeFeatureClassDefinition = routeFeatureClass.GetDefinition())
{
if (routeFeatureClassDefinition.HasM())
{
RouteInfo routeInfo = new RouteInfo(routeFeatureClass, routeIdFieldName);
}
}
}
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3.3 or higher.