Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been...

27
Gerhard Trichtl Python: Mapautomation in ArcGIS Pro Beyond The Basics

Transcript of Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been...

Page 1: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Gerhard Trichtl

Python:Mapautomation in ArcGIS Pro Beyond The Basics

Page 2: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

arcpy.(m)a(p)ping samples

http://esriurl.com/8899

Page 3: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Migrating to ArcGIS Pro

http://esriurl.com/9785

Page 4: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Python 2 vs. Python 3

• Python 2.x:- ArcGIS Desktop, ArcGIS Server Map Runtime- End of Support: 01.2020

• Python 3.x:- ArcGIS Pro, ArcGIS Server Pro Runtime, Hosted Notebooks, ArcGIS API for Python

• https://www.esri.com/arcgis-blog/products/arcgis/announcements/how-sunsetting-python-2-affects-arcgis/

• Windows 7/Windows 2008 R2- Support ends form Microsoft with January 2020 – so also ArcGIS would not longer support

those OS‘s – see also Deprection notes- https://support.esri.com/en/technical-article/000017062 - Last version:

http://downloads.esri.com/Support/downloads/other_/DEPRECATED%20FEATURES%20PLAN%20FOR%20ARCGIS%2010.7.x%20and%20ArcGIS%20Runtime%20SDK%20100.x%20Mid-Year%202019%20v1b%20Final%20%2009042019.pdf 4

Page 5: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Sharing Maps

https://pro.arcgis.com/en/pro-app/arcpy/sharing/introduction-to-arcpy-sharing.htm

Page 6: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Demo

Publish ToStandalone Server

Page 7: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Publish to Standalone ArcGIS Server – demo source code

Page 8: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Publish to Standalone Server – starting with 2.3/UI with 2.4

• Publishing ArcGIS Pro Maps directly to ArcGIS Server• Target to Support ArcGIS Server 10.4+

- Symbology/Mapping function based on the ArcGIS Pro-Runtime-Version which is in theServer included

ArcGIS Server Version Included ArcGIS Pro Runtime10.4 1.2

10.4.1 1.310.5 1.4

10.5.1 2.010.6 2.1

10.6.1 2.210.7 2.3

10.7.1 2.4

Page 9: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Cartographic Information Model - CIM

Page 10: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Python CIM Access in Pro (released with Pro 2.4)

• CIM (Cartographic Information Model)- Specification for how project and document information

is persisted and re-created- MAPX, PAGX, LYRX files are in a JSON format- Structure is analogous to an object model diagram

• Arcpy.mp can navigate the CIM object model- Entry points are with the Map, Layer, Table or Layout objects

• Don’t let the name fool you – you have access to so much more than cartography!

Help topic: http://esriurl.com/15489Video: http://esriurl.com/15490

Page 11: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Show CIM -Renderer

Page 12: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

CIM-Version & Renderer Sample

Page 13: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Why CIM Access

• Provide finer grained access to project properties• Pro is growing so rapidly, the CIM immediately exposes new capabilities• It has been available to the .NET SDK community since Pro 1.1

• Why not use the CIM- Doesn’t provide access to everything

- high level project properties, metadata, change spatial reference- Can’t create new objects. If it is not in the CIM, you can’t access it.- No life guard (managed UI or API) on duty

- You can break the behavior of the app- Test thoroughly

… and why not

Page 14: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Basic workflow

cim_obj = Object.getDefinition(version) #’V2’

### Do something to the CIM object

Object.setDefinition(cim_obj)

* Object = Map, Layer, Table or Layout

Page 15: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Simple Sample working with CIM

Page 16: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Sample Code to modify Alias-Name of Field

Page 17: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Modify Symbology

Page 18: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Modify Symbology

Page 19: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Modify Chart

Page 20: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Modify Chart - SampleCode

Page 21: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Modify Layout

Page 22: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation
Page 23: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation
Page 24: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation
Page 25: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Also come to the Booth for further QuestionsQuestions ?

Page 26: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation

Complete answersand select “Submit”

Scroll down to find the feedback section

Select the session you attended

Download the Esri Events app and find your event

Please Take Our Survey on the App

Page 27: Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been available to the .NET SDK community since Pro 1.1 ... 2019 European Developer Summit--Presentation