750 likes | 788 Views
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?.
E N D
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
Topics to be covered • 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
ArcGIS Network Analyst extension concepts ArcGIS Help: What is the ArcGIS Network Analyst extension ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Topics to be covered • ArcGIS Network Analyst extension concepts • Geoprocessingframework 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
ArcGIS Network Analyst Extension does transportation analysis Point-to-point routing Optimization Coverage Service Area Route Location-Allocation Vehicle Routing Problem Closest Facility Origin-Destination Cost Matrix ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Network Dataset ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Street Data • 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 • 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 ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Network Analyst Layer • Composite layer • One layer type for each solver • Analysis properties • Inputs • Outputs ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Demo Network Analyst workflow Performing an analysis manually ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Takeaways Demo: Network Analyst Workflow • Steps for network analysis: • Make Layer • Add Locations • Solve • Work with results ArcGIS Network Analyst: Automating Workflows with Geoprocessing
What is Geoprocessing? ArcGIS Help: The geoprocessing framework ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Topics to be covered • 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
What is Geoprocessing? Computation Visualization Storage & Management ArcGIS Network Analyst: Automating Workflows with Geoprocessing
What is Geoprocessing? Computation Geoprocessing • Automating workflows • Modeling & Analysis = ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Using Geoprocessing How? • Performing Network Analysis • Building networks • Publishing services • Managing turns ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Using Geoprocessing Tool dialog Single tool Python window Chain tools Model Script ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Using Geoprocessing Where? Web Model tools Mobile Script tools Desktop System tools ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Network Analyst Workflow • Make or Edit Network Analysis Layer • Add locations to one or more Network Analysis Classes • Solve • Use the results 2 Python 1 3 4 ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Building Geoprocessing Models ArcGIS Help: What is ModelBuilder? ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Topics to be covered • 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
Geoprocessing Models • Author using Model Builder • Chain tools to perform a workflow • Use models like ArcToolboxtools • Use models within other models • Apply all Model Builder techniques to network analysis models ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Example: Service Area Model ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Demo Automating workflows with geoprocessing models Performing a network analysis in Model Builder Sharing a model as a tool ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Takeaways Demo: Automating Workflows with Geoprocessing Models • Automate workflows with Model Builder • Share your model as a tool • Make inputs and outputs model 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
Visualizing analysis results in ArcMap • When running models as tools… • The output network analysis layer should be a model parameter • This will add the layer to the ArcMap Table of Contents ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Demo Automating workflows with geoprocessing models Working with inputs and outputs Make a toolbar button ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Takeaways Demo: Automating Workflows with Geoprocessing Models • Run a model as a button on a toolbar • Use the Select Data tool to access NA sublayers • Work with external data like CSV files ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Post-processing your analysis • Use your analysis result as an input to another tool • The Select Data tool accesses individual sublayers ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Writing Python Scripts ArcGIS Help: What is Python? ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Topics to be covered • 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
Python Scripts • Conditional logic • Loops • Cursors, creating geometry • Built-in and third party modules • Cross-platform ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Python Scripts • ArcPy site package • Network Analyst module • Other geoprocessing tools • Other useful functions and classes • Describe ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Network Analyst Module arcpy.na • 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
Python Script: Basic Building Blocks Import the arcpymodule ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Python Script: Basic Building Blocks Check out the Network Analyst Extension ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Python Script: Network Analyst Workflow Make/edit a network analysis layer ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Python Script: Network Analyst Workflow Add locations to network analysis classes ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Python Script: Network Analyst Workflow Solve the network analysis layer ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Python Script: Network Analyst Workflow Use the results ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Working with analysis layers within scripts • The network layer is retrieved as a layer object from the result object returned by Make<solver>Layer ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Working with analysis layers within scripts • Edit the solver properties of an existing layer object ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Accessing sublayers in scripts • The Select Data tool is not meant for python scripting • arcpy.na.GetNAClassNamesshould be used • Renamed or localized sublayer names will work in the script ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Working with sublayers in python • 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 analysis layers within scripts • Easily specify field mappings in Add Locations with arcpy.na.NAClassFieldMappings ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Saving analysis results • 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
Topics to be covered • 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
Demo Automating workflows with python scripts Performing a network analysis with a python script ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Takeaways Demo: Automating Workflows with Python Scripts • Run simple python commands in ArcMap’spython window • Export models to python scripts • Persist the in-memory network analysis layer with SaveToLayerFile • Run scripts from a command prompt outside of ArcMap ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Building Script Tools ArcGIS Help: What is a script tool? ArcGIS Network Analyst: Automating Workflows with Geoprocessing