-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Programming ArcGIS with Python Cookbook, Second Edition
By :
The ArcGIS REST API has a large set of operations that you can use when requesting information from an ArcGIS Server instance. For example, you can export maps, query layers, geocode addresses, and much more. In this recipe, you will learn how to export a map image from a map service.
The export operation can be used to create a map image from a map service. The response to this request includes the URL of the image, width, height, extent, and scale. In this recipe, you'll use the export operation to export a map as an image file.
In your Python development environment, create a new script, save it as C:\ArcpyBook\Ch12\ExportMapToImage.py.
Import the requests and json modules:
import requests import json
Create a new variable called agisurl, assign the URL, and export the operation, as seen here:
import requests
import json
agisurl = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA...
Change the font size
Change margin width
Change background colour