Skip To Content

Use ArcPy in a notebook

Several ArcPy modules are available in ArcGIS Notebooks through the Advanced notebook runtime.

With the ArcPy site package, you can perform geographic data analysis, conversion, and management. ArcPy allows you to programmatically run all ArcGIS standard geoprocessing tools and provides helper functions and classes.

Learn more about ArcPy

To use ArcPy in a notebook, ArcGIS Notebook Server must be licensed with the Advanced license, and users must have the privilege to create and run ArcPy notebooks.

ArcPy modules

The modules described below are included with ArcPy in ArcGIS Notebook Server.

Data Access

データ アクセス モジュールの arcpy.da は、データを操作するための Python モジュールです。 これは、編集セッションの制御、編集操作、カーソル サポートの向上 (高速化など)、テーブルおよびフィーチャクラスと NumPy 配列間の変換関数、バージョニング、レプリカ、ドメイン、およびサブタイプ ワークフローのサポートといった機能を提供します。

Learn more about the Data Access module

Geocoding

ジオコーディング モジュール arcpy.geocoding を使用すると、ロケーターのプロパティを調査および設定し、ジオコーディング操作を自動化することができます。 ジオコーディングとは、1 組の座標、住所、場所の名前などの位置の説明を、地球表面の位置に変換するプロセスです。 ロケーターは、ジオコーディング操作を実行する場合に使用されるツールです。 このモジュールを使用すると、ロケーターのプロパティを表示および変更し、性能や品質のためにカスタマイズして、特定のジオコーディング ニーズに合わせて調整できます。 また、このモジュールを使用して、場所や住所の位置の検索、指定された場所から最も近い場所または住所の検索、部分的な入力内容に対して自動補完された一連の候補の生成など、さまざまなジオコーディング操作を実行できます。

Learn more about the Geocoding module

Image Analysis

Image Analysis モジュール (arcpy.ia) は、画像とラスター データを管理および処理するための Python モジュールです。 すべてのジオプロセシング関数、およびラスター処理ワークフローを自動化できる高度な関数とクラスなど、このモジュールには ArcGIS Image Analyst エクステンションが提供する機能が含まれています。

Learn more about the Image Analysis module

Mapping

Arcpy.mp は、ArcPy サイト パッケージの一部である Python サブ モジュールです。 これは、ArcGIS Pro とともにインストールされ、すべてのライセンスで利用可能です。 このモジュールは、主に既存のプロジェクト (*.aprx) とレイヤー ファイル (*.lyr または *.lyrx) のコンテンツを操作するように設計されています。 このモジュールには、エクスポートと印刷を自動化する関数も用意されています。 Arcpy.mp を使用すると、地図製作を自動化することができます。また、このモジュールは、PDF ドキュメントへのエクスポートや、PDF ドキュメントの作成および管理を実行する関数が組み込まれているため、完全なマップ ブックの作成には必須です。

Learn more about the Mapping module

注意:
The arcpy.mp module is used in ArcGIS Pro; the arcpy.mapping module is used in ArcGIS Desktop.

Metadata

メタデータ モジュール arcpy.metadata は、アイテムのメタデータへのアクセスと管理を行うための Python モジュールです。 マップやデータを説明する情報を探索し、特に規格準拠の地理空間メタデータを管理するためのワークフローを自動化することができます。

Learn more about the Metadata module

Network Analyst

Network Analyst モジュールの arcpy.nax は、新しく使いやすい Python モジュールで、ArcGIS Network Analyst エクステンションで提供されるネットワーク解析機能において使用されます。 以下にアクセスできます。

  • サポートされているすべてのネットワーク解析を実行できるクラス
  • ネットワーク データセットを構成するさまざまなエレメントの接続性に関係する情報を操作できるクラス
  • 入力の事前処理、解析結果の共有、ネットワーク データセットの操作を実行できるジオプロセシング ツール
  • ネットワーク解析を実行できるクラスで使用される特定のデータ タイプの操作に使用できるヘルパー関数およびクラス

Learn more about the Network Analyst module

The legacy module arcpy.na is not included with ArcGIS Notebooks.

Sharing

The arcpy.sharing module shares web layers using Python.

共有モジュールを使用すると、ArcGIS Pro プロジェクトでマップから共有ドラフトを作成してから、ArcGIS EnterpriseArcGIS Online、または ArcGIS Server で共有できます。 共有ドラフトは、Web レイヤーの構成可能なプロパティのセットです。 共有ドラフトの作成は、Python を使用して、マップ、レイヤー、テーブル、またはレイヤーおよびテーブルのリストを Web レイヤーに公開する処理を自動化する最初のステップです。 共有ドラフトは、サービス定義ドラフト (*.sddraft) ファイルとして保存できます。

Learn more about the Sharing module

Spatial Analyst

Spatial Analyst モジュールの arcpy.sa は、ArcGIS Spatial Analyst エクステンションが提供する機能を使用して、ラスター データを解析するための Python モジュールです。 これを使用すると、Spatial Analyst ツールボックスで利用可能なすべてのジオプロセシング ツールと、ラスター処理ワークフローを自動化できるその他の関数およびクラスにアクセスできます。

Learn more about the Spatial Analyst module

注意:

The Workflow Manager (arcpy.wmx) module is not included with ArcGIS Notebook Server.

Get started with ArcPy in a notebook

To use ArcPy in a notebook, import its library by running a cell with the following lines:

import arcpy
arcpy.GetInstallInfo()['Version']

View the sample notebooks that are included with ArcGIS Notebook Server to learn how ArcPy can be used in your notebooks.

To learn more about how to prepare the workspace environments forArcPy, see Manage content in the user workspace and Upload datasets to use with ArcPy.