[GIS] Getting All Paired Shortest Paths in ArcGIS network analysis at once

arcgis-servernetwork-analystshortest path

I have some difficulties on network analysis,I want to run shortest path algorithm,
I don't know how to use ArcGIS to reveal the shortest route between the appointed points on the map, and if it's possible, can I also use this software to record and calculate the number of the real road be taken as shortest route?

I have about 200 point to be the origins and destinations on the map, and I need the shortest route between these appointed points (200*200) and let them revealed on the map
And then,record and calculate the number of the real road be taken as shortest route.

but i can only have one shortest route between two points once a time if i use the toolbar, i am wondering how can i make all the shortest routes between 200 points one time? do i have to use any progamming method?

Best Answer

There are two choose for you on NAServer. The NAServer is a MapServer object extension that can be used to perform network analysis in a stateless environment using ArcGIS Server.

For publishing a network analysis service you can check out this tutorial...

1.Closest Facility Analysis: displays the best routes between incidents and facilities.

Closest Facility Analysis

2.OD Cost Matrix: (origin–destination (OD) cost matrix) a table that contains the network impedance from each origin to each destination.

od1

od2

and showing them in a map as openlayers, you can use ArcGIS Server Service.

1.Go to Home > Network(NAServer) > Route
2.Select Solve Route
3.Define your points and barriers
4.Get format as JSON
5.Read json features and add them to vector layer.

example NAServer is here. beside this you have to define stops as following structure:

{ 
"features"  : [
{
  "geometry" : {"x" : -122.4079, "y" : 37.78356},
  "attributes" : {"Name" : "From", "RouteName" : "Route A"}
},
{
  "geometry" : {"x" : -122.404, "y" : 37.782},
  "attributes" : {"Name" : "To", "RouteName" : "Route A"}
}
]
}

you can check out this example:

you should know this the link is so long:

_http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Route/solve?stops={+%0D%0A%22features%22++%3A+[%0D%0A{%0D%0A++%22geometry%22+%3A+{%22x%22+%3A+-122.4079%2C+%22y%22+%3A+37.78356}%2C%0D%0A++%22attributes%22+%3A+{%22Name%22+%3A+%22From%22%2C+%22RouteName%22+%3A+%22Route+A%22}%0D%0A}%2C%0D%0A{%0D%0A++%22geometry%22+%3A+{%22x%22+%3A+-122.404%2C+%22y%22+%3A+37.782}%2C%0D%0A++%22attributes%22+%3A+{%22Name%22+%3A+%22To%22%2C+%22RouteName%22+%3A+%22Route+A%22}%0D%0A}%0D%0A]%0D%0A}%0D%0A&barriers=&polylineBarriers=&polygonBarriers=&outSR=4326&ignoreInvalidLocations=true&accumulateAttributeNames=&impedanceAttributeName=Time&restrictionAttributeNames=OneWay%2CTurnRestriction%2CAvoid+passenger+ferries%2CNon-routeable+segments&attributeParameterValues=&restrictUTurns=esriNFSBAllowBacktrack&useHierarchy=true&returnDirections=true&returnRoutes=true&returnStops=false&returnBarriers=false&returnPolylineBarriers=false&returnPolygonBarriers=false&directionsLanguage=en-US&directionsStyleName=NA+Desktop&outputLines=esriNAOutputLineTrueShape&findBestSequence=false&preserveFirstStop=true&preserveLastStop=true&useTimeWindows=true&startTime=1227663551096&outputGeometryPrecision=&outputGeometryPrecisionUnits=esriUnknownUnits&directionsTimeAttributeName=Time&directionsLengthUnits=esriNAUMiles&f=html