Python: Working with Feature Data. Ghislain Prince David Wynne

Similar documents
Introducing the ArcPy Data Access module. Dave Wynne Jason Pardy

Python: Beyond the Basics. Michael Rhoades

Using Python with ArcGIS

Working with Feature Layers. Russell Brennan Gary MacDougall

Introduction to Geodatabase and Spatial Management in ArcGIS. Craig Gillgrass Esri

Data Interoperability An Introduction

Python Raster Analysis. Kevin M. Johnston Nawajish Noman

ArcGIS Runtime SDKs Building Offline Apps. Nick Furness

Python Raster Analysis. Kevin M. Johnston Nawajish Noman

Building Geoprocessing Tools with Python: Beyond the Basics. Dave Wynne

Python: Beyond the Basics. Brittney White

Creating Mosaic Datasets and Publishing Image Services using Python

Using Python with ArcGIS

Utility Network Management in ArcGIS: Migrating Your Data to the Utility Network. John Alsup & John Long

Leveraging SAP HANA and ArcGIS. Melissa Jarman Eugene Yang

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

PYTHON: BUILDING GEOPROCESSING TOOLS. David Wynne, Andrew Ortego

Creating Geoprocessing Services and Web Tools. Darren Baird, PE, Esri

What s New for Developers in ArcGIS Maura Daffern October 16

Editing & Maintaining Parcels with ArcMap. Christine Leslie Amy Andis

ArcGIS Pro Editing. Jennifer Cadkin & Phil Sanchez

Python: Beyond the Basics. Brittney White, Esri Jordan Douthitt, Pennsylvania State University

Python: Building Geoprocessing Tools

An Introduction to Data Interoperability

Advanced Parcel Editing. Amy Andis Tim Hodson

Understanding and using Metadata across the ArcGIS Platform. Aleta Vienneau Marten Hogeweg

ArcGIS Enterprise: Sharing Imagery. Zikang Zhou Imagery and Raster team

Python Getting Started

Collector for ArcGIS: What s New. Chris LeSueur & James Tedrick

Using Python in ArcGIS Oli Helm May 2, 2013

Administering Your Oracle Geodatabase. Jim McAbee Mandar Purohit

ArcGIS Pro Editing: An Introduction. Jennifer Cadkin & Phil Sanchez

hereby recognizes that Timotej Verbovsek has successfully completed the web course 3D Analysis of Surfaces and Features Using ArcGIS 10

Administering Your Oracle Geodatabase. Amit Kesarwani Mandar Purohit

Understanding and Working with the OGC Geopackage. Keith Ryden Lance Shipman

Using Python in ArcGIS Steven Beothy May 28, 2013

Enabling High-Quality Printing in Web Applications. Tanu Hoque & Jeff Moulds

Integrating Imagery into ArcGIS Runtime Application. Jie Zhang, Zhiguang Han San Jacinto, 5:30 pm 6:30 pm

Migrating Data to the Parcel Fabric. Christine Leslie Amir Bar-Maor

ArcGIS Data Reviewer: Ensuring Accurate and Complete Data to Meet Your Mission. John Grammer Kevin Pusey

PYTHON: BUILDING GEOPROCESSING TOOLS. David Wynne, Geri Miller

Bringing your Data to Life in the ArcGIS API for JavaScript: Vector Tiles. Craig Williams &

Create a personal geodatabase

ArcGIS Pro: What s New in Editing and Data Management

Best Practices for Designing Effective Map Services

Design a Geodatabase. Rasu Muthurakku, Enterprise Solutions Architect / Consultant

Lidar and GIS: Applications and Examples. Dan Hedges Clayton Crawford

Topology in the Geodatabase: An Introduction

Making the Most of Raster Analysis with Living Atlas Data. Aileen Buckley, PhD, Research Cartographer Esri - Redlands

Enabling High-Quality Printing in Web Applications

Accessing and Administering your Enterprise Geodatabase through SQL and Python

Desktop Mapping: Creating Vector Tiles. Craig Williams

Automating Geodatabase Creation with Geoprocessing

PUG List. Raster Analysis 3D Analysis Geoprocessing. Steve Kopp

Working With Raster Data Using Python. Nawajish Noman Ryan DeBruyn

Getting the most from the Maplex Label Engine

Why use an RDBMS? ❽ Data maintenance ❽ Standardized access ❽ Multi-user access ❽ Data protection

Key Terms. Attribute join Target table Join table Spatial join

Editing Versioned Geodatabases : An Introduction

ArcGIS Online: Three-and-a-Half Ways to Create Tile Layers. Eric Anderson & Adam Eversole Esri Support Services

Understanding and Using Metadata in ArcGIS. Adam Martin Marten Hogeweg Aleta Vienneau

Insight into the Utility Network. Erik Hoel and Tom Brown March 13, 2018

Topology in the Geodatabase an Introduction. Erik Hoel Doug Morgenthaler

Using the Geodatabase

ArcMap Editing Tips and Tricks. Sean Jones

Setup Guide for Op Tracker

Working with Scientific Data in ArcGIS Platform

ArcGIS Pro Terminology Guide

ArcGIS Pro Terminology Guide

Working with Printing Service: Advanced Topics JEFF MOULDS TANU HOQUE

ArcGIS Pro: Image Segmentation, Classification, and Machine Learning. Jeff Liedtke and Han Hu

USING PYTHON WITH ARCGIS ADVANCED LEVEL ONLINE TRAINING GIS. Course. Training. .com

Sharing Web Layers and Services in the ArcGIS Platform. Melanie Summers and Ty Fitzpatrick

Python: Developing Geoprocessing Tools. David Wynne, Jon Bodamer

Editing Parcel Fabrics Tutorial

ArcGIS Enterprise: Portal Administration BILL MAJOR CRAIG CLEVELAND

Streamlining Editing Workflows. Amber Bethell

Building Basemaps: MapCaches and VectorTiles. Matthias Schenker Gerhard Trichtl

Python - Raster Analysis

Python Raster Analysis

Table of Contents. 1. Prepare Data for Input. CVEN 2012 Intro Geomatics Final Project Help Using ArcGIS

Esri Best Practices: QA/QC For Your Geodata. Michelle Johnson & Chandan Banerjee

Introduction to Your First ArcGIS Enterprise Deployment. Thomas Edghill & Jonathan Quinn

Data Interoperability Advanced Use

Designing and Using Cached Map Services

Enterprise Architect. User Guide Series. Geospatial Models. Author: Sparx Systems Date: 15/07/2016 Version: 1.0 CREATED WITH

Troubleshooting Performance Issues with Enterprise Geodatabases. Ben Lin, Nana Dei, Jim McAbee

TRAINING GUIDE. Data Quality Tools for GIS and Lucity Spatial

Enterprise Architect. User Guide Series. Geospatial Models

ArcGIS Runtime SDK for Qt: Building Apps. Koushik Hajra and Lucas Danzinger

ArcGIS Online: Best Practices for High-Demand Web Applications. Kelly Gerrow-Wilcox Bonnie Stayer Beth Romero

ENVI Py for ArcGIS Documentation

Leveraging metadata standards in ArcGIS to support Interoperability. Aleta Vienneau and Marten Hogeweg

Python: Working with Raster Data

From Data to Map in 30 Minutes. Aileen Buckley, PhD

ArcGIS for the Military: MIL-STD-2525D Joint Military Symbology. Andy Bouffard Jim Weakland

ArcCatalog or the ArcCatalog tab in ArcMap ArcCatalog or the ArcCatalog tab in ArcMap ArcCatalog or the ArcCatalog tab in ArcMap

Data Interoperability An Introduction

Trimble GeoCollector for ArcGIS: An Introduction. Morgan Zhang (Esri), Matthew Morris (Trimble)

Indexed 3D Scene (I3S) Layers Specification

Transcription:

Python: Working with Feature Data Ghislain Prince David Wynne

Python: Working with Feature Data

Cursors Cursors provide record-by-record, feature-by-feature access - Basic necessity for many workflows SearchCursor UpdateCursor InsertCursor Read-only access Update or delete rows Insert rows Two implementations - arcpy.da cursors and Classic cursors - Which one? Unless you have legacy code you don t want to update, use arcpy.da

Cursors arcpy.da cursors use lists and tuples - Row values are accessed by index Classic cursors - Use Row objects - Row values are handled using setvalue, getvalue properties

with statements arcpy.da Cursors support with statements with statements - In Python, with statements provide context management - Locks * - Other benefits: such as allowing edits on multiple tables in the same workspace - Clarity

Fields and tokens For best performance, use only those fields you need - Can use "*" for all fields if necessary Equivalent to using the geometry field name Tokens can be also be used - Get only what you need (accessing full geometry is more expensive)

Working with geometry Creating geometry objects can be a bit unwieldly Many different options for accessing/creating geometry within a cursor Geometry objects Esri JSON List of coordinates

Cursors esriurl.com/10618

More on cursors Row values are accessed by index Good for performance, not as good for code readability Alternatively, can convert to a dictionary on the fly - Wrap with a generator function - Access by name

Editor class Uses edit sessions and edit operations to manage transactions Edits are temporary until saved and permanently applied Can quit an edit session without saving changes When do you need to use? - To edit feature classes that participate in a - Topology - Geometric network - Versioned datasets in enterprise geodatabases - Some objects and feature classes with class extensions

Editor using a with statement Editor supports with statements - Handle appropriate start, stop and abort calls for you Exception operation is aborted, and edit session is closed without saving No exceptions stop the operation and save and close the edit session Open an edit session and start an edit operation

Editor class Editor class also includes methods for working with edit sessions and operations Editor methods startediting ({with_undo}, {multiuser_mode}) stopediting(save_changes) startoperation() stopoperation() abortoperation() undooperation() redooperation() Starts an edit session. Stops an edit session. Starts an edit operation. Stops an edit operation. Aborts an edit operation. Undo an edit operation (roll back modifications). Redoes an edit operation.

Editing with arcpy.da.editor esriurl.com/10618

Iterating over data Many processes require cataloging or iterating over data Common theme are arcpy list functions - 30+ across arcpy and modules arcpy.da list functions: ListDomains ListFieldConflictFilters ListReplicas ListSubtypes ListVersions Lists the attribute domains belonging to a geodatabase Lists the fields in a versioned feature class that have field conflict filters applied Lists the replicas in a workspace Return a dictionary of the subtypes for a table or feature class List the versions in a workspace

Walk Traverse a directory structure to find ArcGIS data types Returns a tuple of three: path, path names, and filenames Similar pattern to Python s os.walk Comparison: - Walk: http://esriurl.com/5931 - The hard way: http://esriurl.com/5932

Iterating over data esriurl.com/10618

NumPy NumPy is a 3rd party Python library for scientific computing - A powerful array object - Sophisticated analysis capabilities arcpy.da supports converting tables and feature classes to/from numpy arrays - FeatureClassToNumPyArray, TableToNumPyArray Can also converting rasters to/from numpy arrays - RasterToNumPyArray, NumPyArrayToRaster - (found in main arcpy namespace)

NumPy functions arcpy.da provides additional support for tables and feature classes Function FeatureClassToNumPyArray TableToNumPyArray NumPyArrayToFeatureClass NumPyArrayToTable ExtendTable Convert a feature class to an array Convert a table to an array Convert an array to a Feature Class Convert an array to a Table Join an array to a Table

Export to NumPy Can convert tables and feature classes into numpy arrays for further analysis

Import from NumPy Take the product of your work in numpy and export it back to ArcGIS - Points only Polygons, lines, multipoints? - http://esriurl.com/5862

pandas pandas is 3 rd party library known for high-performance, easy-to-use data structures and analysis tools Added to ArcMap, Server, Engine at 10.4 Added to ArcGIS Pro 1.1* - pandas was part of the our now obsolete external Python at 1.0

arcpy, numpy and pandas esriurl.com/10618

Please Take Our Survey! No more memorizing Session ID numbers!! Download the Esri Events app and find your event Select the session you attended Scroll down to the Feedback section Complete Answers, add a Comment, and Select Submit