ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data.Realtime Namespace / RealtimeFeatureClass Class
Members Example

In This Topic
    RealtimeFeatureClass Class
    In This Topic
    Represents a real-time table with a spatial column.
    Object Model
    RealtimeFeatureClass ClassInsertCursor ClassFeature ClassRowBuffer ClassUpdateCursor ClassDifferenceCursor ClassTable ClassRealtimeDatastore ClassRealtimeFeatureClassDefinition ClassEnvelope ClassFeatureDataset ClassJoin ClassRelationshipClass ClassRowCursor ClassRealtimeCursor ClassSelection ClassRowCursor ClassRealtimeCursor ClassContingencyValidationResult Class
    Syntax
    public sealed class RealtimeFeatureClass : ArcGIS.Core.Data.FeatureClass, System.IDisposable  
    Public NotInheritable Class RealtimeFeatureClass 
       Inherits ArcGIS.Core.Data.FeatureClass
       Implements System.IDisposable 
    Remarks
    Streaming does not start automatically. Call StartStreaming explicitly to start receiving feature stream.
    Example
    Connect to a real-time feature class from a real-time datastore
    var url = "https://geoeventsample1.esri.com:6443/arcgis/rest/services/AirportTraffics/StreamServer";
         
    await QueuedTask.Run(() =>
    {
      var realtimeServiceConProp = new RealtimeServiceConnectionProperties(
                                       new Uri(url),
                                       RealtimeDatastoreType.StreamService
                                    );
      using (var realtimeDatastore = new RealtimeDatastore(realtimeServiceConProp))
      {
        //A Realtime data store only contains **one** Realtime feature class (or table)
        var name = realtimeDatastore.GetTableNames().First();
        using (var realtimeFeatureClass = realtimeDatastore.OpenTable(name) as RealtimeFeatureClass)
        {
          //feature class, by default, is not streaming (opposite of the stream layer)
          realtimeFeatureClass.StartStreaming();
          //TODO use the feature class
          //...
        }
      }
    
    });
    Check the Realtime Feature Class is Track Aware
    using (var rfc = streamLayer.GetFeatureClass())
    using (var rfc_def = rfc.GetDefinition())
    {
      if (rfc_def.HasTrackIDField())
      {
        //Track aware
      }
    }
    
    Get the Track Id Field from the Realtime Feature class
    //Must be on QueuedTask
    using (var rfc = streamLayer.GetFeatureClass())
    using (var rfc_def = rfc.GetDefinition())
    {
      if (rfc_def.HasTrackIDField())
      {
        var fld_name = rfc_def.GetTrackIDField();
    
      }
    }
    
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.CoreObjectsBase
          ArcGIS.Core.Data.Dataset
             ArcGIS.Core.Data.Table
                ArcGIS.Core.Data.FeatureClass
                   ArcGIS.Core.Data.Realtime.RealtimeFeatureClass

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also