Performing Network Cost Analysis by yzs75197

VIEWS: 97 PAGES: 33

More Info
									Performing Network Analysis with Geoprocessing



                Deelesh Mandloi
                  Jay Sandhu
Introductions


    • Who are we?
      – Network Analyst Product Engineers


    • Who are you?
      – Current Network Analyst users?

      – Current Geoprocessing users?

      – Familiarity with Geoprocessing framework?

      – Experience with Python?




                                                    UC2009 Technical Workshops   2
Topics

   • ArcGIS Network Analyst Extension

   • Terms used in network analysis

   • Geoprocessing framework for network analysis

   • Building geoprocessing models

   • Building script tools

   • Publishing network analysis services

   • Support and Resources

   • Questions




                                                    UC2009 Technical Workshops   3
What is Network Analyst?

 • Extension for analyzing transportation networks
   – Uses Network Datasets
   – Five network solvers




         Route               Closest Facility    Vehicle Routing
                                                    Problem




   Origin-Destination
                               Service Area
    (OD) Cost Matrix
                                                          UC2009 Technical Workshops   4
Overview

     Desktop GIS            Embedded GIS                      Server GIS                Mobile GIS
      ArcGIS                    ArcGIS               ArcGIS             ArcIMS             ArcGIS
      Desktop                   Engine               Server                                Mobile
                                                                                             ArcPad
            ArcInfo
       ArcEditor
    ArcView
   ArcGIS Extensions
                              NA Extension         NA Extension
     NA Extension             Create custom        Comprehensive     Publish maps,       GIS for field
  ArcMap ArcCatalog            GIS desktop          server-based     data, metadata       mapping
     ArcReader                 applications             GIS           on the Web         applications
                          GP Framework
                      Developer building blocks


                                                                  ArcSDE
                                                         Advanced spatial data server

      Shapefiles

                             File GDB             PGDB            DBMS
StreetMap
                                                               Geodatabase
                                                                                        UC2009 Technical Workshops   5
Terms used in Network Analysis

• Network Dataset

• Network Analysis Layer (NA
  Layer)

• Network Analysis Classes (NA
  Classes or Sub-layers)

• Network Analysis Objects
  (Features or Rows)
   – Network Analysis Locations (NA
     Locations)




• GIS Dictionary
http://support.esri.com/index.cfm?fa=knowledgebase.gisDictionary.browse&letter=N
                                                                      UC2009 Technical Workshops   6
Using Geoprocessing – Why?

 • Extensive framework for analysis in ArcGIS

 • Incorporate network analysis in larger process

 • Automate repetitive tasks

 • Document process

 • High-level programming abstraction

 • Easier than writing ArcObjects code for many tasks

 • Can use out-of-the-box ArcGIS Server clients

 • Can use JavaScript, Flex, Silverlight clients




                                                        UC2009 Technical Workshops   7
Using Geoprocessing – How?


• Accessed through ArcToolbox

• Network Analyst Tools

  – Performing Network Analysis

  – Building networks

  – Managing turns




                                  UC2009 Technical Workshops   8
Using Geoprocessing – How? (continued)
                                             Tool dialog box
                                                  Single
                                                   tool
                                                execution
                                                      Command line




                               Chain tools
                       Model




                                                                     Script



                                                       UC2009 Technical Workshops   9
Using Geoprocessing – Where?



   ArcGIS
   Desktop



   ArcGIS
   Engine



   ArcGIS
   Server




                               UC2009 Technical Workshops   10
Network Analysis Workflow



 1. Make Network
    Analysis Layer

 2. Add locations to one
    or more Network
    Analysis Classes

 3. Solve

 4. Use the results




                            UC2009 Technical Workshops   11
Geoprocessing Models


 • Chain geoprocessing tools to perform a workflow

 • Authored using the Model Builder application

 • Models behave like any other tools within ArcToolbox

     – Can use a model within another model

 • All Model Builder techniques apply when authoring models for
   network analysis

 • See: Automating your work with models
 http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_
   models




                                                                   UC2009 Technical Workshops   12
Example Model to perform Service Area Analysis



 • Numbers refer to steps in Network Analysis workflow




                                                         UC2009 Technical Workshops   13
                            Demo

• Authoring simple route model

• Authoring a model to determine multiple routes from a text file
  containing start and end X,Y coordinates




                                                          UC2009 Technical Workshops   14
Points to Note


 • Use the Select Data tool to access sub-layers of an NA layer

 • NA layer is the derived output from most of the tools (Add
   Locations, Solve)

 • If running models as tools, make the NA layer as Model Parameter
   so that its added to ArcMap TOC

 • The output of the Solve tool is the same input NA layer containing
   results in memory

 • If NA layer is intermediate data, delete it as a last step




                                                                UC2009 Technical Workshops   15
Geoprocessing Scripts

• Used for
   – Conditional logic
   – Looping
   – Cursors, creating geometry
   – Accessing built-in and third party python modules

• Access any GP tool (including network analyst tools)

• Python scripts can be run cross platform

• See: Geoprocessor programming model
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Geoprocessor_prog
  ramming_model


• See: Automating your work with scripts
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_wr
  iting_geoprocessing_scripts


                                                                   UC2009 Technical Workshops   16
Script Tools

 • Add standalone geoprocessing scripts to ArcToolbox as script
   tools

 • Script tools behave like any other tool within ArcToolbox

     – Can use script tools in models and vice versa

 • Convenient method for providing a UI for scripts within ArcGIS
   desktop

 • See: Creating Script Tools

 http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_c
   reating_script_tools




                                                                   UC2009 Technical Workshops   17
                             Demo

• Authoring a simple script that finds the best sequenced route for
  given stops

• Creating a script tool to provide a UI




                                                          UC2009 Technical Workshops   18
                                                                                       18
Points to Note


 • If NA Layer is the output, make it a derived output parameter and
   use SetParameterAsText().

 • The NA layer can be referenced within the script using its name

 • The in-memory NA Layer can be persisted using SaveToLayerFile
   geoprocessing tool.




                                                           UC2009 Technical Workshops   19
     Demo : School Allocation Script Tool
• Scripts can take advantage of all the capabilities provided by the
  python language

• Call third party applications that support python interface to have a
  “tightly coupled” approach

  – For example, calling linear programming (LP) solvers using PuLP
     • PuLP is a public domain Python module for modeling LP
       problems
     • PuLP can work with a variety of LP solvers such as COIN-OR,
       GLPK, XPRESS, CPLEX.

• Solve an allocation problem assigning students to schools with
  capacity constraints

http://resources.esri.com/geoprocessing/index.cfm?fa=codeGalleryDetails&scriptID=
16044

                                                                        UC2009 Technical Workshops 20
Points to Note



 • Custom validation logic can be programmed for the script tool UI
   by programming the Tool Validator class
 • Use Describe() to determine the properties of the Network Dataset
   and the Network Analysis layer
  http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Network_Dataset_properties
  http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Network_Analysis_Layer_pro
  perties

 • The output NA layer supports pre-defined symbology using layer
   files




                                                                           UC2009 Technical Workshops   21
Network Analysis on ArcGIS Server


• Network Analysis Service
   – Coarse-grained, stateless network analysis objects
   – No out-of-the-box clients

• Geoprocessing Service
   – Configured using models and scripts tools
   – Full use of the geoprocessing framework
   – Out-of-the-box clients
     • ArcGIS Explorer
     • ArcGIS Desktop
     • Web ADF
   – JavaScript, Flex, Silverlight clients




                                                          UC2009 Technical Workshops   22
Geoprocessing Service

•   Created by publishing models and scripts on ArcGIS Server
•   Geoprocessing tasks accessible by web-enabled clients
•   Author, Publish, and Serve workflow
•   Accessed using
     – Out-of-the box clients
       • ArcGIS Explorer
       • Web Mapping Applications
       • ArcGIS Desktop
     – JavaScript, Flex, Silverlight clients
• See: Geoprocessing with ArcGIS Server
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_ge
  oprocessing_with_ArcGIS_Server




                                                                   UC2009 Technical Workshops   23
Publishing Geoprocessing Services




                                    UC2009 Technical Workshops   24
Network Analysis Geoprocessing Services

 •   Publish services using tool layers in map document and not as
     toolbox

      ― Can use other layers in the TOC as model variables

      ― Services run faster since the network dataset can be
        already open

      ― Can publish only some models as opposed to all models
        with in a toolbox

 •   Choose to have a result map service if you need advanced
     symbology (such as labels)




                                                          UC2009 Technical Workshops   25
                            Demo

• Publishing a service that finds service areas




                                                  UC2009 Technical Workshops   26
Points to Note


• Use “in_memory” to write outputs to the in-memory workspace
  – Improves performance

• NALayer is not valid output parameter data type for ArcGIS server
  – Must use Select Data and/or Copy Features after solve

• Keep a reference to the Network Dataset in the map
  – Increases performance since doesn’t load from disk every time

• For dynamic symbology, don’t use result map service
  – Uncheck <all other values> for the symbol value




                                                              UC2009 Technical Workshops   27
Network Analysis Tips

• Use appropriate field mappings before using Add Locations tool




• Use Calculate Locations tool to pre-compute network locations for
  faster loading




                                                         UC2009 Technical Workshops   28
Summary

• Geoprocessing framework for network analyses
  – Network Analyst Tools (system tools)
  – Models (no programming)
  – Script and Script tools ( python code)
  – Geoprocessing Services

• Automate repetitive tasks

• Easier than writing ArcObjects code

• Incorporate network analysis in larger process

• Can use out-of-the-box ArcGIS Server clients




                                                   UC2009 Technical Workshops   29
Support and Resources

• ArcGIS Desktop Help on Geoprocessing
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=What_is_geoproces
  sing?


• Network Analyst Help
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_Ne
  twork_Analyst

• Geoprocessing Resource Center
http://resources.esri.com/geoprocessing


• ArcGIS Network Analyst discussion forum
http://forums.esri.com/forums.asp?c=93&s=1944#1944




                                                                   UC2009 Technical Workshops   30
Related Sessions – Network Analyst


 • Network Analyst – Performing Network Analysis with
   Geoprocessing
    – Thursday 10:15 AM – Room 9

 • Network Analyst – An Introduction
    – Thursday 8:30 AM – Room 9

 • Network Analyst – Data Preparation
    – Wednesday 10:15 AM – Room 9
    – Thursday 1:30 PM – Room 9




                                                        UC2009 Technical Workshops   31
Related Sessions – Geoprocessing

 • Model Builder – An Introduction
   – Wednesday 1:30 PM – Room 5 A/B

 • Model Builder – Advanced Techniques
   – Wednesday 3:15 PM – Room 5 A/B

 • Python Scripting – An Introduction
   – Wednesday 3:15 PM – Room 1 A/B

 • Python Scripting – Advanced Techniques
   – Thursday 10:15 AM – Room 5 A/B

 • Building Geoprocessing Tools with Python
   – Wednesday 10:15 AM – Room 14 B
   – Thursday 3:15 PM – Room 4

 • Geoprocessing with ArcGIS Server
   – Thursday 8:30 AM – Room 14 B



                                              UC2009 Technical Workshops   32
In Conclusion…



   • Please fill out session surveys!

   • Questions

   • Still have questions?
     –Spatial Analysis Island (Exhibit Hall C)




                                                 UC2009 Technical Workshops   33

								
To top