Chapter 1. Extracting Real-Time Wildfire Data from ArcGIS Server with the ArcGIS REST API
The ArcGIS platform, which contains a number of different products, including ArcGIS Desktop, ArcGIS Pro, ArcGIS for Server, and ArcGIS Online, provides a robust environment to perform geographic analysis and mapping. The content produced by this platform can be integrated using the ArcGIS REST API and a programming language such as Python. Many of the applications we'll build in this book use the ArcGIS REST API as the bridge to exchange information between software products.
We're going to start by developing a simple ArcGIS Desktop custom script tool in ArcToolbox
that connects to an ArcGIS Server map service to retrieve real-time wildfire information. The wildfire information will be retrieved from a USGS map service that provides real-time wildfire data. For this chapter and all other chapters in this book, the reader is expected to have intermediate-level experience of Python and ArcPy
. Ideally, you should be running version 10.3 or 10.2 of ArcGIS Desktop. Previous versions of ArcGIS Desktop have some significant differences that may cause problems in the development of some applications in the book.
We'll use the ArcGIS REST API and the Python requests module to connect to the map service and request the data. The response from the map service will contain data that will be written to a feature class stored in a local geodatabase using the ArcPy
data access module.
This will all be accomplished with a custom script tool attached to an ArcGIS Python Toolbox. ArcGIS Python toolboxes are relatively new; they were first introduced in version 10.1 of ArcGIS Desktop. They provide a Python-centric method to create custom toolboxes and tools. The older method to create toolboxes in ArcGIS Desktop, while still relevant, requires a combination of Python and a wizard-based approach to create tools.
In this chapter, we will cover the following topics:
- ArcGIS Desktop Python's toolboxes
- The ArcGIS Server map and feature services
- The Python requests module
- The Python JSON module
- The ArcGIS REST API
- The
ArcPy
data access module that isarcpy.da
A general overview of the Python libraries for ArcGIS is provided in the appendix of this book. It is recommended that you read this chapter before continuing with the appendix and other chapters.