CREATING ARCGIS DESKTOP ADD-INS USING PYTHON AND RELATED PACKAGES/MODULES 2016 AGIC Education and Training Symposium September 22, 2016 Erik Glenn ● Pima.

Slides:



Advertisements
Similar presentations
Geo GIS Practicuum Introduction to ArcGIS 8 Exercise 5 - ESRI Virtual Campus Chapters 1-2, ArcGIS Methods …
Advertisements

Intro to ArcGIS for New Users. ArcGIS Desktop Advanced GeoprocessingArcInfo ArcReader Data Access Map Viewing Query Advanced EditingArcEditor ArcView.
Introducing ArcGIS Desktop
Michael Donovan, River Campus Libraries – 12/03 DocuShare Overview and Training.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
Introduction to ESRI Add-Ins
Esri UC 2014 | Technical Workshop | Working with Metadata in ArcGIS Aleta Vienneau.
Esri International User Conference | San Diego, CA Technical Workshops | Migrating Custom Desktop Solutions from 9.3 to 10 John Hauck and Ralf Gottschalk.
ArcGIS Extensions Expanding the Use of ArcGIS
Lesley Bross, August 25, 2010 ArcGIS 10 Add-In Components and Controls.
Introduction to ArcGIS Add-Ins Exercises GIS/LIS Conference, 2014 Rochester, MN.
ArcGIS Workflow Manager An Introduction
Linux Operations and Administration
Sikuli Ivailo Dinkov QA Engineer PhoneX Team Telerik QA Academy.
Introduction to InVEST ArcGIS Tool Nasser Olwero GMP, Bangkok April
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Creating.NET Add-ins.
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
Writing Geoprocessing Scripts With ArcGIS Lecture 9.
Introduction to Spatial Analysis and Spatial Modeling
© 2012 LogiGear Corporation. All Rights Reserved Robot framework.
Arc: AddIns Dr Andy Evans. Java Direct access to ArcObjects Framework inside and outside Arc. Ability to add components to the GUI. Ability to communicate.
Python: An Introduction
Introduction to ArcGIS. Goals Become familiar with ArcGIS ▫Locating and running the program ▫Introduction to the 3 ArcGIS interfaces ▫Experience with.
Extending ArcGIS for Server
Welcome to DEP’s GIS Workshop Series Workshop 3 Introduction to ArcGIS Desktop 1.
Virtual Ice Charting System Archive Browser Interface Distribution IngestProduction Ice Analyst Application Database Click on the boxes for more information.
ArcGIS Pro: An Introduction
Advance Map Automation With Python
Integrating Open Source Statistical Packages with ArcGIS Mark V. Janikas Liang-Huan (Leo) Chin.
Technical Workshops | Esri International User Conference San Diego, California Creating Geoprocessing Services Kevin Hibma, Scott Murray July 25, 2012.
Esri UC 2014 | Technical Workshop | Python Map Automation – Beyond the Basics of arcpy.mapping Jeff Barrette Jeff Moulds.
Section 11: Implementing Software Restriction Policies and AppLocker What Is a Software Restriction Policy? Creating a Software Restriction Policy Using.
ArcGIS Pro What it is: “essential application for creating and working with spatial data on your desktop.” “It will not replace arcmap” (at least for.
Building the Events Components– Lesson 111 Building the Events Components Lesson 11.
ATN GIS Support Introduction to ArcGIS.
ESRI Education User Conference – July 6-8, 2001 ESRI Education User Conference – July 6-8, 2001 Introducing ArcCatalog: Tools for Metadata and Data Management.
Esri UC 2014 | Technical Workshop | Python Map Automation – Introduction to arcpy.mapping Michael Grossman Jeff Barrette.
How to Apply PDF in Flipbook on Website. Description If you are finding solution for applying PDF in flipbook mode on website, and adding multimedia items.
LAB302 Image Enabling Host Applications. Introduction What is the purpose of this class? What will we learn? What will you walk away with?
WV DOT Scanning Project
Jeff Barrette Jeff Moulds
Introduction to InVEST ArcGIS Tool
ArcGIS Workflow Manager: Advanced Workflows and Concepts
Lab 1 Introduction to ArcGIS Feb 17, 2016
IBM Rational Rhapsody Advanced Systems Training v7.5
Mark V. Janikas Marjean Pobuda
PYTHON: AN INTRODUCTION
Hazards Planning and Risk Management INTRODUCTION TO ARCGIS
Introduction to ArcGIS Add-Ins
Hazards Planning and Risk Management INTRODUCTION TO ARCGIS
Lecture 13 RPM and its advantages.
Introduction to ArcGIS
Writing Geoprocessing Scripts With ArcGIS
Addins Dr Andy Evans Welcome to the course. You’ll find extra information in these note sections below each slide.
Addins Dr Andy Evans Welcome to the course. You’ll find extra information in these note sections below each slide.
Microsoft PowerPoint 2007 – Unit 2
Building Map Books in ArcGIS
Web AppBuilder for ArcGIS
Building Add-ins for ArcGIS Desktop in .NET
Python Map Automation – Beyond the Basics of arcpy.mapping
Network Analysis using Python
Building Map Books in ArcGIS
Network Analyst – Automating Workflows with Geoprocessing
ArcGIS Pro: Pros, Cons & Everything In-between
Building Add-ins for ArcGIS Desktop in .NET
Programming Arc.
Desktop Mapping: Building Map Books
ArcGIS Pro: An Introduction Overview
Presentation transcript:

CREATING ARCGIS DESKTOP ADD-INS USING PYTHON AND RELATED PACKAGES/MODULES 2016 AGIC Education and Training Symposium September 22, 2016 Erik Glenn ● Pima County ITD-GIS

Presentation Outline  Overview  20 minutes + 5 mins for questions  Types of add-ins  Creating add-ins  Testing, sharing, and extending add-ins  Simple example  Additional resources  Summary/Questions

What are Add-ins?  Desktop application customization  User interface  All Desktop products (ArcMap, ArcCatalog, ArcGlobe, ArcScene)  Introduced at Desktop version 10.0  Very simple to distribute, install and use

When Should You Use Add-ins?  Limitations of toolboxes (custom & Python)  Increasing complexity:  Toolboxes => Desktop add-ins => Extending add-ins  What are you trying to accomplish?  Geoprocessing (ONLY FOR TRIGGERING…)  Rearranging existing tools or putting them in custom toolbar (NO)  Interacting with user interface (YES!)  Running code based on response to a Desktop event (YES!)

Benefits of Add-ins  Easy to build, install and share  Don’t need to build installation programs  Don’t require COM registration  Can build with three different development environments: .NET  Java  Python, too!

Python Add-ins vs..NET/Java  Python Add-ins introduced at version 10.1  Even easier!  No DLLs  Can use ArcPy rather than ArcObjects  Fewer lines of code  Less development time

Limitations of Python Add-ins  Can’t use in ArcGIS Pro  Have to import a toolbox to Pro, or  use ArcGIS Pro SDK for.NET  Not backward-compatible  Can’t use full functionality of ArcObjects  No officially-supported module for custom user interface components  Tool license level requirements still apply

Types of Python Add-ins  Toolbars are now dockable!  Python and.NET tools can reside on the same toolbar!  Buttons can also be generated through Customize Mode

Add-in Manager, Extensions, and Toolbars

Creating Python Add-ins  Python Add-in Wizard  Downloadable from Esri  Extract files  Use addin_assistant.exe located in bin folder  All related files needed to create add-ins are included  Creates project folder with three main components:  config.xml  Install folder (contains Python script with business logic)  Images folder  Next, use makeaddin.py to create archive  The resulting *.esriaddin file can be used to install the add-in

Creating Python Add-ins (Cont’d)  Can add additional folders and files  Benefits of.esriaddin method .esriaddin file is really just a compressed file  Well-known folders

Config.xml  Describes the add-in and its customizations  Created by Add-in Wizard  Shouldn’t need to be edited

Images Folder  Contains all graphics associated with the add-in  Images that show up for tools, Add-In Manager, etc.  Graphics copied into this folder automatically by Add-In Wizard

 Holds the Python script for the add-in  The script defines the behavior of the customizations described in config.xml  Classes created by Add-In Wizard  All pertinent functions for each class also created  Only need to keep those you will use  Additional folders and files can also be placed in this folder  e.g. toolboxes, tools, data  These will be compressed and included when the add-in is created Install Folder

Pythonaddins Module  Separate Python module  Like arcpy  Includes functions for supporting Python add-ins  Can only be used within a Python add-in, not in scripts or script tools  Functions like OpenDialog(), MessageBox(), GetSelectedTOCLayerorDataFrame(), ProgressDialog()

Final Steps  Edit the Python script as needed  Don’t rename classes as class names are created by / referenced in config.xml  Update functions  Delete all functions not implemented  For clarity  To ensure they’re never called by the application  Re-save the script  Create add-in by running makeaddin.py  Install the add-in by double-clicking the *.esriaddin file

Testing/Debugging/Editing  Take advantage of your Python IDE  Use Print statements and review Exception Errors  Use Add-In Wizard to made edits to existing add-ins (can also edit config.xml directly)

Sharing Add-ins  One small file makes it easy to share  Place in well-known location to install; remove to uninstall  Add-in can be updated with new version by merely overwriting the old file  Add-ins can be digitally signed for security  Linked to standard ITU X.509 digital certificate  Use ESRISignAddIn.exe utility that comes with Python Add-in Wizard  Administrative setting in Desktop to control security for all add-ins

Sharing Add-ins (Cont’d)  attachment  Placing in shared directory that’s added to list of well-known folder locations  ArcGIS Online

Extending Python Add-ins  Additional functionality, graphics, interfaces  Thousands of 3 rd -party libraries => Python Package Index  Is a GIS category (browse under “Scientific/Engineering”)  Examples:  wxPython  Plotly  ReportLab  R, Pandas, SciPy, GDAL, Numpy, Shapely, Pysal…

wxPython  A GUI toolkit for Python  Is Python extension module that wraps around wxWidgets library (C++)  Can use wxGlade, a GUI designer that creates wxPython code  Eric Pimpler (GeoSpatial Training Services) has created a great Add-in using wxPython

ReportLab  A PDF toolkit for Python  Can be used to create data-driven PDF documents and custom vector graphics  Three layers:  A graphics canvas API that renders PDF pages  A charts and widgets library for creating data graphics  A page layout engine that builds documents from elements

Simple Example: StreetView Add-In

Acknowledgements / Additional Resources  Ian Broad, Thinking Spatially ianbroad.com)  GeoSpatial Training Services  Several Python training courses  Eric Pimpler’s books:  Programming ArcGIS with Python Cookbook  ArcGIS Blueprints  ArcGIS Desktop help docs  Downloadable ArcGIS Desktop Python Add-ins on ArcGIS Online (search for tools and ArcGIS Desktop Content)

Acknowledgements / Additional Resources  Python add-in class properties and functions: desktop.arcgis.com/en/arcmap/latest/analyze/python- addins/button-class.htm, …/combobox-class.htm, …/tool-class.htm, …/extension.class.htm  wxpython.org  blog.pythonlibrary.org/category/wxpython  reportlab.com/opensource  plot.ly  pypi.python.org  packaging.python.org

Summary  Python add-ins are a great way to customize the user interface for any of the ArcGIS Desktop products  Yes, there are limitations…  Regardless, they’re fairly easy to create, edit, distribute and use  Until Desktop is deprecated (?) and Pro takes over, they will continue to be forward-compatible with future versions

Questions? Erik Glenn Senior GIS Analyst Pima County ITD-GIS 33 N Stone Ave, 15 th Floor Tucson, AZ (520) Erik Glenn Senior GIS Analyst Pima County ITD-GIS 33 N Stone Ave, 15 th Floor Tucson, AZ (520)