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

Continuing the script analysis: the ArcPy tools


The next, and most important, section of the script is where the analysis is executed. The same tools that we created in the model, the Select, the Buffer, and the Intersect tools, are included in this section. The same parameters that we supplied in the model are also included here: the inputs and outputs, plus the SQL statement in the Select tool, and the buffer distance in the Buffer tool.

The tool parameters are supplied to the tools in the script in the same order as they appear in the tool interfaces in the model. Here is the Select tool in the script:

arcpy.Select_analysis(Bus_Stops, Inbound71, "NAME = '71 IB' AND BUS_SIGNAG = 'Ferry Plaza'")

It works like this. The arcPy module has a method, or a special property, called Select_analysis. This method, when called, requires three parameters: the input feature class (or shapefile), the output feature class, and the SQL statement. In this example, the input is represented by the variable...