Python For ArcGIS Enterprise - Esri · Agenda • What is the ArcGIS API for Python? • Getting...

Post on 14-Oct-2020

22 views 0 download

Transcript of Python For ArcGIS Enterprise - Esri · Agenda • What is the ArcGIS API for Python? • Getting...

Python For ArcGIS EnterpriseJames Sill, Solution Engineer

Boulder, Co

Agenda

• What is the ArcGIS API for Python?

• Getting Started- Installation & Jupyter Notebooks

- Help & API Reference

• The GIS connection object:- Demo: Connecting to your AGOL and Enterprise org’s via the ArcGIS Python API

• Demo Jupyter Notebook Workflows- Running Raster Analytics via the Jupyter Interface

- Predictive Analysis (Leveraging ArcPy, Python API to produce Machine learning outputs from ArcGIS Pro)

- Administrative workflows for ArcGIS Online and ArcGIS Enterprise

Development Roadmap for ArcGIS Python API

Questions

gis

features

geoanalytics

geocoding

geometry

schematicsnetwork

realtimewidgets

mappingenv

geoprocessing

geoenrichment

raster

API Overview

Why Python?

• Popularity

• Productivity

• Interoperability

• Solves the “two language” problem

• Scientific Python ecosystem

• Community

What is the ArcGIS API for Python?

REST

Organization

Overview of the ArcGIS API for Python

• A Pythonic GIS API

• Corresponds to best practices

• Uses standard Python constructs

• Data structures with clean, readable idioms

• Easy for a Python programmer to use ArcGIS

• Easy for an ArcGIS user to script and automate their GIS

geometry

geoprocessing

network

schematics

featuresraster

realtime

widgets

mapping

geoanalytics

gisgeocoding

geoenrichment

ArcGIS API for Python vs ArcPy

• ArcGIS API for Python- Script against your Web GIS

- ArcGIS Online or ArcGIS Enterprise

- Python 3.x- Analysis, Portal Admin, Content

Creation, Big Data Analysis, Leverages Elastic Cloud Computing Capacity

• ArcPy- ArcGIS Desktop

- ArcMap – Python 2.x- ArcGIS Pro – 3.x

- Mostly geoprocessing- Some map automation

Spatial Analysis & Geoprocessing

Big Data GeoAnalytics

Interactive Exploration

GIS Analysis

ContentPublishing

Desktop Apps

Org administration

Developers

Whom is it for?

Automate Web GIS management

• Populate portal with users, groups

• Clone portals

• Re assign user content

• Perform comprehensive content search

• Determine item relationship

• Create reports of users, their items

Automate content creation

• Automate content publishing during off peak hours

• Update tiles and features from a known database

• Replicate development environment content to production

• Inspect and update items with broken service links

Reproducible research

• Access big data tools programmatically

• Utilize rich 3rd party Python packages for data analysis

• Create rich charts, graphs, embed 2D and 3D maps in Jupyter Notebook environment

• Share your research with data and notes with peers

How do I get it?

Installation via ArcGIS Pro

• ArcGIS Pro 2.1? - arcgis package comes deployed and ready to use.

• Install Anaconda with Python 3.5 or later- conda install –c esri arcgis

- Conda will install all dependencies

• Test it out

How do you get this continued….

• Distributed via Conda- Simplifies installs & updates

- Installs dependencies

- Avoids conflicts

• Install steps:- Download Anaconda

- conda install –c esri arcgis

Via the Command Line:

Install as a Docker Image

• The ArcGIS Python API is shipped as a Docker Image

• Download and power up whenever you want to use the API

• These images, when spun up into containers, run in an isolated environment without making any changes to your local file system

Follow these steps on the link below to get Docker on your machine and Run the API:

• https://developers.arcgis.com/python/guide/install-and-set-up/#Install-as-a-Docker-image

Install - Offline

Install the API on a machine without internet access or on a disconnected network with the following steps:

• Install the latest version of full Anaconda for Python 3x for your OS

• Download the latest version of the ArcGIS API for Python appropriate for your OS from Esri's channel on anaconda.org

• For instance, if you are installing on Linux 64-bit, download linux-64/arcgis-1.0.1-py36_1.tar.bz2 package

• Open your terminal application and install the API

• “conda install /path_to_package_download_folder/linux-64/arcgis-1.0.1-py36_1.tar.bz2”

Disconnected Considerations

• Can you use the Python API in disconnected environments?- Yes!!

• ArcGIS Pro 2.1+

• Download Anaconda, move to disconnected network, and install

• Download arcgis package from Conda, move to disconnected nework, and install

• Will need a local JSAPI for Map Widget Notebook integration- Modify custom.css and mapview.js

Different Authentication Schemes

• Anonymous users

• Built-in users

• Users using LDAP, via- Basic authentication

- Portal tier authentication

• SAML Support

• Users using Integrated Windows Authentication (IWA) through NTLM or Kerberos

• Smart card users / PKI authentication using certificate and key files

• Users connected to an ArcGIS Enterprise instance using ArcGIS Pro

Demo

Common Questions

Do I need to use Jupyter Notebooks for the ArcGIS API for Python for automating tasks?

NO!

Can I use my favorite Python IDE (e.g. vim) to write scripts as usual?

YES!

Many users choose IDE’s that support both the Jupyter interfaceas well as the traditional IDE interface

Can I use the Windows Task Scheduler or Crontab as you normally would?

Yes!Just make sure you have all the necessary dependencies installed for the capabilities in the Python API installed on the execution system.

If I write scripts and run them on the command line, does that mean I can't take advantage of the spatial Pandas Dataframe or the Analysis capabilities of the ArcGIS API for Python since it won't run in a Jupyter Notebook?

NO!You just won't be able to visual the results instantly as in Jupyter…

Development Roadmap

Continuous Online Improvements

Raster Analysis

Big Data GeoAnalytics

10.5(b)v0.3

Incremental Software Release

v1.0

v1.2

Realtime GIS

10.5

Mid 2016

2017

Road Map

Smart Mapping

Scientific Modeling

2016

v1.1 10.5.1

Mid 2017

Live samples

micro services

Notebooks as items

Scheduling notebooks

SDK Docker image

Workflow integrationsmachine

learning

3DServer GIS

Spatial dataframes

• Notebook files as items in your GIS

• Jupyter Notebook server will be included as part of the base ArcGIS Enterprise Deployment

ArcGIS Python API development Road Map Highlights:

• More Server Side Functionality exposed through API

• Leveraging custom python raster functions

• Imagery Ortho rectification tools as python functions

• Greater Integration with data science and predictive analysis tools in ArcGIS Pro and Enterprise

• Better 3D rendering and analysis tools

• Ability to schedule notebooks as tasks within ArcGIS Enterprise

• Expanded scientific modeling tools and functions

Help Documentation, API, and Samples

• https://developers.arcgis.com/python/

github.com/Esri/arcgis-python-api

developers.arcgis.com/python

Resources

hub.docker.com/r/esridocker

Notebooks.esri.com

Resources