ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.LinearReferencing Namespace / PointEventInfo Class / PointEventInfo Constructor / PointEventInfo Constructor(Table,String,String)
The table that contains point events.
The name of the field that contains the route identifier associated with each event.
The name of the field containing the measure value associated with the point event.
Example

In This Topic
    PointEventInfo Constructor(Table,String,String)
    In This Topic
    Initializes a new instance of the PointEventInfo class.
    Syntax

    Parameters

    pointEventTable
    The table that contains point events.
    routeIDFieldName
    The name of the field that contains the route identifier associated with each event.
    measureFieldName
    The name of the field containing the measure value associated with the point event.
    Exceptions
    ExceptionDescription
     
    A geodatabase-related exception has occurred.
    Example
    Get event information
    {
      static void CreateEventInfo(Geodatabase geodatabase, string eventTableName = "Accidents", string routeIdFieldName = "RID", string measureFieldName = "Measure", string offsetFieldName = "Offset")
      {
        using (Table eventTable = geodatabase.OpenDataset<Table>(eventTableName))
        {
          PointEventInfo eventInfo = new PointEventInfo(eventTable, routeIdFieldName, measureFieldName, offsetFieldName);
    
          // Get event type: Point or Line type
          EventType eventTableType = eventInfo.EventType;
        }
      }
    }
    Create a RouteEventSource via dynamic segmentation process for point events
    {
      static void CreatePointEventSource(Geodatabase geodatabase, string routeFeatureClassName = "Roads", string eventTableName = "Accidents", string routeIdFieldName = "RID", string measureFieldName = "Measure")
      {
        using (FeatureClass routesFeatureClass = geodatabase.OpenDataset<FeatureClass>(routeFeatureClassName))
        using (Table eventsTable = geodatabase.OpenDataset<Table>(eventTableName))
        {
          RouteInfo routeInfo = new RouteInfo(routesFeatureClass, routeIdFieldName);
          EventInfo eventInfo = new PointEventInfo(eventsTable, routeIdFieldName, measureFieldName);
          RouteEventSourceOptions routeEventSourceOptions = new PointEventSourceOptions(AngleType.Tangent)
          { ComplementAngle = true };
    
          using (RouteEventSource routeEventSource = new RouteEventSource(routeInfo, eventInfo, routeEventSourceOptions))
          using (RouteEventSourceDefinition routeEventSourceDefinition = routeEventSource.GetDefinition())
          {
            // Locating errors 
            IReadOnlyList<RouteEventSourceError> errors = routeEventSource.GetErrors();
    
            // Route event source fields 
            IReadOnlyList<Field> routeEventSourceFields = routeEventSourceDefinition.GetFields();
    
            // Add RouteEventSource to the ArcGIS Pro map
            FeatureLayerCreationParams layerParams = new FeatureLayerCreationParams(routeEventSource)
            {
              Name = "RoadAccidents"
            };
    
            LayerFactory.Instance.CreateLayer<FeatureLayer>(layerParams, MapView.Active.Map);
          }
        }
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.3 or higher.
    See Also