ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data Namespace / TrackType Enumeration
Example Example

In This Topic
    TrackType Enumeration
    In This Topic
    Specifies whether the tracking data in a dataset is Spatial or Attribute-Only.
    Syntax
    Members
    MemberDescription
    AttributeOnly Tracking data is attribute-only, eg: a water gauge with varying water levels.
    None No tracking data is present.
    Spatial Tracking data is spatial, eg: a moving object.
    Example
    Determine the Stream Layer type
    {
      //spatial or non-spatial?
      if (streamLayer.TrackType == TrackType.AttributeOnly)
      {
        //this is a non-spatial stream layer
      }
      else
      {
        //this must be a spatial stream layer
      }
    }
    Get The Track Type
    {
      var trackType = streamLayer.TrackType;
      switch (trackType)
      {
        //TODO deal with tracktype
        case TrackType.None:
        case TrackType.AttributeOnly:
        case TrackType.Spatial:
          break;
      }
    }
    Set Stream Layer properties via the CIM
    {
      //The layer must be track aware and spatial
      if (streamLayer.TrackType != TrackType.Spatial)
      {
        // not track aware and spatial
      }
      // Note: call within QueuedTask.Run()
      {
        //get the CIM Definition
        var def = streamLayer.GetDefinition() as CIMFeatureLayer;
        //set the number of previous observations, 
        def.PreviousObservationsCount = (int)streamLayer.GetExpirationMaxCount() - 1;
        //set show previous observations and track lines to true
        def.ShowPreviousObservations = true;
        def.ShowTracks = true;
        //commit the changes
        streamLayer.SetDefinition(def);
      }
    }
    Inheritance Hierarchy

    System.Object
       System.ValueType
          System.Enum
             ArcGIS.Core.Data.TrackType

    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also