Design
Let's spend a little time going over the design of what we're going to build in this chapter. This application will be contained within an ArcGIS Python Toolbox called CrimeAnalysis.pyt
. Inside the toolbox, three tools will be created, including ImportRecords
, AggregateCrimes
, and CreateMap
. The ImportRecords
tool will use the Python requests module to request crime data from the Seattle Police Department open database using the Socrata
API. Crime data will be returned to the tool and then written to a local SeattleCrimes
geodatabase using the arcpy.da
module. The AggregateCrimes
tool will use these imported point feature classes and aggregate them to polygon boundary layers, including census block groups, police precincts, and neighborhood boundaries. Finally, the CreateMap
tool will allow the end user to select one of the boundary files that include aggregated crime data and automate the process of creating, exporting, and printing maps, as shown in the following screenshot...