Getting layer information with the ArcGIS REST API and Python

A map service resource contains datasets that can include tables or layers. It contains basic information about a service, including feature layers, tables, and service descriptions. In this recipe, you will learn how to return layer information from a map service, using Python and the ArcGIS REST API.

Getting ready

To get information about a specific layer in a map service, you will need to reference the index number that is associated with the layer. When you examine the Services Directory page for a service, you will find a list of layers that are part of the map service along with index numbers for each layer. The index numbers are used instead of the layer name when requesting information ...

Get Programming ArcGIS with Python Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.