I have a dataset of 600,000 records where I need to calculate a drive time that is different for each based on model that estimates the actual/variable drive time needed at that location. Within ArcGIS Pro (2.5) I can create a drive time trade area but it only allows input for 1 specific drive time point.

How can I change the python code so that it reads from the record/file the specific drive time that I need for it to calculate?

Here is the Business Analyst drive time code:

arcpy.ba.GenerateDriveTimeTradeArea("Heat_Map_Grids_Point", r"C:\Default.gdb\Heat_Map_Drive_Times", "Driving Time", [5], "MINUTES", "GRID_ID", "OVERLAP", "KEEP_OVERLAP", "TOWARD_STORES", None, "TIME_ZONE_AT_LOCATION", None, "STANDARD")

the [5] (the distance value parameter) is the variable I need to convert to a field value.

Is this even possible, and what would some example code look like?

I am thinking sending the field values to a list and looping through that list would do the trick...but not sure how to create that code.

1 Answer 1


1) I believe GenerateDriveTimeTradeArea uses credits, if so you should check how the pricing works b/c looping through 600000 records and calling that tool each time might have some minimal credit charge for each call. That might be different from sending a bunch of records at once.

2) Not sure how long 600000 separate calls to this tool would take ... I assume the processing time would be diff vs. a call to the tool with a bunch of locations.

3) Are there common values in the 600000 for the values you want to calc for? That is are there just a few values like 5, 10, 15, 20. If so can you just break data up into separate tables and call the tool once for each table.

4) Does the tool have a limit to the number of points that can be sent at one time?

5) To loop through feature class see the help for search cursor

  • so this is for desktop and it does not consume credits, so there is no concern there. So the model produces a continuous set of predictions from about 3 minutes up to 15 minutes, so I probably could do some rounding and split at say every half or quarter minute and then run an iterate feature class after I split them up. The iterate feature class is slow though and am hoping to find as fast as possible solution that may include directly piping that field value into the arcpy code if possible Feb 12, 2020 at 23:17
  • Don't know if you have access to Network Analyst (and network data) but maybe creating Service Areas will do what you want (not sure of the diff vs. GenerateDriveTimeTradeArea). I believe it can use the Breaks_[Cost] from Facilities table. The "Breaks" fields on Faculties table is dependent upon the network data you are using and which you populate with the req. value is dependent on the travel mode you use ... see pro.arcgis.com/en/pro-app/help/analysis/networks/… ("Cutoffs" section)
    – dark fader
    Feb 14, 2020 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.