Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been...
Transcript of Python: Mapautomation in ArcGIS Pro Beyond The Basics...Python 2 vs. Python 3 ... • It has been...
Gerhard Trichtl
Python:Mapautomation in ArcGIS Pro Beyond The Basics
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
Sharing Maps
https://pro.arcgis.com/en/pro-app/arcpy/sharing/introduction-to-arcpy-sharing.htm
Demo
Publish ToStandalone Server
Publish to Standalone ArcGIS Server – demo source code
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
Cartographic Information Model - CIM
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
Show CIM -Renderer
CIM-Version & Renderer Sample
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
Basic workflow
cim_obj = Object.getDefinition(version) #’V2’
### Do something to the CIM object
Object.setDefinition(cim_obj)
* Object = Map, Layer, Table or Layout
Simple Sample working with CIM
Sample Code to modify Alias-Name of Field
Modify Symbology
Modify Symbology
Modify Chart
Modify Chart - SampleCode
Modify Layout
Also come to the Booth for further QuestionsQuestions ?
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