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 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

ArcMap

  • Startseite
  • Erste Schritte
  • Karte
  • Analysieren
  • Verwalten von Daten
  • Werkzeuge
  • Erweiterungen

ListGrids

Mit der Standard- oder Advanced-Lizenz verfügbar.

Mit der Production Mapping-Lizenz verfügbar.

  • Zusammenfassung
  • Auswertung
  • Syntax
  • Codebeispiel

Zusammenfassung

Returns a list of Grid objects in a specified feature dataset.

Auswertung

Grids created with the Make Grids And Graticules Layer geoprocessing tool or Grids and Graticules Designer are stored in a feature dataset within a workspace. ListGrids returns a list of Grid objects that are stored in the specified feature dataset.

Syntax

ListGrids (feature_dataset, {wildcard})
ParameterErklärungDatentyp
feature_dataset

The path to the feature dataset that contains Grid objects.

String
wildcard

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

String

Rückgabewert

DatentypErklärung
String

A list of Grid objects

Codebeispiel

ListGrids example 1

This sample lists the Grid objects within a specific dataset.

import arcpy
import arcpyproduction

# Check out Production Mapping license
arcpy.CheckOutExtension("foundation")

# List Grid objects in the Grids dataset
arcpyproduction.mapping.ListGrids(r"C:\Tutorials\CartographicProduction\Austin.gdb\Grids")

# Check in extension
arcpy.CheckInExtension('foundation')
ListGrids example 2

The following script will get the group layer of a grid and add it to current map document as a group layer.

import arcpy
import arcpyproduction

# Check out Production Mapping extension
arcpy.CheckOutExtension('foundation')

# Set the grid workspace
grid_dataset = r"C:\Project\Grids.gdb\WGS84"

# Get the list of grids in the workspace that has name area1
lstGrids = arcpyproduction.mapping.ListGrids(grid_dataset, "area1")

# Get the layer from the grid object in the grid list
grid_layer = lstGrids[0].layer

# Access the current mxd and the first data frame in the mxd
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)

# Add the grid group layer as the topmost layer in the first data frame
arcpy.mapping.AddLayer(df[0], grid_layer, "TOP")

# Save the mxd
mxd.save()

# Check in extension
arcpy.CheckInExtension('foundation')

Verwandte Themen

  • Grid
  • Introduction to arcpyproduction.mapping

ArcGIS Desktop

  • Startseite
  • Dokumentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

Über Esri

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