Python Scripting for ArcGIS

Post on 24-Jan-2016

122 views 17 download

description

Python Scripting for ArcGIS. ZHONG Teng Sep 12, 2013. 山顶点 提取. Automatic. Model Builder. BUT. 模型参数过多 路 径设置繁琐 不能自定义某些特定功能. Why Scripting. 解决空间数据处理的复杂、费时和重复性等问题,达到批量、自动数据处理的目的 有效 整合 利用 ArcGIS 软件自带工具,以及数据存储、可视化及输出等功能 相比 C++, .NET 等基于 ArcObjects 的编程更简单方便. Why Python. ESRI 支持并大力推荐 - PowerPoint PPT Presentation

Transcript of Python Scripting for ArcGIS

Python Scripting for ArcGIS

ZHONG Teng

Sep 12, 2013

山顶点提取

Automatic

Model Builder

BUT

模型参数过多 路径设置繁琐 不能自定义某些特定功能

Why Scripting

解决空间数据处理的复杂、费时和重复性等问题,达到批量、自动数据处理的目的

有效整合利用 ArcGIS 软件自带工具,以及数据存储、可视化及输出等功能

相比 C++, .NET 等基于ArcObjects 的编程更简单方便

Why Python

ESRI 支持并大力推荐 语法简单易用,适合初学者 资源丰富 http://

arcscripts.esri.com/

Python Scripting 的两种使用方式 基于窗口的方式 (Python window) 基于工具的方式 (Use scripts as tools)

基于窗口的方式

基于窗口的方式

基于窗口的方式

CTRL+ENTER

ENTER twice

基于窗口的方式

基于工具的方式

基于工具的方式

基于工具的方式

基于工具的方式

基于工具的方式

基于工具的方式

基于工具的方式

基于工具的方式

基于工具的方式

Functions of Python Scripting in ArcGIS

处理属性表数据 (Attributes) 处理几何数据 (Geometries) 处理栅格数据 (Rasters)

处理属性表数据 (Attributes)

通过游标 (Cursor) 来处理数据• Search

• Insert

• UpdateCursor Explanation

arcpy.InsertCursor(dataset, {spatial_reference}) Inserts rows

arcpy.SearchCursor(dataset, {where_clause}, {spatial_reference}, {fields}, {sort_fields})

Read-only access

arcpy.UpdateCursor(dataset, {where_clause}, {spatial_reference}, {fields}, {sort_fields})

Updates or deletes rows

处理属性表数据 (Attributes)

处理几何数据 (Geometries)

Read Geometry Write Geometry

Read Geometry

Read Geometry

Write Geometry

处理栅格数据 (Rasters)

处理栅格数据 (Rasters)

有用的资源 (Useful Resources)

Reference Books

Paul A. Zandbergen, Python Scripting for ArcGIS, 2013, ESRI Press

Websites

http://arcscripts.esri.com/ (You can download scripts here)

http://resources.arcgis.com/en/help/main/10.1/index.html (ArcGIS help)