ArcGIS Pro 3.6 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / CatalogLayer Class
Members Example

In This Topic
    CatalogLayer Class
    In This Topic
    Represents a layer with a reference to a catalog dataset which contains references to multiple datasets, packages, and/or portal items. The catalog dataset items do not have to be related.
    Object Model
    CatalogLayer ClassDefinitionQuery ClassLayer ClassCatalogDataset ClassCIMDataConnection ClassTimeExtent ClassCIMBaseLayer ClassElevationTypeDefinition ClassSpatialReference ClassTimeParameters ClassSurfaceZsResult ClassMap ClassILayerContainer InterfaceEnvelope ClassDefinitionQuery Class
    Syntax
    Remarks
    To create a catalog layer use CatalogLayerCreationParams with LayerFactory.
    The item references, within the catalog dataset, can be visualized, filtered, and queried dynamically in maps and scenes.
    Example
    Create Catalog Layer using Uri to a Catalog Feature Class
    //Note: Call within QueuedTask.Run()
    var createParams = new CatalogLayerCreationParams(new Uri(@"C:\CatalogLayer\CatalogDS.gdb\HurricaneCatalogDS"));
    //Set the definition query
    createParams.DefinitionQuery = new DefinitionQuery("Query1", "cd_itemname = 'PuertoRico'");
    //Set name of the new Catalog Layer
    createParams.Name = "PuertoRico";
    //Create Layer
    var catalogLayer = LayerFactory.Instance.CreateLayer<CatalogLayer>(createParams, MapView.Active.Map);
    Create Catalog Layer using CatalogDataset
    //Note: Call within QueuedTask.Run()
    //Get the CatalogDataset of another Catalog layer
    var existingCatalogLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<CatalogLayer>().FirstOrDefault();
    if (existingCatalogLayer != null)
    {
      var catalogDataset = existingCatalogLayer.GetCatalogDataset();
      //Configure the settings for a new Catalog layer using the CatalogDataset of an existing layer
      var catalogLyrParams = new CatalogLayerCreationParams(catalogDataset);
      catalogLyrParams.Name = "NewCatalogLayerFromAnotherCatalogLayer";
      catalogLyrParams.DefinitionQuery = new DefinitionQuery("Query1", "cd_itemname = 'Asia'");
      LayerFactory.Instance.CreateLayer<CatalogLayer>(catalogLyrParams, MapView.Active.Map);
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
          ArcGIS.Desktop.Mapping.MapMember
             ArcGIS.Desktop.Mapping.Layer
                ArcGIS.Desktop.Mapping.CompositeLayer
                   ArcGIS.Desktop.Mapping.CatalogLayer

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.1 or higher.
    See Also