ArcPy and ArcGIS – Geospatial Analysis with Python
eBook - ePub

ArcPy and ArcGIS – Geospatial Analysis with Python

Silas Toms

Condividi libro
  1. 224 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

ArcPy and ArcGIS – Geospatial Analysis with Python

Silas Toms

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

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.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
ArcPy and ArcGIS – Geospatial Analysis with Python è disponibile online in formato PDF/ePub?
Sì, puoi accedere a ArcPy and ArcGIS – Geospatial Analysis with Python di Silas Toms in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Ciencia de la computación e Servicios web y API. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2015
ISBN
9781783988679

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

Indice dei contenuti