Python Programming Recipes for ArcGIS (2nd Edition)
Eric PimplerPosts & Telecom Press2017
No rating yet- Word count
- 416K words
- Chapters
- 15
- ISBN
- 9787115438041
Tags
Computing Programming Layer ManagementCartographyGeographic Information SystemsData ProcessingProgramming DesignSpatial DataAutomationPractical GuideSummary
This is the Chinese translation of the second edition of Programming ArcGIS with Python Cookbook, aimed at GIS professionals who use ArcGIS for Desktop for spatial data processing. It adopts a cookbook format of "task—preparation—procedure—how it works—extensions," turning repetitive daily GIS operations into reusable Python scripts. The book starts with IDLE and the ArcGIS Python window, covering language basics such as comments, module imports, variables, built-in data types, classes and objects, statement structures, and file reading and writing; it then moves on to managing map documents and layers, finding and repairing broken data links, and automating cartography and batch printing; it further covers calling geoprocessing tools from scripts, packaging scripts as custom geoprocessing tools, querying and selecting data by attribute and spatial conditions, using the ArcPy data access module (cursors) to batch-edit feature classes and attribute tables, and obtaining inventories of GIS data and Describe information; it also touches on customizing the ArcGIS interface with Add-ins, identifying exceptions and handling errors, and invoking advanced ArcGIS functions. The second edition adds a chapter on using Python in ArcGIS Pro, and the book ends with two appendices: automated Python scripts and five Python features every GIS programmer should know. Throughout, the book emphasizes "get it running first, then optimize," and its examples stay close to real workflows, making it well suited to upgrading from mouse clicking to batch script processing.Editor's review
很多 GIS 人的第一份「自动化」需求,都始于同一类烦恼:几十个图层要依次裁剪、投影、转格式、出图,鼠标点到手酸,还容易出错。这本书正是为这类场景写的。它的写法不是从语法讲到语法,而是把每个真实任务拆成「准备工作—操作方法—工作原理—拓展」四步:先告诉你这一步要解决什么问题,再给能直接套用的代码,最后解释为什么这样写,方便迁移到自己的数据上。内容覆盖面也较完整:从 Python 窗口的即时试验,到地图文档与图层管理、断链修复、批量制图打印、调用与封装地理处理工具、游标读写要素类、错误处理与 Add-in 界面定制,基本覆盖了 ArcGIS 桌面端的常见自动化需求;第2版还补上了 ArcGIS Pro 的 Python 用法。作者 Eric Pimpler 长期从事 GIS 培训与脚本开发,例子带着明显的「实战味」。需要提醒的是,书中代码基于 ArcGIS 10.x 时代的 Python 2 与 arcpy,读者在新版本环境下需自行调整语法与工具箱路径;个别示例也存在排版或笔误,调试能力比照抄更重要。总体而言,它是 ArcPy 入门到进阶的一块实用跳板,而不是一本从零讲编程的教材。Who it's for
A good fit for
- 已有 ArcGIS 桌面版操作经验、想用脚本替代重复点击的 GIS 从业者
- 需要批量处理空间数据、修复断链、批量出图的测绘与规划技术人员
- 用过 ModelBuilder、想突破其局限并进一步写代码的 GIS 用户
- 地理信息、遥感、城乡规划等专业需要完成课程实践与作业的学生
Not a good fit for
- 完全没用过 ArcGIS 的零基础编程新手,应先熟悉软件基本操作
- 只想系统学习 Python 语言本身、不关心空间数据的读者
- 使用 ArcGIS Pro 为主且需要最新 ArcPy API 全面讲解的读者
Reading tips
- 先对照第1章在 Python 窗口中把示例逐行跑通,建立「改一行、看结果」的调试习惯。
- 配合自己的真实项目阅读第2—9章,把工作中最烦的一项批处理任务当作练习目标。
- 书中代码基于旧版 Python 2 与 arcpy,遇到报错先查官方文档与工具参数,不要盲抄。
- 读完后尝试把脚本封装成自定义工具或 Add-in,让同事也能直接使用你的成果。
About the publisher
Posts & Telecom Press China · Founded in 1953Posts & Telecom Press is known for its strengths in science and technology, computing, and information and communications titles, and has extended its publishing into photography, art, software learning, and inspirational growth, giving it a fairly diverse range. Its catalog includes computing and communications works such as Refactoring and Patterns (Revised Edition) and Huawei Switch Learning Guide (Second Edition), alongside bilingual collector's editions such as The Little Prince (Chinese-English-French illustrated collector's edition), The Great Gatsby, and Three Days to See. Beijing Ten Years: 1980-1990 and Ghost Blade: WLOP Personal Illustration Collection reflect its presence in photography and art. Its authors include Antoine de Saint-Exupéry, Helen Keller, Joshua Kerievsky, Wang Da, Zhang Zhaozeng, and WLOP.
Contents
- Chapter 1: Python Language Basics for ArcGIS
- Chapter 2: Managing Map Documents and Layers
- Chapter 3: Finding and Fixing Broken Data Links
- Chapter 4: Automating Map Production and Printing
- Chapter 5: Running Geoprocessing Tools with Scripts
- Chapter 6: Creating Custom Geoprocessing Tools
- Chapter 7: Querying and Selecting Data
- Chapter 8: Using the ArcPy Data Access Module in Feature Classes and Tables
- Chapter 9: Getting Lists and Descriptions of GIS Data
- Chapter 10: Customizing the ArcGIS Interface with Add-ins
- Chapter 11: Identifying Exceptions and Handling Errors
- Chapter 12: Using Python for Advanced ArcGIS Functions
- Chapter 13: Using Python in ArcGIS Pro
- Appendix A: Automated Python Scripts
- Appendix B: Five Python Features Every GIS Programmer Should Know
FAQ
这本书和《面向ArcGIS的Python脚本编程》是同一本吗?
不是。本书作者是 Eric Pimpler,原书为 Python 配方手册,2017 年由人民邮电出版社出版;《面向ArcGIS的Python脚本编程》作者是 Paul A. Zandbergen,更偏教材式系统讲解,两者内容与结构不同,选购时请按 ISBN 区分。书中的代码适用于新版 ArcGIS Pro 吗?
大部分示例基于 ArcGIS 10.x 时代的 Python 2 与 arcpy,在 ArcGIS Pro(Python 3)中需调整 print 语法、部分模块导入与工具路径。第13章专门介绍了在 ArcGIS Pro 中使用 Python,可作为过渡参考。没有 Python 基础能直接读吗?
可以入门,但要有 ArcGIS 桌面操作基础。第1章覆盖了注释、变量、数据类型、类与对象、文件读写等基础内容,配合示例能上手;若完全零编程,建议先补一两周 Python 语法再读效率更高。这本书主要解决哪些实际工作问题?
包括批量管理地图文档与图层、自动修复图层数据源断链、批量制图与打印、用脚本批量运行地理处理工具、按属性或空间条件查询选择数据、用游标批量编辑要素类与属性表、生成数据清单与描述信息等。This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.
About the author
Eric Pimpler AuthorEric Pimpler is an author in the field of computer and geographic information programming. Publicly available information about him is limited, and his nationality, dates of birth and death, and professional career cannot yet be confirmed. Judging from the work held in the collection, he is the author of Python Programming Recipes for ArcGIS (2nd Edition), a practical book on Python development for the ArcGIS platform that falls under computer and programming design titles. It can therefore be inferred that his writing focuses on combining geographic information systems with scripting and automation, with a style oriented toward practical operations and problem solving rather than theoretical exposition. For readers who wish to use Python to improve the efficiency of ArcGIS workflows, this work offers methods and approaches for reference. Because relevant materials are scarce, a complete assessment of the author and his work still awaits more public information.