ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Hilfe
  • Sign Out
ArcGIS Desktop

ArcGIS Online

Die Mapping-Plattform für Ihre Organisation

ArcGIS Desktop

Ein vollständiges professionelles GIS

ArcGIS Enterprise

GIS in Ihrem Unternehmen

ArcGIS for Developers

Werkzeuge zum Erstellen standortbezogener Apps

ArcGIS Solutions

Kostenlose Karten- und App-Vorlagen für Ihre Branche

ArcGIS Marketplace

Rufen Sie Apps und Daten für Ihre Organisation ab.

  • Dokumentation
  • Support
Esri
  • Anmelden
user
  • Eigenes Profil
  • Abmelden

Help

  • Startseite
  • Erste Schritte
  • Karte
  • Analysieren
  • Verwalten von Daten
  • Werkzeuge
  • Mehr...

ListFeatureClasses

  • Zusammenfassung
  • Beschreibung
  • Syntax
  • Codebeispiel

Zusammenfassung

Lists the feature classes in the workspace, limited by name, feature type, and optional feature dataset.

Beschreibung

The workspace environment must be set first before using several of the List functions, including ListDatasets, ListFeatureClasses, ListFiles, ListRasters, ListTables, and ListWorkspaces.

Syntax

ListFeatureClasses ({wild_card}, {feature_type}, {feature_dataset})
ParameterErläuterungDatentyp
wild_card

The wild_card limits the results returned. If no wild_card is specified, all values are returned.

String
feature_type

The feature type to limit the results returned by the wild_card argument. Valid feature types are:

  • Annotation —Only annotation feature classes are returned.
  • Arc —Only arc (or line) feature classes are returned.
  • Dimension —Only dimension feature classes are returned.
  • Edge —Only edge feature classes are returned.
  • Junction —Only junction feature classes are returned.
  • Label — Only label feature classes are returned.
  • Line —Only line (or arc) feature classes are returned.
  • Multipatch —Only multipatch feature classes are returned.
  • Node —Only node feature classes are returned.
  • Point —Only point feature classes are returned.
  • Polygon —Only polygon feature classes are returned.
  • Polyline —Only line (or arc) feature classes are returned.
  • Region —Only region feature classes are returned.
  • Route —Only route feature classes are returned.
  • Tic —Only tic feature classes are returned.
  • All — All datasets in the workspace. This is the default value.

(Der Standardwert ist All)

String
feature_dataset

Limits the feature classes returned to the feature dataset, if specified. If blank, only stand-alone feature classes will be returned in the workspace.

String

Rückgabewert

DatentypErläuterung
String

The list containing feature class names is returned from the function, limited by the optional wild_card, feature_type, and feature_dataset arguments.

Codebeispiel

ListFeatureClasses example

Copy shapefiles to a geodatabase.

import os
import arcpy

# Set the workspace for ListFeatureClasses
arcpy.env.workspace = "c:/base"

# Use the ListFeatureClasses function to return a list of
#  shapefiles.
featureclasses = arcpy.ListFeatureClasses()

# Copy shapefiles to a file geodatabase
for fc in featureclasses:
    arcpy.CopyFeatures_management(
        fc, os.path.join("c:/base/output.gdb",
                         os.path.splitext(fc)[0]))
ListFeatureClasses example 1

List all feature classes in a geodatabase, including any within feature datasets.

import arcpy
import os

arcpy.env.workspace = "c:/base/gdb.gdb"

datasets = arcpy.ListDatasets(feature_type='feature')
datasets = [''] + datasets if datasets is not None else []

for ds in datasets:
    for fc in arcpy.ListFeatureClasses(feature_dataset=ds):
        path = os.path.join(arcpy.env.workspace, ds, fc)
        print(path)

Verwandte Themen

  • Auflisten von Daten
  • Walk

ArcGIS Desktop

  • Startseite
  • Dokumentation
  • Support

ArcGIS Plattform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

Über Esri

  • Über uns
  • Karriere
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Wir sind an Ihrer Meinung interessiert.
Copyright © 2019 Esri. | Datenschutz | Rechtliches