ArcGIS Pro Calling Network Analysis Tools in Python

02-06-2018 06:35 AM
New Contributor III

I am trying to use the Find Closest Facilities and/or the Make Service Area tool using Python inside of ArcGIS Pro. Since Pro establishes a connection to ArcGIS Online, a user is able to use these functions as 'Ready to Use' tools, as opposed to ArcMap where you were required to have the Network Analyst extension. I can manually use the tool on a sample set of data and produce results, but when I try to use them in Python or Modelbuilder, I have not had success.

I want to take a step back on this and pose a couple of general questions:

1) What do I need in my Python code to do this, so that I can run one of these tools inside a For loop?
2) How do I make a connection to my AGOL user account in Python and then import the tool (if necessary). Specifically, I've seen code such as:

gis = GIS("", "arcgis_python", "P@ssword123")
though, I am getting errors on invalid user name/passwords. Not sure if the URL is the issue either.

Basically, given that I can run the tool(s) manually, how do I run it iteratively/using Python?

0 Kudos
2 Replies
MVP Legendary Contributor

Can't answer the last part of the question, but if you are licensed for the Network Analyst in ArcMap, you are in Pro automatically.

If you are trying to use NA functionality and don't have a license and want to use AGOL, isn't there some 'charge' for using them?

0 Kudos
New Contributor III

We do not have the NA license and can use the manual version of the NA tools in Pro. In AGOL, there is a credits charge for using the tools, which is fine, but there is a 1,000 record limit on these tools, so that's why I'm trying to focus on Python/ModelBuilder in Pro to iterate through the data.

0 Kudos