Finding Drive Time

2580
3
01-13-2014 07:20 AM
Highlighted
New Contributor III
I have ArcGIS 10.2 with Network Analyst installed and turned on.  What I would like to do is create a drive time around 7 points of 300 minutes (don't ask why ;-(   I would then like to find all store locations that fall within this drive time distance.  Should be simple right. 

I signed up for my ArcGIS online entitlement service so that I could use there network analysis service to do this.  Mainly because I was failing miserably trying to figure out how to create my own and do not have a streets dataset to really get started.

So can someone help me figure out how to do this?  I don't even see a drive-time tool inside the Network Analyst Toolbox.  I also have spatial analyst if that helps at all.  Both of my extensions are pretty greyed out at the moment even though I did the customize/extensions and clicked them on.
Tags (2)
Reply
0 Kudos
3 Replies
Highlighted
New Contributor III
So I found a couple of links that might help but not sure how to use them

I think I can use the code below to create my drivetimes but I have a couple of problems.

1.) I've never used Python before.  Do I just go to geoprocessing/python and then paste this code?
2.) How do I change the facilities part from a geodatabase to a shape file.
3.) Can I run this in ArcGIS?

http://resources.arcgis.com/en/help/main/10.1/index.html#/Connecting_ArcMap_to_ArcGIS_Online_network...

http://resources.arcgis.com/en/help/main/10.1/index.html#/GenerateServiceAreas/0047000001tn000000/

Help please!!!

Code from article:
import arcpy
import time
import sys

username = "<your user name>"
password = "<your password>"
sa_service = "http://logistics.arcgis.com/arcgis/services;World/ServiceAreas;{0};{1}".format(username, password)


#Add the geoprocessing service as a toolbox. Use an alias when importing
arcpy.ImportToolbox(sa_service, "agol")

#Set the variables to call the tool
facilities = r"C:/data/Inputs.gdb/Stores"
output_service_areas = "C:/data/Results.gdb/StoreServiceAreas"

#Call the tool
result = arcpy.agol.GenerateServiceAreas(facilities, "5 10 15", "Minutes")

#Check the status of the result object every 0.5 seconds
#until it has a value of 4(succeeded) or greater
while result.status < 4:
    time.sleep(0.5)

#print any warning or error messages returned from the tool
result_severity = result.maxSeverity
if result_severity == 2:
    print "An error occured when running the tool"
    print result.getMessages(2)
    sys.exit(2)
elif result_severity == 1:
    print "Warnings were returned when running the tool"
    print result.getMessages(1)
   
#Get the output routes  and save to a local geodatabase
result.getOutput(0).save(output_service_areas)
Reply
0 Kudos
Highlighted
Esri Regular Contributor
Hi Michael.  You don't need to use python in order to use the ArcGIS Online Service Area tool.
Start here: http://resources.arcgis.com/en/help/main/10.2/index.html#//0047000001v5000000
The doc will guide you through how to connect to the services and how to run them.
Reply
0 Kudos
Highlighted
Esri Contributor
Hi Michael,

I just wanted to add that you can use your organizational account with the arcgis.com map viewer to solve your problem.

Create Drive-Time Areas
This blog post shows how you can use the Create Drive-Time Areas tool to see the range of electric cars, but it's the same for any kind of driving range:
http://blogs.esri.com/esri/arcgis/2013/12/27/33975/

Notes:

  • 300 miles happens to be the max distance you can solve with the Create Drive-Time Areas tool. Any larger and you'll get an error. We hope to increase this limit in the future, but there are several technical hurdles to do that.

  • Since the range is so large, it will take a long time to finish. Expect to wait up to an hour, especially if you choose the 'Split' option since that takes the longest to calculate. 'Overlap' is the quickest.


Summarize Within
Once you've created your drive-time areas, you can perform the Summarize Within analysis on the layer output by the drive-time tool. (Point to the output layer in the TOC of the map viewer, click the drop-down arrow, choose Perform Analysis, click Summarize Data, and click Summarize Within.)

I hope the tool and the pop-up help is clear enough to get you through the task of counting stores, but if not, just send us any questions.

Note that instead of running two tools, you have the option of running just one: Summarize Nearby, which is right above Summarize Within tool. I recommend the two step process, however, since your 300-mile range is at our max limit.

Your Data
There are many ways to add your data, from dragging and dropping a CSV of lat/longs or addresses into the map, to publishing an ArcMap doc of layers as hosted feature services, to uploading shapefiles. You mentioned shapefiles, so if you want to upload them to your My Content page, so you can then add them to a map and perform an analysis...first, create a zip file on your machine, drag and drop all the shapefile files into the zip file, then upload the zip file from your My Contents page.

I hope that's helpful. Good luck!

Robert
Reply
0 Kudos