The power of sharing through automation (and udder stuff)
When was the last time you bought something and it got better with age? Maybe a good red wine or a Heysen Blue cheese? They both sound pretty good. Well, with cloud software and upgradable smart devices, it’s more than tannins or lactic acid that change – new functionality and apps comes out at a rapid pace.
I was all prepared for my technical presentation with Ivan Ermoshkin on Sharing your analysis: practical steps for automating your workflows when the latest Beta for Web Appbuilder for ArcGIS was released with the September ArcGIS online upgrade. This was great news for users looking for a “no code” way to configure and host responsive web applications, but a bit of a time crunch for me to reconfigure the geoprocessing widgets just days before Ozri. It really needed to be done, however, because I wanted to demonstrate the geoprocessing widgets in the presentation.
Modelbuilder is often an afterthought to most GIS analysts, however, it can be a powerful tool when it comes to building and replicating complex workflows, as well as automating those boring, tedious tasks.
Iterators are unique to models, and allow you to loop through a process on unique values, tables, layers in your map document, or even workspaces.
Let’s have a look at iterators, and how you can use them.
The ModelBuilder tool has been available in ArcGIS for Desktop since 2004 and it quickly gained a reputation of an easy-to-use application. It which can help the user to execute an entire geoprocessing workflow by adding and connecting tools and input/output datasets together in a graphical environment. Models created in the ModelBuilder are executable workflows that string together sequences of geoprocessing tools, feeding the output of one tool into another tool as input.
Such a workflow can be executed as a tool (if you right-click on it in the catalog window in ArcMap), or it can be exported to a python script and be incorporated into a larger script later on. And of course, you can trigger the execution of the model from within the ModelBuilder Window.
A model can have parameters – the elements that a user marks as “parameters” – so that they appear in the tools dialog if a model is executed as a geoprocessing tool using the tool’s dialog. You can find some information to get started with the ModelBuilder here: >>
Today I will show you one of the ways to turn your geoprocessing models into interactive geoprocessing tools by using the Feature Sets.
When to create a Python Add-in
Before you decide to make an add-in, be sure it is the right development path for your project requirements.
If you want to add a collection of existing tools on a toolbar, or change the layout of menus or toolbars in an ArcGIS for Desktop application, you can configure the user interface (UI) to match your preferences. This does not require any programming or scripting..
If you need to run a set of geoprocessing tools to perform data analysis or data management, or produce a series of maps, consider creating a model with ModelBuilder or writing a Python script
If it is required to make a customization that performs an action in response to an event, or requires the use of the mouse to interact with the display, you should consider making an Add-in. An example is a tool that requires the user to click and drag a rectangle over a map to define an area of interest. Another example is an application extension that saves the map document automatically anytime a layer is added or removed from the table of contents. Continue reading
You don’t have to be a programmer to write Python scripts. You can start by learning the basic Python syntax and its built-in types. Once you know the basics, you can write Python scripts to automate geoprocessing, map production, and data management tasks in ArcGIS.
I think ModelBuilder actually provides the easiest start. Note that once you’ve constructed your Graphic UI model in ModelBuilder, when you save it, it gets compiled into Python script which allows you to go through and get more familiar with the syntax and logic construction.
Something similar can be done from the Results window, where you have the option to copy geoprocessing tool results as Python snippet code. Being able to access a detailed record of your geoprocessing operations, with tool inputs pre-populated, is a powerful timesaver when you need to repeat the same workflows. Continue reading
Esri have been phasing out VBA in favour of Python since ArcGIS 10.0.
Reason for transition – Microsoft has stopped supporting VBA. Since the release of ArcGIS 10, VBA was no longer recommended for use as it was not going to be included in subsequent versions, including 10.1. However it was still available in order to support legacy code and applications. A migration to Python, an open source programming language, was thus necessary.
Python is free, cross platform, open source, stable, mature, simple, and powerful. Benchmarking has shown that Python processes scripts in about a third of the time that VBA does.