ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.LinearReferencing Namespace / RouteInfo Class / RouteInfo Constructor
An M-enabled polyline feature class.
The name of the field containing values that uniquely identify each route in the routeFeatureClass.
Example

In This Topic
    RouteInfo Constructor
    In This Topic
    Initializes a new instance of the RouteInfo class.
    Syntax

    Parameters

    routeFeatureClass
    An M-enabled polyline feature class.
    routeIDFieldName
    The name of the field containing values that uniquely identify each route in the routeFeatureClass.
    Exceptions
    Example
    Create a routes feature class using the DDL
    {
      static 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
    {
      static 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);
    
            // Process the routeInfo as needed ...
          }
        }
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.3 or higher.
    See Also