Book Image

ArcGIS Blueprints

By : Donald Eric Pimpler, Eric Pimpler
Book Image

ArcGIS Blueprints

By: Donald Eric Pimpler, Eric Pimpler

Overview of this book

This book is an immersive guide to take your ArcGIS Desktop application development skills to the next level It starts off by providing detailed description and examples of how to create ArcGIS Desktop Python toolboxes that will serve as containers for many of the applications that you will build. We provide several practical projects that involve building a local area/community map and extracting wildfire data. You will then learn how to build tools that can access data from ArcGIS Server using the ArcGIS REST API. Furthermore, we deal with the integration of additional open source Python libraries into your applications, which will help you chart and graph advanced GUI development; read and write JSON, CSV, and XML format data sources; write outputs to Google Earth Pro, and more. Along the way, you will be introduced to advanced ArcPy Mapping and ArcPy Data Access module techniques and use data-driven Pages to automate the creation of map books. Finally, you will learn advanced techniques to work with video and social media feeds. By the end of the book, you will have your own desktop application without having spent too much time learning sophisticated theory.
Table of Contents (18 chapters)
ArcGIS Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating the Aggregate Crimes tool


The Aggregate Crimes tool will aggregate the crimes to a polygon layer, such as census block groups or police precinct boundaries. This tool will use the existing SpatialJoin tool found in the Analysis Tools toolbox to summarize the total number of crimes in each polygon. Two polygon feature classes have been provided for you: Seattle_BG and Seattle_Merge_Precincts. The former contains census block groups for Seattle, while the later contains police precincts for Seattle. Both datasets are in the C:\ArcGIS_Blueprint_Python\data\crime folder. The Aggregate Crimes tool will prompt the user to select a polygon layer, crime dataset, and output feature class; it will then perform a spatial join:

  1. Open C:\ArcGIS_Blueprint_Python\ch4\SeattleCrimes.mxd in ArcMap.

  2. Duplicate the code that you have already created for the ImportRecords class by copying and pasting this class into the same CrimeAnalysis.pyt file.

  3. Rename the duplicated ImportRecords class as AggregateCrimes...