ArcPy and ArcGIS – Geospatial Analysis with Python
eBook - ePub

ArcPy and ArcGIS – Geospatial Analysis with Python

Silas Toms

Buch teilen
  1. 224 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

ArcPy and ArcGIS – Geospatial Analysis with Python

Silas Toms

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

About This Book

  • Perform GIS analysis faster by automating tasks, such as selecting data or buffering data, by accessing GIS tools using scripting
  • Access the spatial data contained within shapefiles and geodatabases, for updates, analysis and even transformation between spatial reference systems
  • Produce map books and automate the mapping of geospatial analyses, reducing the time needed to produce and display the results

Who This Book Is For

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

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist ArcPy and ArcGIS – Geospatial Analysis with Python als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu ArcPy and ArcGIS – Geospatial Analysis with Python von Silas Toms im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Ciencia de la computación & Servicios web y API. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

ArcPy and ArcGIS – Geospatial Analysis with Python


Table of Contents

ArcPy and ArcGIS – Geospatial Analysis with Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Introduction to Python for ArcGIS
Overview of Python
Python as a programming language
Interpreted language
Standard (built-in) library
The glue language
Wrapper modules
The basics of Python
Import statements
Variables
For loops
If/Elif/Else statements
While statements
Comments
Data types
Strings
Integers
Floats
Lists
Tuples
Dictionaries
Iterable data types
Other important concepts
Indentation
Functions
Keywords
Namespaces
Zero-based indexing
Important Python Modules for GIS Analysis
The ArcPy module
The Operating System (OS) module
The Python System (SYS) module
The XLRD and XLWT modules
Commonly used built-in functions
Commonly used standard library modules
Summary
2. Configuring the Python Environment
What is a Python script?
How Python executes a script
What is the Python interpreter?
Where is the Python interpreter located?
Which Python interpreter should be used?
How does the computer know where the interpreter is?
Make Python scripts executable when clicked on
Integrated Development Environments (IDEs)
IDLE
PythonWin
Aptana Studio 3
IDE summary
Python folder structure
Where modules reside
Using Python's sys module to add a module
The sys.path.append() method
Summary
3. Creating the First Python Script
Prerequisites
ModelBuilder
Creating a model and exporting to Python
Modeling the Select and Buffer tools
Adding the Intersect tool
Tallying the analysis results
Exporting the model and adjusting the script
The automatically generated script
File paths in Python
Continuing the script analysis: the ArcPy tools
The Intersect tool and string manipulation
The string manipulation method 1–string addition
The string manipulation method 2–string formatting #1
The string manipulation method 3–string formatting #2
Adjusting the Script
Adding the CSV module to the script
Accessing the data: Using a cursor
The final script
Summary
4. Complex ArcPy Scripts and Generalizing Functions
Python functions–Avoid repeating code
Technical definition of functions
A first function
Functions with parameters
Using functions to replace repetitive code
More generalization of the functions
Summary
5. ArcPy Cursors – Search, Insert, and Update
The data access module
Attribute field interactions
Update cursors
Updating the shape field
Adjusting a point location
Deleting a row using an Update Cursor
Using an Insert Cursor
Inserting a polyline geometry
Inserting a polygon geometry
Summary
6. Working with ArcPy Geometry Objects
ArcPy geometry object classes
ArcPy Point objects
ArcPy Array objects
ArcPy Polyline objects
ArcPy Polygon objects
Polygon object buffers
Other Polygon object methods
ArcPy geometry objects
ArcPy PointGeometry objects
Summary
7. Creating a Script Tool
Adding dynamic parameters to a script
Displaying script messages using arcpy.AddMessage
Adding dynamic components to the script
Creating a Script tool
Labelling and defining parameters
Adding data types
Adding the Bus Stop feature class as a parameter
Adding the Census Block feature class as a parameter
Adding the Census Block field as a parameter
Adding the output spreadsheet as a parameter
Adding the spreadsheet field names as a parameter
Adding the SQL Statement as a parameter
Adding the bus stop fields as a parameter
Inspecting the final script
Running the Script Tool
Summary
8. Introduction to ArcPy.Mapping
Using ArcPy with map documents
Inspecting and replacing layer sources
Fixing the broken links
Fixing the links of individual layers
Exporting to PDF from an MXD
Adjusting map document elements
Automated map document adjustment
The variables
The map document object and the text elements
The layer objects
Replacing the data sources
Adjusting layer visibility
Generating a buffer from the bus stops feature class
Intersecting the bus stop buffer and census blocks
Populating the selected bus stop and buffer feature classes
Updating the text elements
Exporting the adjusted map to PDF
Running the script in the Python Window
Summary
9. More ArcPy.Mapping Techniques
Using arcpy.mapping to control Layer objects
Layer object methods and properties
Definition queries
Controlling the data frame window extent and scale
Adding a Layer object
Exporting the maps
Summary
10. Advanced Geometry Object Methods
Creating a Python module
The __init__.py file
Adding advanced analysis components
Advanced Polygon object methods
Generating random points to represent population
Using the functions within a script
Creating an XLS using XLWT
Summary
11. Network Analyst and Spatial Analyst with ArcPy
The Network Analyst extension
Using Network Analyst
Creating a Feature Dataset
Importing the datasets
Creating the Network Dataset
Accessing the Network Dataset using ArcPy
Breaking down the script
The Network Analyst module
Accessing the Spatial Analyst Extension
Adding elevation to the bus stops
Using Map Algebra to generate elevation in feet
Adding in the bus stops and getting elevation values
The final result
Summary
12. The End of the Beginning
Getting field information from feature classes
Accessing the ListFields' properties
List comprehensions
Creating the field information functions
Querying feature class information
Generating File Geodatabases and feature classes
Generating a feature class
Setting up the script tool parameters
Environmental settings
Resolution and tolerance settings
Summary
Index

ArcP...

Inhaltsverzeichnis