ArcPy and ArcGIS - Second Edition
Silas Toms, Dara O'Beirne
- 272 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
ArcPy and ArcGIS - Second Edition
Silas Toms, Dara O'Beirne
About This Book
Use Python modules such as ArcPy, ArcREST and the ArcGIS API for Python to automate the analysis and mapping of geospatial data.About This Bookā¢ Perform GIS analysis faster by automating tasks.ā¢ Access the spatial data contained within shapefiles and geodatabases and transform between spatial reference systems.ā¢ Automate the mapping of geospatial analyses and production of map books.Who This Book Is ForIf you are a GIS student or professional who needs an understanding of how to use ArcPy to reduce repetitive tasks and perform analysis faster, this book is for you. It is also a valuable book for Python programmers who want to understand how to automate geospatial analyses and implement ArcGIS Online data management. What You Will Learnā¢ Understand how to integrate Python into ArcGIS and make GIS analysis faster and easier.ā¢ Create Python script using ArcGIS ModelBuilder.ā¢ Learn to use ArcGIS online feature services and the basics of the ArcGIS REST APIā¢ Understand the unique Python environment that is new with ArcGIS Proā¢ Learn about the new ArcGIS Python API and how to use Anaconda and Jupyter with itā¢ Learn to control ArcGIS Enterprise using ArcPyIn DetailArcGIS allows for complex analyses of geographic information. The ArcPy module is used to script these ArcGIS analyses, providing a productive way to perform geo-analyses and automate map production.The second edition of the book focuses on new Python tools, such as the ArcGIS API for Python. Using Python, this book will guide you from basic Python scripting to advanced ArcPy script tools.This book starts off with setting up your Python environment for ArcGIS automation. Then you will learn how to output maps using ArcPy in MXD and update feature class in a geodatabase using arcpy and ArcGIS Online. Next, you will be introduced to ArcREST library followed by examples on querying, updating and manipulating ArcGIS Online feature services. Further, you will be enabling your scripts in the browser and directly interacting with ArcGIS Online using Jupyter notebook. Finally, you can learn ways to use of ArcPy to control ArcGIS Enterprise and explore topics on deployments, data quality assurances, data updates, version control, and editing safeguards.By the end of the book, you will be equipped with the knowledge required to create automated analysis with administration reducing the time-consuming nature of GIS.Style and approachThe book takes a pragmatic approach, showing ways to automate repetitive tasks and utilizing features of ArcPy with ArcGIS Pro and ArcGIS online.
Frequently asked questions
Information
Introduction to Python for ArcGIS
- Quick Overview of Python: what it is and what it does, who created it, where is it now
- Important Python modules, both built-in and third party
- Python core concepts including data types, data containers, and looping
- The location of the Python interpreter, and how it is called to execute a script
- Adjusting the computer's environment variables to ensure correct code execution
- Integrated Development Environments (IDEs)
- Python's folder structure, and where the modules are stored
Python as a programming language
Interpreted language
Standard (built-in) library
Glue language
Wrapper modules
The basics of Python programming
Import statements
import arcpy
import arcpy, os, sys
from arcpy import mapping
from arcpy import mapping, da
from arcpy import *
Variables
- Making them descriptive: Don't just name a variable, x; that variable will be useless later when the script is reviewed, and there is no way of knowing what it is used for, or why. They should be longer rather than shorter, and should explain what they do, or even what type of data they hold. For example:
shapefilePath = "C:/Data/shapefile.shp"
- Using CamelCase to make the variable readable: Camel case is a term used for variables that start with a lowercase letter but have uppercase letters in the middle, resembling a camel's hump. For example:
camelCase = 'camel case is twoWords stuck together like this'
- Using an underscore to separate parts of the name: This makes the name longer, but adds some clarity when reading the variable name, like this:
location_address = '100 Main St'
- Including the data type in the variable name: If the variable contains a string, call it variableString or variable_string. This is not standard, and will not be used in this book, but it can help organize the script, and is helpful for others who will read these scripts. Python is dynamically typed instead of statically typed, a programming language distinction, which means that a variable does not have to be declared before it can be used, unlike Visual Basic or other statically typed languages. For example:
variableString = 'this is a string'