Creating Python Scripts for ArcGIS STUDENT EDITION

Similar documents
Sharing GIS Content Using ArcGIS STUDENT EDITION

Implementing Versioned Workflows in a Multiuser Geodatabase STUDENT EDITION

How to Set Workspace Environments for Project Work

Editing Data with ArcGIS for Desktop. Student Edition

ArcGIS 4: Sharing Content on the Web STUDENT EDITION

Migrating to ArcGIS 10.2 for Server. Student Edition

Building 3D Cities Using Esri CityEngine STUDENT EDITION

Implementing Versioned Workflows in a Multiuser Geodatabase. Student Edition

Using ArcGIS for Water Utility Workflows STUDENT EDITION

ArcScan for ArcGIS Tutorial

Using ArcScan for ArcGIS

Setting up a 3D Environment for the City of Portland

Using Custom Business Analyst Data Source Layers in ESRI Business Analyst Server

Using ArcGIS. Tracking Analyst. GIS by ESRI

ArcGIS 9. ArcGIS Tracking Analyst Tutorial

ARC HYDRO TOOLS CONFIGURATION DOCUMENT #3 GLOBAL DELINEATION WITH EDNA DATA

ArcGIS 9. Using ArcGIS Tracking Analyst

PYTHON. Scripting for ArcGIS. writeoutput = Inputfc = ar. .ext.{) OUtpUt fc =.. Paul A. Zandbergen. axcpy random. .arcpy, Describe (' is.

What Is the ArcIMS Tracking Server?

Exporting ArcScene to 3D Web Scenes. Documents. An Esri White Paper November 2013

ArcGIS 9. Using ArcReader

Managing Server Resources in ArcGIS

Installing ArcPad ArcPad 6

ArcGIS Schematics: Automatic Schematic Generation for ArcGIS

ArcGIS 9 Installation Guide: ArcSDE Developer Kit

An ESRI Technical Paper May 2007 Techniques for Consuming 3D Textured Objects in ArcGlobe and ArcScene

An Esri White Paper July 2010 Use GIS Data ReViewer to Inspect ArcFM Feeder Manager Circuits

What's New. Features introduced in New Features in Primavera Gateway 17

Introducing ArcScan for ArcGIS

ArcGIS 9 Installation Guide: ArcSDE 64 bit for Microsoft SQL Server

An ESRI White Paper June 2009 ArcGIS Server and Virtualization

ArcGIS 9. ArcGIS Survey Analyst Tutorial

ArcGIS 9. Maplex Tutorial

Copyright 1998, 2009, Oracle and/or its affiliates. All rights reserved.

Geocortex Workflow Tutorial Create the Search Schools Workflow

JANUARY Migrating standalone ArcGIS Server to ArcGIS Enterprise

New Features in Primavera Professional 15.2

Oracle Enterprise Manager Ops Center. Introduction. What You Will Need

Windows Server 2012: Manageability and Automation. Module 1: Multi-Machine Management Experience

ERDAS TITAN Client 9.3 Localization Guide. August 2008

Animation in ArcMap Tutorial

Apple Safari Settings Oracle FLEXCUBE Release [May] [2017]

Linear Referencing in ArcGIS. GIS by ESRI

Oracle Fusion Middleware

Understanding ArcWeb SM. Services for Developers: An Overview to SOAP Implementation. An ESRI Technical Paper April 2003

This section includes information on important Oracle Healthcare Data Model installation and configuration details. 1.1 Obtain and Apply IP Patch

Terms of Use. Changes. General Use.

Oracle Utilities Work and Asset Management

Oracle Alert Documentation Updates

PeopleSoft Fluid Required Fields Standards

1 Siebel Attachments Solution Overview

Database Creation & Setup for SQL Server

How Do I: Find the Highest Elevation within an Area

BRF Crystal_Reporting_9_1

Oracle Agile Engineering Data Management. MCAD Connector for SolidWorks - Version User Manual

Oracle Database Express Edition

Oracle Fusion Middleware Oracle Stream Analytics Release Notes. 12c Release ( )

Oracle Utilities Work and Asset Management

Creating New MACHINEGUID and Disk UUID Using the PGPWdeUpdateMachineUUID.exe Utility

Oracle Adaptive Access Manager. 1 Oracle Adaptive Access Manager Documentation. 2 Resolved Issues. Release Notes Release 10g (

Oracle Fusion Middleware

Student Workbook Mentor Graphics Corporation All rights reserved.

Library Part Creation in the Xpedition Flow. Student Workbook

Oracle Enterprise Manager Ops Center. Introduction. What You Will Need. Installing and Updating Local Software Packages 12c Release

Defining Constants and Variables for Oracle Java CAPS Environments

October 14, Business Intelligence Connector Guide

Owner s Manual. Contents

Overview of the Plug-In. Versions Supported

Nuix ediscovery Specialist

BAA Oracle EBS R12.1 isupplier Portal Created on 11/26/2012 3:18:00 PM

JavaFX. JavaFX System Requirements Release E

Capital. Capital Logic Generative. v Student Workbook

Oracle. Financials Cloud Implementing Subledger Accounting. Release 13 (update 17D)

Module Code Entries Utility Oracle FLEXCUBE Universal Banking Release [December] [2016]

Oracle Hospitality Suite8 Export to Outlook User Manual Release 8.9. July 2015

Oracle Exadata Healthchecks Plug-in Contents

Oracle Responsys Release 18C. New Feature Summary

NetIQ Aegis: Automated Workflow Magic Lab

Customer Service Training Activities Created on 10/10/2011 3:33:00 PM. FSU Service Center. Quick Reference Guide v.

Oracle Utilities Smart Grid Gateway MV-90 Adapter for Itron

Symantec Control Compliance Suite Express Security Content Update for Microsoft Windows Server 2008 R2 (CIS Benchmark 2.1.

Symantec Enterprise Security Manager Baseline Policy Manual for CIS Benchmark. For Red Hat Enterprise Linux 5

TIBCO OpenSpirit ArcGIS Extension Release Notes

PeopleSoft Fluid Messages Standard

Oracle Tuxedo Mainframe Adapter for SNA

Siebel Application Deployment Manager Guide. Version 8.0, Rev. A April 2007

Oracle Communications Performance Intelligence Center

Recipe Calculation Survey. Materials Control. Copyright by: MICROS-FIDELIO GmbH Europadamm 2-6 D Neuss Date: August 21 st 2007.

CA File Master Plus. Release Notes. Version

Oracle Enterprise Manager. Description. Versions Supported. System Monitoring Plug-in Installation Guide for EMC CLARiiON System Release 5 (

User Manual. Materials Control. Production Tool. Copyright by: MICROS-FIDELIO GmbH Europadamm 2-6 D Neuss Date: March 2012.

Oracle Enterprise Manager

Placement & Routing. Lab 8. Placing Parts

Quick Update Guide for ComplianceOne Client

Oracle Enterprise Manager Ops Center. Introduction. Creating Oracle Solaris 11 Zones Guide 12c Release 1 ( )

Oracle Insurance IStream

Oracle Utilities Advanced Spatial and Operational Analytics

Oracle Agile Engineering Data Management

Oracle Fusion Middleware

Symantec Enterprise Security Manager Baseline Policy Manual for CIS Benchmark. AIX 5.3 and 6.1

Transcription:

Creating Python Scripts for ArcGIS STUDENT EDITION

Copyright 2018 Esri All rights reserved. Course version 1.2. Version release date August 2018. Printed in the United States of America. The information contained in this document is the exclusive property of Esri. This work is protected under United States copyright law and other international copyright treaties and conventions. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying and recording, or by any information storage or retrieval system, except as expressly permitted in writing by Esri. All requests should be sent to Attention: Director, Contracts and Legal, Esri, 380 New York Street, Redlands, CA 92373-8100, USA. Export Notice: Use of these Materials is subject to U.S. export control laws and regulations including the U.S. Department of Commerce Export Administration Regulations (EAR). Diversion of these Materials contrary to U.S. law is prohibited. The information contained in this document is subject to change without notice. Commercial Training Course Agreement Terms: The Training Course and any software, documentation, course materials or data delivered with the Training Course is subject to the terms of the Master Agreement for Products and Services, which is available at http://www.esri.com/~/media/files/pdfs/legal/pdfs/ma-full/ma-full.pdf. The license rights in the Master Agreement strictly govern Licensee's use, reproduction, or disclosure of the software, documentation, course materials and data. Training Course students may use the course materials for their personal use and may not copy or redistribute for any purpose. Contractor/Manufacturer is Esri, 380 New York Street, Redlands, CA 92373-8100, USA. Esri Trademarks: Esri trademarks and product names mentioned herein are subject to the terms of use found at the following website: http://www.esri.com/legal/copyright-trademarks.html. Other companies and products or services mentioned herein may be trademarks, service marks or registered marks of their respective mark owners.

Table of Contents Esri resources for your organization Course introduction Course introduction Course goals Installing the course data Icons used in this workbook Understanding the ArcGIS platform 1 Python automation for your organization Benefits of Python automation The Python script creation workflow Integrating Python in ArcGIS Pro Ways to access Python in ArcGIS Pro Determine a method for accessing Python [Optional] Adding Python modules to ArcGIS Pro Answers to Lesson 1 questions 2 Using geoprocessing tools in Python Viewing parameters in a geoprocessing tool Explore the syntax of a geoprocessing tool Ways to use variables in a script Using variables in a script Exercise 2A: Create a simple script with variables Create a new ArcGIS Pro project Add in data for the affected area Evaluate the syntax of the Copy Features tool Evaluate the syntax of the Kernel Density tool Combine the geoprocessing tools in a script Python troubleshooting techniques Troubleshooting errors in a script Exercise 2B: Add troubleshooting techniques to a Python script Add pseudocode Add print statements Comment existing code i

Run the script in PyCharm Answers to Lesson 2 questions 3 Using Describe object properties in geoprocessing tools Accessing properties with a Describe object Identify available Describe function properties Describe syntax and usage Accessing Describe object properties Exercise 3: Use the Describe object in a geoprocessing script Examine the properties of a feature class Use the Describe function to examine properties Create a new Python script in PyCharm Create a Describe object Use Describe properties to create a new feature class Verify the new feature class [Optional] Using the da.describe object in a geoprocessing script Answers to Lesson 3 questions 4 Automating Python scripts with lists List functions in Python Finishing the List function syntax Exercise 4A: Prepare to automate with Python lists Create a list of workspaces Create a list of features Create a list of fields Using a for loop for automation Using a for loop to iterate over lists Exercise 4B: Automate a geoprocessing workflow using loops Create a new Python script in PyCharm Copy feature classes from a workspace Verify the new feature classes ii

Answers to Lesson 4 questions 5 Working with cursors Types of cursors Determine which cursor to use Exploring cursor syntax Using cursors in a workflow Applying the cursor workflow Exercise 5: Read and update values in a feature class Create a new Python script in PyCharm Set up the Python script Create an Update cursor Create a Search cursor Write values to a CSV file Run the script in PyCharm Verify the script results Answers to Lesson 5 questions 6 Geoprocessing with geometry objects Benefits of geometry objects Workflows to create geometry objects Discovering polyline geometry objects Components of a geometry object Discover geometry object methods Exercise 6: Convert coordinates into affected area polygons Open a Python script in PyCharm Evaluate the Python script Create the geometry object from a list Run the script in PyCharm Verify the script output feature classes iii

Answers to Lesson 6 questions 7 Error management techniques Types of errors that occur in geoprocessing Using try-except statements Error handling techniques Introducing error handling in Python scripts Determine the error handling technique Exercise 7: Apply error handling techniques Open the script in PyCharm Run the Python script with empty input Add a custom Raise exception Run a Python script with a Raise exception Run a Python script with invalid input Add an arcpy.executeerror exception Run the Python script with all error handling Answers to Lesson 7 questions 8 Creating a Python script tool Improving script accessiblity Components of a Python script tool Accepting user input Parameter identification Exercise 8: Create a Python script tool Prepare the Python script for user input Create a script tool in ArcGIS Pro Run the Python script tool Answers to Lesson 8 questions 9 Adding validation to script tools Customizing script tool behavior Using validation to create customizations Validating script tool inputs using ToolValidator methods Exercise 9: Add custom messaging to a script tool Update the PyCharm autosave settings iv

Start ArcGIS Pro Open the script tool validation properties Add code to the validator script Verify the validator code Verify the updated tool messaging Answers to Lesson 9 questions 10 Using Python script tools in the platform Methods to share a Python script tool Determine the appropriate method Workflow to share a Python script tool Exercise 10: Share a geoprocessing package Start ArcGIS Pro Analyze the geoprocessing package Modify the metadata Share the geoprocessing package Workflow review Sharing a web tool within the ArcGIS platform Answers to Lesson 10 questions Appendices Appendix A: Esri data license agreement Appendix B: Answers to lesson review questions Appendix C: Additional resources v