Creating the Enrich Potential Stores tool
The final tool that we'll create in this chapter is the Enrich Potential Stores tool. It will assign socio-economic attributes pulled from the ArcGIS Online GeoEnrichment service to the features created with the Define Potential Stores tool. Using the Python requests
module, it will pass a list of features and a drive time value to the GeoEnrichment service. The GeoEnrichment service will create a drive time polygon around each potential store and calculate socio-economic variables for the total Starbucks expenditures and the total fast food breakfast expenditures in that area. This information will then be written to the potential stores' feature class. The following steps will help you to create the Enrich Potential Stores tool:
Before coding this tool, some background information on the GeoEnrichment service and the ArcGIS REST API needs to be introduced. In your web browser, go to http://resources.arcgis.com/en/help/arcgis-rest-api/index.html...