Book Image

ArcPy and ArcGIS: Geospatial Analysis with Python

Book Image

ArcPy and ArcGIS: Geospatial Analysis with Python

Overview of this book

Table of Contents (19 chapters)
ArcPy and ArcGIS – Geospatial Analysis with Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Accessing the Spatial Analyst Extension


The Spatial Analyst Extension is very important to perform analysis on both raster and vector datasets, but it is generally used to perform surface analysis and raster math. These operations are made even easier by the use of ArcPy, as all of the tools available in the Spatial Analyst Toolbox are exposed with the Spatial Analyst access module. This includes the Raster Calculator tools, making map algebra easy by using the tools and operators in simple expressions.

Adding elevation to the bus stops

The elevation raster "sf_elevation" has been downloaded from NOAA and added to the File Geodatabase. However, it covers the entire Bay Area, and we should write a script to only extract an area of the city of San Francisco as it will reduce the time needed to run our scripts. We'll use a SQL statement as the where clause to limit the results to the South of Market (SoMa) neighborhood. To do so, let's take advantage of a Search Cursor and the Spatial Analyst...