Chapter 4. Analyzing Crime Patterns with ArcGIS Desktop, ArcPy, and Plotly(Part 1)
This is the first of two chapters that will cover the creation of crime analysis tools, using a combination of ArcGIS Desktop with arcpy
, arcpy.mapping
, and arcpy.da
along with the Python requests and plotly
modules. Data for the application will be pulled from the Seattle Open Data initiative, which contains crime data, among many other datasets. The Socrata
API will be used to request the crime data that will be used in our analysis tools.
Three tools will be built in this chapter and added to a custom ArcGIS Python Toolbox. The initial focus of this chapter will be the construction of a tool that connects to the open database using the Python requests
module with the Socrata
API to request and receive data. The data will be written to a local geodatabase feature class. A second tool will take the imported records and aggregate to boundary datasets, such as census block groups, police precincts...