arcgis network analyst: automating workflows with geoprocessing melinda morang patrick stevens

72
ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

Upload: michael-mathews

Post on 12-Jan-2016

236 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with

Geoprocessing

Melinda Morang

Patrick Stevens

Page 2: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Who are we?- Network Analyst Product Engineers

• Who are you?- Current Network Analyst users?- Current geoprocessing users?- Have made geoprocessing models?- Have made geoprocessing Python scripts?

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Page 3: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• ArcGIS Network Analyst extension concepts

• Geoprocessing framework for network analysis

• ModelBuilder: Models and model tools

• Python: Scripts and script tools

• Ready-to-Use services

• Support and resources

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Topics to be covered

Page 4: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Help:What is the ArcGIS Network Analyst extension

ArcGIS Network Analyst extension concepts

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Page 5: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• ArcGIS Network Analyst extension concepts

• Geoprocessing framework for network analysis

• ModelBuilder: Models and model tools

• Python: Scripts and script tools

• Ready-to-Use services

• Support and resources

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Topics to be covered

Page 6: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

Route Closest Facility Origin-DestinationCost Matrix

Point-to-point routing

Vehicle RoutingProblem

Location-AllocationService Area

Coverage Optimization

ArcGIS Network Analyst Extensiondoes transportation analysis

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Page 7: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Network Dataset

Page 8: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Data within your organization

• Free data- Data and maps media (prior to 10.3)

- TIGER (Census data)

- OpenStreetMap- OSM to NDS tools- ArcGIS Editor for OpenStreetMap

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

• Pay for data- HERE or TomTom

- Vendor street data processing tools

- StreetMap Premium for ArcGIS

• Pay for analysis- ArcGIS.com Map Viewer

- ArcGIS.com Network Services

Street Data

Page 9: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Composite layer

• One layer type for each solver

• Analysis properties

• Inputs

• Outputs

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Network Analyst Layer

Page 10: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

Performing an analysis manually

Network Analyst workflow

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Demo

Page 11: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Steps for network analysis:

- Make LayerMake Layer- Add LocationsAdd Locations- SolveSolve- Work with resultsWork with results

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

TakeawaysDemo: Network Analyst Workflow

Page 12: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Help:The geoprocessing framework

What is Geoprocessing?

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Page 13: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• ArcGIS Network Analyst extension concepts

• Geoprocessing framework for network analysis

• ModelBuilder: Models and model tools

• Python: Scripts and script tools

• Ready-to-Use services

• Support and resources

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Topics to be covered

Page 14: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Storage & Management

Visualization

Computation

What is Geoprocessing?

Page 15: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Computation =

Geoprocessing

•Automating workflows

•Modeling & Analysis

What is Geoprocessing?

Page 16: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Performing Network Analysis

• Building networks

• Publishing services

• Managing turns

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Using GeoprocessingHow?

Page 17: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

ModelModel

Python windowPython window

ScriptScript

Tool dialogSingle tool

Chain tools

Using Geoprocessing

Page 18: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Web

Mobile

Desktop

Model tools

Script tools

System tools

Using GeoprocessingWhere?

Page 19: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

1. Make or Edit Network Analysis Layer

2. Add locations to one or more Network Analysis Classes

3. Solve

4. Use the results

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Python

Network Analyst Workflow

Page 20: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

Building Geoprocessing Models

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

ArcGIS Help:What is ModelBuilder?

Page 21: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• ArcGIS Network Analyst extension concepts

• Geoprocessing framework for network analysis

• ModelBuilder: Models and model tools

• Python: Scripts and script tools

• Ready-to-Use services

• Support and resources

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Topics to be covered

Page 22: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Author using Model Builder

• Chain tools to perform a workflow

• Use models like ArcToolbox tools

• Use models within other models

• Apply all Model Builder techniques to network analysis models

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Geoprocessing Models

Page 23: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Example: Service Area Model

Page 24: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

Performing a network analysis in Model Builder

Sharing a model as a tool

Automating workflows with geoprocessing models

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Demo

Page 25: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Automate workflows Automate workflows with Model Builder

• Share Share your model as a tool

• Make inputs and outputs model parametersmodel parameters- Inputs can be selected by the tool’s user

- Outputs will be added to the ArcMap Table of Contents

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

TakeawaysDemo: Automating Workflows with Geoprocessing Models

Page 26: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• When running models as tools…

- The output network analysis layer should be a model parametermodel parameter- This will add the layer to the ArcMap Table of Contents

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Visualizing analysis results in ArcMap

Page 27: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

Working with inputs and outputs

Make a toolbar button

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Demo

Automating workflows with geoprocessing models

Page 28: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Run a model as a buttonbutton on a toolbar

• Use the Select Data Select Data tool to access NA sublayers

• Work with external data external data like CSV files

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

TakeawaysDemo: Automating Workflows with Geoprocessing Models

Page 29: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Use your analysis result as an input to another tool

- The Select Data Select Data tool accesses individual sublayers

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Post-processing your analysis

Page 30: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

Writing Python Scripts

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

ArcGIS Help:What is Python?

Page 31: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• ArcGIS Network Analyst extension concepts

• Geoprocessing framework for network analysis

• ModelBuilder: Models and model tools

• Python: Scripts and script tools

• Ready-to-Use services

• Support and resources

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Topics to be covered

Page 32: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Conditional logic

• Loops

• Cursors, creating geometry

• Built-in and third party modules

• Cross-platform

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Python Scripts

Page 33: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• ArcPy site package

- Network Analyst module

- Other geoprocessing tools

- Other useful functions and classes- Describe

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Python Scripts

Page 34: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Simplify access to Network Analyst functionality from Python

• Edit the analysis properties of network analysis layers- No need to re-create layers

- Speed up execution

- Simplify script logic

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

arcpy.na

Network Analyst Module

Page 35: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Import the arcpy module

Python Script: Basic Building Blocks

Page 36: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Python Script: Basic Building Blocks

Check out theNetwork Analyst

Extension

Page 37: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Make/edit a network analysis

layer

Python Script: Network Analyst Workflow

Page 38: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Add locations to network analysis classes

Python Script: Network Analyst Workflow

Page 39: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Solve the network analysis layer

Python Script: Network Analyst Workflow

Page 40: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Use the results

Python Script: Network Analyst Workflow

Page 41: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

• The network layer is retrieved as a layer object from the result object returned by Make<solver>Layer

Working with analysis layers within scripts

Page 42: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Edit the solver properties of an existing layer object

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Working with analysis layers within scripts

Page 43: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

• The Select Data tool is not meant for python scripting

• arcpy.na.GetNAClassNames GetNAClassNames should be used- Renamed or localized sublayer names will work in the script

Accessing sublayers in scripts

Page 44: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Access individual sublayers using ListLayers on the NA layer.

• Use sublayers as input to other tools (CopyFeatures, Join, Buffer, etc.).

• Use a SearchCursor to access the rows within a sublayer.

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Working with sublayers in python

Page 45: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Easily specify field mappings in Add Locations with arcpy.na.NAClassFieldMappingsNAClassFieldMappings

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Working with analysis layers within scripts

Page 46: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• The in-memory network analysis layer can be persisted using the SaveToLayerFile tool in the management module

• Layer files can be dragged from disk into ArcMap

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Saving analysis results

Page 47: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• ArcGIS Network Analyst extension concepts

• Geoprocessing framework for network analysis

• ModelBuilder: Models and model tools

• Python: Scripts and script tools

• Ready-to-Use services

• Support and resources

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Topics to be covered

Page 48: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

Performing a network analysis with a python script

Automating workflows with python scripts

Demo

Page 49: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Run simple python commands in ArcMap’s python windowpython window

• Export models Export models to python scripts

• Persist the in-memory network analysis layer with SaveToLayerFileSaveToLayerFile

• Run scripts from a command prompt outside of ArcMapoutside of ArcMap

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

TakeawaysDemo: Automating Workflows with Python Scripts

Page 50: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

Building Script Tools

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

ArcGIS Help:What is a script tool?

Page 51: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Work with your scripts through a user interface

• Use Script tools like any other tool within ArcToolbox- Use script tools in models and vice versa

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Script tools

Page 52: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• If a network analysis layer is the output…- Make an additional derived output parameter of type Network Analyst Layer

- Use arcpy.SetParameterAsText(…)

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Add outputs from script tool to ArcMap

Page 53: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

Create a script tool to provide a UI for a Python script

Use tool validation to customize the UI.

Write a script tool to extend the capabilities of ArcGIS.

Creating a script tool

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Demo

Page 54: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Provide a user interface for python scripts by making a script toolscript tool

• Use derived output and arcpy.SetParameterAsText() arcpy.SetParameterAsText() to add results to the map

• Use tool validation tool validation to customize your script tool’s UI

• Use python modules to extendextend the capabilities of ArcGIS

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

TakeawaysDemo: Creating a Script Tool

Page 55: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• ArcGIS Network Analyst extension concepts

• Geoprocessing framework for network analysis

• ModelBuilder: Models and model tools

• Python: Scripts and script tools

• Ready-to-Use services

• Support and resources

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Topics to be covered

Page 56: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Published by Esri

• Managed by Esri

- No user maintenance of servers, services, or data

- Excellent uptime and reliability

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Ready-To-Use Services

Page 57: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Global data

• Live traffic

• No Network Analyst specific software required

• Create Layer, Add Locations, and Solve all in one tool

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Ready-To-Use ServicesBenefits

Page 58: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Anywhere geoprocessing tools can be used- Model builder

- Python scripts

- ArcMap

• Like any other service that uses credits

• Supported from 10.0 SP5 and up

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Ready-To-Use ServicesWhere?

Page 59: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• ArcGIS Online subscription with credits

• Your own analysis inputs

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Ready-To-Use ServicesRequirements

Page 60: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Check credit page

• Varies per type of analysis

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Network Analysis Service Credits Used

Simple Routes 0.04 credits per route

Optimized Routes 0.5 credits per optimized route

Drive Time (Service Areas) 0.5 credits per drive time

Closest Facilities 0.5 credits per closest facility route

Multi-Vehicle Routes( VRP) 1 credits per route

Traffic 0 credits

Ready-To-Use ServicesCost

Page 61: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

Connecting to Ready-To-Use services

Using a Ready-To-Use service in a model

Ready-To-Use services

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Demo

Page 62: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Use Ready-To-Use services Ready-To-Use services like other geoprocessing tools

• Access high-quality street data street data

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

TakeawaysDemo: Ready-To-Use Services

Page 63: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Publishing geoprocessing services

Page 64: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

Summary

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Page 65: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Use the geoprocessing framework for network analyses- Network Analyst Tools

- Models and Model tools

- Script and Script tools

• Automate workflows

• Incorporate network analysis in larger process

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Summary

Page 66: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• ArcGIS Network Analyst extension concepts

• Geoprocessing framework for network analysis

• ModelBuilder: Models and model tools

• Python: Scripts and script tools

• Ready-to-Use services

• Support and resources

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Topics to be covered

Page 67: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

Resources

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Page 68: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Support and resources

Page 69: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

• Python for ArcGIS resource center

• Books- GIS Tutorial for Python Scripting

- Python Scripting for ArcGIS

- Getting to Know ArcGIS ModelBuilder

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Support and resources

Page 70: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

Network Analyst at the Esri User Conference

ArcGIS Network Analyst: Automating Workflows with Geoprocessing

Page 71: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens

Esri UC 2014 | Technical Workshop |

Network Analyst presentations

Tuesday Wednesday Thursday8:30 am

Network Analyst: An Introduction9 am

Routing in Buildings with 3D Networks in ArcGIS Pro

10 am

Network Analyst: Automating Workflows with Geoprocessing

Network Analyst: An IntroductionNetwork Analysis with Python

11 am

Using Navigator for ArcGIS Using GTFS Public Transit Data in ArcGIS

12 pm Network Analyst: Network Analysis with ArcGIS Online

1 pm

Network Analyst: Creating Network Datasets

Network Analyst: Automating Workflows with Geoprocessing2 pm Navigator for ArcGIS: Technical Preview

Network Analyst in ArcGIS Pro

3 pm Performing Network Analysis Network Analyst: Performing Network Analysis

Network Analyst: Creating Network Datasets

4 pm Network Analysis with ArcGIS Online

Demo Theater 10 AppsDemo Theater 10 AppsRoom 16 BRoom 16 B Demo Theater 13 Spatial AnalysisDemo Theater 13 Spatial Analysis Tech Theater 15 Exhibit Hall ATech Theater 15 Exhibit Hall A Tech Theater 17 Exhibit Hall ATech Theater 17 Exhibit Hall ARoom 15 ARoom 15 A

Page 72: ArcGIS Network Analyst: Automating Workflows with Geoprocessing Melinda Morang Patrick Stevens