ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

GetToolInfo

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Get information such as the description of the network dataset used for the analysis and the execution limits for a tool in the geoprocessing service.

Usage

  • The tool is meant to be used before executing other tools in the geoprocessing service. For example, if you need to identify the maximum number of stops supported by the FindRoutes tool, you can run GetToolInfo to determine the limit.

Syntax

arcpy.naagol.GetToolInfo(serviceName, toolName)
ParameterExplanationData Type
serviceName

The service name containing the tool. The parameter value should be specified using one of the following keywords that reference a particular geoprocessing service:

  • asyncClosestFacility—The asynchronous geoprocessing service used to perform the closest facility analysis.
  • asyncLocationAllocation—The asynchronous geoprocessing service used to perform the location-allocation analysis.
  • asyncRoute—The asynchronous geoprocessing service used to perform the route analysis.
  • asyncServiceArea—The asynchronous geoprocessing service used to perform the service area analysis.
  • asyncVRP—The asynchronous geoprocessing service used to perform the vehicle routing problem analysis.
  • syncVRP—The synchronous geoprocessing service used to perform the vehicle routing problem analysis.
  • asyncODCostMatrix—The asynchronous geoprocessing service used to perform the origin destination cost matrix analysis.

The default value is asyncRoute.

String
toolName

The tool name in the geoprocessing service. The parameter value should be a valid tool name in the geoprocessing service specified by the serviceName parameter. Valid tool names are as follows:

  • FindClosestFacilities for the asyncClosestFacility service
  • SolveLocationAllocation for the asyncLocationAllocation service
  • FindRoutes for the Route service
  • GenerateServiceAreas for the asyncServiceArea service
  • SolveVehicleRoutingProblem for the asyncVRP service
  • EditVehicleRoutingProblem for the syncVRP service
  • GenerateOriginDestinationCostMatrix for the asyncODCostMatrix service

The default value is FindRoutes.

String

Derived Output

NameExplanationData Type
toolInfo

Additional information about a tool in the geoprocessing service.

String

Code sample

GetToolInfo example

The following Python script demonstrates how to use the GetToolInfo tool in a script.

'''
The script shows how to use the GetToolInfo tool to get the maximum number of stops
that can be used as inputs with FindRoutes tool.
'''
import sys
import json

import arcpy

#Change the username and password applicable to your own ArcGIS Online account
username = "<your user name>"
password = "<your password>"

utility_service = "https://logistics.arcgis.com/arcgis/services;World/Utilities;{0};{1}".format(username, password)

#Add the geoprocessing service as a toolbox.
arcpy.ImportToolbox(utility_service)

#Call the tool to get the limits for the FindRoutes tool 
result = arcpy.Utilities.GetToolInfo("asyncRoute", "FindRoutes")

#Print any warning or error messages returned from the tool
result_severity = arcpy.GetMaxSeverity()
if result_severity == 2:
    arcpy.AddMessage("An error occured when running the tool")
    arcpy.AddMessage(arcpy.GetMessages(2))
    sys.exit(2)
elif result_severity == 1:
    arcpy.AddMessage("Warnings were returned when running the tool")
    arcpy.AddMessage(arcpy.GetMessages(1))

#Retrieve the tool info and convert it to a dictionary
output_tool_info_json = result.getOutput(0)
output_tool_info_dict = json.loads(output_tool_info_json)

#Retrieve the maximum number of stops allowed by the service
max_stops = int(output_tool_info_dict["serviceLimits"]["maximumStops"])
arcpy.AddMessage("The maximum number of stops supported by the FindRoutes tool: {}" .format(max_stops))

Environments

This tool does not use any geoprocessing environments.

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal