Esri/large-network-analysis-tools

Modifying for Service Area

Sirocco97 opened this issue · 2 comments

How do I adapt this code to utilise Service Area analysis rather than OD Cost Matrix, and to also loop through multiple polygon barrier files?

Hello @Sirocco97. My apologies for the delay in response. I didn't see your issue until just now for some reason (and I adjusted my notification settings so it won't happen again).

In theory, you should be able to retain most of the structure of the OD Cost Matrix script and just swap in Service Area. Here is some helpful documentation for the ServiceArea network analysis solver class and its associated result object:
https://pro.arcgis.com/en/pro-app/latest/arcpy/network-analyst/servicearea.htm
https://pro.arcgis.com/en/pro-app/latest/arcpy/network-analyst/servicearearesult.htm

If you have never worked with these solver objects at all before, you will benefit from reading the overview help topic here: https://pro.arcgis.com/en/pro-app/latest/arcpy/network-analyst/performing-network-analysis.htm

If you're just generating Service Area polygons for a large number of facilities, you can strip out a lot of the optimizations for OD Cost Matrix. For example, you don't need to pre-select destinations within a straight-line cutoff of origins since this doesn't apply to Service Area. I suspect your modifications will largely involve deleting code that doesn't apply.

Depending on the size of your problem, you might want to first try just solving it straight in ArcGIS Pro without this special parallelization script. In recent releases of ArcGIS Pro, we have made some enhancements to the Service Area solver when using a network dataset in a mobile/sqlite geodatabase. This parallelizes the solve internally and, depending on your problem size, may be fast enough for you. To get your network dataset into this format, you need to run the Create Mobile Map Package tool, or use the pane in the ArcGIS Pro UI, and then extract the package. You can contact Esri Support if you need help with this.

I'm going to assume this question has been adequately answered. Feel free to reopen if you still have questions.