Programming for Geographical Information Analysis: Advanced Skills

Slides:



Advertisements
Similar presentations
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Advertisements

Stored procedures and views You can see definitions for stored procedures and views in the demo databases but you can’t change them. For views, expand.
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
1 Microsoft Access 2002 Tutorial 9 – Automating Tasks With Macros.
Environmental GIS Nicholas A. Procopio, Ph.D, GISP Some slides from Lyna Wiggins (Rutgers University)
Why python? Automate processes Batch programming Faster Open source Easy recognition of errors Good for data management What is python? Scripting programming.
Creating a Program In today’s lesson we will look at: what programming is different types of programs how we create a program installing an IDE to get.
Integrating Access with the Web and with Other Programs.
Automating Tasks With Macros
Getting Started with ArcView GIS Introduction to the Laboratory Exercises.
Using Visual Basic 6.0 to Create Web-Based Database Applications
Intro to ArcMap Customization with Visual Basic  Create your own toolbars, buttons, interactive tools, and programs  Runs behind the scenes in ArcMap.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
ModelBuilder In ArcGIS 9.x By Tim Weigel GEOG 407/607 April 3 rd, 2006.
Spatial Analysis, Geoprocessing,
Geography 465 Overview Geoprocessing in ArcGIS. MODELING Geoprocessing as modeling.
What Geoprocessing? Geoprocessing is the processing of geographic information. Commonly used to describe a process when geographic objects are manipulated.
ModelBuilder at ArcGIS 9.2 Lyna Wiggins Rutgers University May 2008.
The Basic Tools Presented by: Robert E., & Jonathan Chase.
Introduction to ArcView
GISC 6382 Applied GIS UT-Dallas Briggs 1 Customizing ArcGIS Spring 2008.
Introduction to ArcGIS Add-Ins Exercises GIS/LIS Conference, 2014 Rochester, MN.
Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions.
Arc: Programming Options Dr Andy Evans. Programming ArcGIS ArcGIS: Most popular commercial GIS. Out of the box functionality good, but occasionally: You.
Introduction to VB.NET Tonga Institute of Higher Education.
Introduction to InVEST ArcGIS Tool Nasser Olwero GMP, Bangkok April
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
Presented by: Katie Milanowski. 2  Formed in 1982  Bruce Barrington (HBO & Company)  Apply RAD technology to IBM PC  1986: Clarion Version 1.0, Atlanta,
Introduction to Spatial Analysis and Spatial Modeling
A New Generation GIS for the Classroom ArcGIS 9.0 A New Generation GIS for the Classroom.
Using Visual Basic 6.0 to Create Web-Based Database Applications
IE 411/511: Visual Programming for Industrial Applications
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.
9. Introduction to ArcObjects Most GIS analysis carried out within a GIS consists of a labor- intensive sequence of steps. Automating a GIS makes it possible.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Programming for Geographical Information Analysis: Advanced Skills Lecture 1: Introduction Programming Arc Dr Andy Evans.
ATN GIS Support ArcGIS: ArcToolbox.
Introduction of Geoprocessing Topic 7a 4/10/2007.
ArcGIS: ArcToolbox. Goals Develop familiarity with ArcToolbox Integrated use of the different ArcGIS components in the context of a typical GIS project.
Just as there are many human languages, there are many computer programming languages that can be used to develop software. Some are named after people,
Introduction to ArcGIS for Environmental Scientists Module 3 – GIS Analysis Model Builder.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
Introduction of Geoprocessing Lecture 9. Geoprocessing  Geoprocessing is any GIS operation used to manipulate data. A typical geoprocessing operation.
Introduction of Geoprocessing Lecture 9 3/24/2008.
Programming for Geographical Information Analysis: Advanced Skills Lecture 1: Introduction Programming Arc Dr Andy Evans.
Software Development Languages and Environments. Computer Languages Just as there are many human languages, there are many computer programming languages.
Introduction to InVEST ArcGIS Tool
Learning to Program D is for Digital.
How to automatise the grid production - using model builder in ArcGIS
Environmental GIS Nicholas A. Procopio, Ph.D, GISP
Course Name: QTP Trainer: Laxmi Duration: 25 Hrs Session: Daily 1 Hr.
String several geoprocessing processes
Programming and Automation
Writing Geoprocessing Scripts With ArcGIS
Programming for Geographical Information Analysis: Advanced Skills
ModelBuilder for Beginners
Writing Geoprocessing Scripts With ArcGIS
Exploring Microsoft® Access® 2016 Series Editor Mary Anne Poatsy
Microsoft Office Access 2003
Addins Dr Andy Evans Welcome to the course. You’ll find extra information in these note sections below each slide.
Microsoft Office Access 2003
Addins Dr Andy Evans Welcome to the course. You’ll find extra information in these note sections below each slide.
Arcpy Dr Andy Evans Welcome to the course. You’ll find extra information in these note sections below each slide.
An Introduction to JavaScript
PYTHON: BUILDING GEOPROCESSING TOOLS
Building Map Books in ArcGIS
Network Analyst – Automating Workflows with Geoprocessing
Programming Arc.
Tutorial 10 Automating Tasks with Macros
Presentation transcript:

Programming for Geographical Information Analysis: Advanced Skills Dr Andy Evans Welcome to the course. You’ll find extra information in these note sections below each slide.

What’s the big idea? Move from Programmers to Analysts. Learn the major branches of data storage, manipulation, and processing. Introduction to scientific modelling. Build you into Gods of the technosphere, able to see green code streaming across the landscape and shoot fiery lasers of code from your eyes.

Syllabus and Assessment Probably… Arcpy SQL Numpy/Pandas/GeoPandas Natural Language Processing Machine Learning ABM+ Parallel programming Data Analysis Modelling

Syllabus and Assessment Online portfolio of practicals: 30% Independent project: 70%

Programming Arc

Programming ArcGIS ArcGIS: Most popular commercial GIS. Out of the box functionality good, but occasionally: You need to repeat tasks many times You need a new tool You need to make a series of tools work together You need to simplify a series of tasks for users In which case, you need to program ArcGIS directly.

ArcObjects Framework ArcGIS is made from chunks of code: The ArcObjects Framework You have programmatic access to these chunks within ArcGIS, and outside ArcGIS provided Arc is installed on the machine. If you pay, you can also use ArcEngine, which is these chunks, but made available for use in other applications.

Programming options Programming options include: Model builder Python window Python Scripting Python/VB.Net/Java/C++ Addins Java/C++ Extensions Other, less used/dying options include: Arc Macro Language VBA http://desktop.arcgis.com/en/arcmap/latest/extensions/tracking-analyst/124-applying-a-custom-vb-action-to-a-real-time-layer.htm http://desktop.arcgis.com/en/system-requirements/latest/arcobjects-sdk-system-requirements.htm

Python Window Was limited to the Geoprocessing Framework within ArcObjects. Processes (ArcObject Tools) that implement IGPProcess interface. Now wider, but still not full ArcObjects Framework. The python window can run very simple lists of commands, essentially replacing the command line of ArcWorkstation, the old command-line driven version of Arc.

ArcToolbox You can run the same kinds of tools with GUIs from ArcToolbox. Stores Tools, but also Models and Scripts. A Model is a set of tools joined together. A Script is a text file containing instructions, including instructions to run tools as you might have in the python window. You can run the same sort of tools from their own wizards from within ArcToolbox. What we really need, however, is to run tools together, and multiple times. As it happens, there is a system for doing that – it’s called “ModelBuilder”.

Scripts and Models Need to be added to a new toolbox.

ModelBuilder Fourth generation programming language: Drag in visual representations hiding advanced code inside. Drag tools in from ArcToolbox

ModelBuilder Link together by clicking on the two model elements with the connection tool. Choose the variable to connect on.

ModelBuilder Start model with an input file. Make inputs and outputs parameters (get a “p” next to them). Users asked for these.

Modelbuilder Validate – inputs and outputs ok Run – click on model Variables defined as parameters appear in model wizard.

Scripts Python text files import arcpy # --------------------------------------------------------------------------- # buildScript.py # Created on: 2012-01-13 17:38:48.00000 # (generated by ArcGIS/ModelBuilder) # Usage: buildScript <Output_Coverage__3_> # Description: # Set the necessary product code # import arcinfo # Import arcpy module import arcpy # Script arguments Output_Coverage__3_ = arcpy.GetParameterAsText(0) # Local variables: Input_File = "" Output_Coverage = "" Output_Coverage__2_ = "" # Process: Generate arcpy.Generate_arc(Input_File, Output_Coverage, "LINES") # Process: Clean arcpy.Clean_arc(Output_Coverage, Output_Coverage__2_, "", "", "POLY") # Process: Build arcpy.Build_arc(Output_Coverage__2_, "", "") Python text files import arcpy Output_Coverage__3_ = arcpy.GetParameterAsText(0) Input_File = "" Output_Coverage = "" Output_Coverage__2_ = "" arcpy.Generate_arc(Input_File, Output_Coverage, "LINES") arcpy.Clean_arc(Output_Coverage, Output_Coverage__2_, "", "", "POLY") arcpy.Build_arc(Output_Coverage__2_, "", "")

Scripts Not a lot of info on them. Best option is to export a model to see how it works. Best bet for documentation is to search Help for “geoprocessing scripts”.

Adding Scripts Need to set up parameters to pass into functions. These listed when you make a script, or under its properties. Then in script use: arcpy.GetParameterAsText(0)

AML: The Arc Macro Language A simple programming language in a text file. Interpreted not compiled. Runs in the order that commands, directives, etc. appear in the program. A way to automate tedious tasks in ArcGIS. A way to write (“old skool”) interfaces. Not really needed now, but lots of legacy code around. AML was the traditional language of ArcWorkstation, but it still runs as a scripting language in ArcDesktop. For more on ArcWorkstation and AML, see the extra notes in the Using GIS course. http://desktop.arcgis.com/en/arcmap/latest/analyze/creating-tools/using-amls-with-script-tools.htm

The older programming languages AML was much better supported in ArcGIS 9.2+ than in 8.x: there are no restrictions on the kinds of scripts you can run (previously it was just ones that ran in Arc, not ArcPlot etc.) However, AML is an essentially dead language. See Using AML with script tools in Help to see how to integrate running an AML file. The old ArcView 3.x has its own language: “Avenue”. This doesn’t run in ArcGIS 8.x.+ AML is the latin of the GIS world, while Avenue is completely dead. http://desktop.arcgis.com/en/arcmap/latest/analyze/creating-tools/using-amls-with-script-tools.htm

Saving tools Toolboxes can be saved independently. Or you can save your map and use it as a template. Just save it to: <install drive>:\Program Files\ArcGIS\Desktop10.4\MapTemplates Or, if you alone want to use it: %APPDATA%\ESRI\Desktop10.4\ArcMap\Templates

Python Direct access to ArcObjects Framework inside and outside Arc. Ability to add components to the GUI. Ability to communicate with external applications. Advantages: much greater control and depth; nice addin model. Disadvantages: not always obvious how to get a job done; doesn't have complete access to ArcObjects in the way Java or C++ do. These methods are all very well and good, but they are limited in the tools they can access and the external code they can access. Therefore we’ll be looking at how to integrate a higher level language into Arc. With Python we gain all the above advantages.

Next set of lectures Week 16: Tues / Thurs: Arc programming