#ARCGIS PYTHON API PRO#
Starting with ArcGIS Pro 2.4, Python developers will have fine-grained access to the Cartographic Information Model (CIM) and can access many more settings, properties, and capabilities that are persisted in a project or document. It may take a release or more before you have access through the managed APIs. Another reason is that ArcGIS Pro is being developed at such a rapid pace that the APIs can't keep up. One reason is to keep the API streamlined, simple, and manageable. It includes a diverse set of exposed classes, class properties, and helper functions, but it does not provide access to all properties, settings, and capabilities available in ArcGIS Pro. The arcpy.mp module is a coarse-grained Python API that is designed to provide access to many common map automation tasks. Additional resources and sample scripts.We can also create a histogram using the shape length field as input. We can use the HTML library to return the same output in a more readable way: The outcome looks like XML data inside a HTML file and is not very readable for humans. For example, the PopupInfo value of the first item can be accessed as follows: You can also access a separate cell value. Here, we print the column names and values of the first item: loc property can be used to subset entire rows, using the row´s index number, starting from zero. We can print the different column names as follows: For example, the shape function returns the amount of rows and columns of the entire DataFrame as a tuple: There are many functions to describe the data inside pandas DataFrame objects. The following pandas dataframe will be shown inside your Jupyter Notebook: It is not necessary to import the pandas library, as it one of the dependencies of the arcgis package, imported in the first line of code. Using the head function in the second line, we´ll only print the first five rows. We´ll now create a variable that holds the DataFrame object from the layer we´re interested in. Python returns only one item, so there´s only one layer (it is not displayed here to save space): We can reference this item as follows, in order to see how many layers it contains. Reference the item and create the DataFrame object.The item we’re interested in is the following item, returned as the first search result: out: [, … In: search_result = (query=”bruce trail”, item_type=”Feature Layer”, max_items = 5) We´ll search for a feature layer called “Bruce Trail” inside of ArcGIS Online: Make sure you have the latest available version of the API installed, which is version 1.3.įirst, we´ll login to ArcGIS Online using the Jupyter Notebook app:įeature layers are collections of layers containing geographical features as vectors. To follow the instructions, you can open a new Jupyter Notebook.
![arcgis python api arcgis python api](https://community.esri.com/legacyfs/online/456316_pastedImage_3.png)
Specifically, it uses pandas DataFrame objects that present data in a tabular form, comparable to Excel spreadsheets. The ArcGIS API for Python uses the pandas library to display and edit attribute info.
![arcgis python api arcgis python api](https://developers.arcgis.com/assets/img/sdk-promos/develop-map-app.jpg)
It works particularly well with Jupyter Notebooks, where you can also use bash commands, magic commands, plotting capabilities and take advantage of a nice overall presentation of code, visuals and comments. Pandas is a Python package for data manipulation and analysis. After searching and referencing spatial data, you the pandas library enables you to subset, describe and plot attribute data.
![arcgis python api arcgis python api](https://community.esri.com/html/assets/EsriCommunity.jpg)
#ARCGIS PYTHON API HOW TO#
This short tutorial covers how to use the ArcGIS API for Python and pandas DataFrame objects for displaying tabular data inside of your Jupyter Notebook application.