arcgis package¶
Submodules¶
arcgis.gis module¶
arcgis.env module¶
arcgis.features module¶
arcgis.raster module¶
arcgis.network module¶
arcgis.schematics module¶
arcgis.geoanalytics module¶
arcgis.geocoding module¶
arcgis.geometry module¶
arcgis.geoenrichment module¶
arcgis.geoprocessing module¶
arcgis.mapping module¶
arcgis.widgets module¶
arcgis.apps module¶
Module contents¶
-
class
arcgis.
GIS
(url=None, username=None, password=None, key_file=None, cert_file=None, verify_cert=True, set_active=True, client_id=None, profile=None, **kwargs)¶ Bases:
object
A GIS is representative of a single ArcGIS Online organization or an ArcGIS Enterprise deployment. The GIS object provides helper objects to manage (search, create, retrieve) GIS resources such as content, users, and groups.
Additionally, the GIS object has properties to query its state, which is accessible using the properties attribute.
The GIS provides a mapping widget that can be used in the Jupyter Notebook environment for visualizing GIS content as well as the results of your analysis. To create a new map, call the map() method.
The constructor constructs a GIS object given a url and user credentials to ArcGIS Online or an ArcGIS Enterprise Portal. User credentials can be passed in using username/password pair, or key_file/cert_file pair (in case of PKI). Supports built-in users, LDAP, PKI, Integrated Windows Authentication (using NTLM and Kerberos) and Anonymous access.
If no url is provided, ArcGIS Online is used. If username/password or key/cert files are not provided, the currently logged-in user’s credentials (IWA) or anonymous access is used.
Persisted profiles for the GIS can be created by giving the GIS authorization credentials and specifying a profile name. The profile stores all of the authorization credentials (except the password) in the user’s home directory in an unencrypted config file named .arcgisprofile. The profile securely stores the password in an O.S. specific password manager through the keyring python module. (Note: Linux systems may need additional software installed and configured for proper security) Once a profile has been saved, passing the profile parameter by itself uses the authorization credentials saved in the configuration file/password manager by that profile name. Multiple profiles can be created and used in parallel.
See https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/ for examples.
Argument
Description
url
Optional string. If URL is None, then the URL will be ArcGIS Online. This should be a web address to either a local Portal or to ArcGIS Online in the form: <scheme>://<fully_qualified_domain_name>/<web_adaptor> (Portal Example) https://gis.example.com/portal
username
Optional string. The login user name (case-sensitive).
password
Optional string. If a username is provided, a password is expected. This is case-sensitive. If the password is not provided, the user is prompted in the interactive dialog.
key_file
Optional string. The file path to a user’s key certificate for PKI authentication
cert_file
Optional string. The file path to a user’s certificate file for PKI authentication. If a PFX or P12 certificate is used, a password is required. If a PEM file is used, the key_file is required.
verify_cert
Optional boolean. If a site has an invalid SSL certificate or is being accessed via the IP or hostname instead of the name on the certificate, set this value to False. This will ensure that all SSL certificate issues are ignored. The default is True. Warning Setting the value to False can be a security risk.
set_active
Optional boolean. The default is True. If True, the GIS object will be used as the default GIS object throughout the whole scripting session.
client_id
Optional string. Used for OAuth authentication. This is the client ID value.
profile
Optional string. the name of the profile that the user wishes to use to authenticate, if set, the identified profile will be used to login to the specified GIS.
In addition to explicitly named parameters, the GIS object supports optional key word arguments:
kwargs
Description
proxy_host
Optional string. The host name of the proxy server used to allow HTTP/S access in the network where the script is run.
ex: 127.0.0.1
proxy_port
Optional integer. The proxy host port. The default is 80.
token
Optional string. This is the Enterprise token for built-in logins. This parameter is only honored if the username/password is None and the security for the site uses BUILT-IN security.
# Usage Example 1: Anonymous Login to ArcGIS Online gis = GIS()
# Usage Example 2: Built-in Login to ArcGIS Online gis = GIS(username="someuser", password="secret1234")
# Usage Example 3: Built-in Login to ArcGIS Enterprise gis = GIS(url="http://pythonplayground.esri.com/portal", username="user1", password="password1")
# Usage Example 4: Built-in Login to ArcGIS Enterprise, ignoring SSL errors gis = GIS(url="http://pythonplayground.esri.com/portal", username="user1", password="password1", verify_cert=False)
# Usage Example 5: Anonymous ArcGIS Online Login with Proxy gis = GIS(proxy_host='127.0.0.1', proxy_port=8888)
# Usage Example 6: PKI Login to ArcGIS Enterprise, using PKCS12 user certificate gis = GIS(url="https://pkienterprise.esri.com/portal", cert_file="C:\users\someuser\mycert.pfx", password="password1")
-
property
content
¶ The resource manager for GIS content. See
ContentManager
.
-
property
groups
¶ The resource manager for GIS groups. See
GroupManager
.
-
map
(location=None, zoomlevel=None, mode='2D')¶ Creates a map widget centered at the declared location with the specified zoom level. If an address is provided, it is geocoded using the GIS’s configured geocoders and if a match is found, the geographic extent of the matched address is used as the map extent. If a zoomlevel is also provided, the map is centered at the matched address instead and the map is zoomed to the specified zoomlevel. See
widgets
for more information.Note: The map widget is only supported within Jupyter Notebook.
Argument
Description
location
Optional string. The address or lat-long tuple of where the map is to be centered.
zoomlevel
Optional integer. The desired zoom level.
mode
Optional string of either ‘2D’ or ‘3D’ to specify map mode. Defaults to ‘2D’.
- Returns
The map widget (displayed in Jupyter Notebook when queried).
-
property
properties
¶ The properties of the GIS.
-
update_properties
(properties_dict)¶ Updates the GIS’s properties from those in properties_dict. This method can be useful for updating the utility services used by the GIS.
Argument
Description
properties_dict
Required dictionary. A dictionary of just those properties and values that are to be updated.
- Returns
True if successfully updated, False if unsuccessful.
Note
For examples of the property names and key/values to use when updating utility services, refer to the Portal parameters section at https://developers.arcgis.com/rest/users-groups-and-items/common-parameters.htm
# Usage Example: Update the geocode service gis = GIS(profile='xyz') upd = {'geocodeService': [{ "singleLineFieldName": "Single Line Input", "name": "AtlantaLocator", "url": "https://some.server.com/server/rest/services/GeoAnalytics/AtlantaLocator/GeocodeServer", "itemId": "abc6e1fc691542938917893c8944606d", "placeholder": "", "placefinding": "true", "batch": "true", "zoomScale": 10000}]} gis.update_properties(upd)
-
property
url
¶ Readonly URL of the GIS you are connected to.
-
property
users
¶ The resource manager for GIS users. See
UserManager
.
-
property
version
¶ returns the GIS version number
-
property
-
arcgis.
geocode
(address, search_extent=None, location=None, distance=None, out_sr=None, category=None, out_fields='*', max_locations=20, magic_key=None, for_storage=False, geocoder=None, as_featureset=False)¶ The geocode function geocodes one location per request.
Argument
Description
address
required list of strings or dictionaries. Specifies the location to be geocoded. This can be a string containing the street address, place name, postal code, or POI.
Alternatively, this can be a dictionary containing the various address fields accepted by the corresponding geocoder. These fields are listed in the addressFields property of the associated geocoder. For example, if the address_fields of a geocoder includes fields with the following names: Street, City, State and Zone, then the address argument is of the form: {
Street: “1234 W Main St”, City: “Small Town”, State: “WA”, Zone: “99027”
}
search_extent
optional string, A set of bounding box coordinates that limit the search area to a specific region. This is especially useful for applications in which a user will search for places and addresses only within the current map extent.
location
optionl [x,y], Defines an origin point location that is used with the distance parameter to sort geocoding candidates based upon their proximity to the location.
distance
optional float, Specifies the radius of an area around a point location which is used to boost the rank of geocoding candidates so that candidates closest to the location are returned first. The distance value is in meters.
out_sr
optional dictionary, The spatial reference of the x/y coordinates returned by a geocode request. This is useful for applications using a map with a spatial reference different than that of the geocode service.
category
optional string, A place or address type which can be used to filter find results. The parameter supports input of single category values or multiple comma-separated values. The category parameter can be passed in a request with or without the text parameter.
out_fields
optional string, name of all the fields to inlcude. The default is “*” which means all fields.
max_location
optional integer, The number of locations to be returned from the service. The default is 20.
magic_key
The find operation retrieves results quicker when you pass a valid text and magickey value.
for_storage
Specifies whether the results of the operation will be persisted. The default value is false, which indicates the results of the operation can’t be stored, but they can be temporarily displayed on a map for instance. If you store the results, in a database for example, you need to set this parameter to true.
geocoder
Optional, the geocoder to be used. If not specified, the active GIS’s first geocoder is used.
as_featureset
optional boolean, if True, the result set is returned as a FeatureSet object, else it is a dictionary.
- Returns
dictionary
-
arcgis.
aggregate_points
(point_layer, polygon_layer, keep_boundaries_with_no_points=True, summary_fields=[], group_by_field=None, minority_majority=False, percent_points=False, output_name=None, context=None, gis=None)¶ Aggregate points task allows you to aggregate or count the total number of points that are distributed within specified areas or boundaries (polygons). You can also summarize Sum, Mean, Min, Max and Standard deviation calculations for attributes of the point layer to understand the general characteristics of aggregated points.
- point_layerRequired layer (see Feature Input in documentation)
Point layer to be aggregated
- polygon_layerRequired layer (see Feature Input in documentation)
Polygon layer to which the points should be aggregated.
- keep_boundaries_with_no_pointsOptional bool
Specify whether the polygons without any points should be returned in the output.
- summary_fieldsOptional list of strings
A list of field names and summary type. Example [fieldName1 summaryType1,fieldName2 summaryType2].
- group_by_fieldOptional string
A field name from PointLayer based on which the points will be grouped.
- minority_majorityOptional bool
This boolean parameter is applicable only when a groupByField is specified. If true, the minority (least dominant) or the majority (most dominant) attribute values within each group, within each boundary will be calculated.
- percent_pointsOptional bool
This boolean parameter is applicable only when a groupByField is specified. If set to true, the percentage count of points for each unique groupByField value is calculated.
- output_nameOptional string
Additional properties such as output feature service name.
- contextOptional string
Additional settings such as processing extent and output spatial reference.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
- dict with the following keys:
“aggregated_layer” : layer (FeatureCollection) “group_summary” : layer (FeatureCollection)
-
arcgis.
calculate_density
(input_layer, field=None, cell_size=None, cell_size_units='Meters', radius=None, radius_units=None, bounding_polygon_layer=None, area_units=None, classification_type='EqualInterval', num_classes=10, output_name=None, context=None, gis=None)¶ The calculate_density function creates a density map from point or line features by spreading known quantities of some phenomenon (represented as attributes of the points or lines) across the map. The result is a layer of areas classified from least dense to most dense.
- input_layerRequired layer (see Feature Input in documentation)
The point or line features from which to calculate density.
- fieldOptional string
A numeric field name specifying the number of incidents at each location. If not specified, each location will be assumed to represent a single count.
- cell_sizeOptional float
This value is used to create a mesh of points where density values are calculated. The default is approximately 1/1000th of the smaller of the width and height of the analysis extent as defined in the context parameter.
- cell_size_unitsOptional string
The units of the cellSize value
- radiusOptional float
A distance specifying how far to search to find point or line features when calculating density values.
- radius_unitsOptional string
The units of the radius parameter.
- bounding_polygon_layerOptional layer (see Feature Input in documentation)
A layer specifying the polygon(s) where you want densities to be calculated.
- area_unitsOptional string
The units of the calculated density values.
- classification_typeOptional string
Determines how density values will be classified into polygons.
- num_classesOptional int
This value is used to divide the range of predicted values into distinct classes. The range of values in each class is determined by the classificationType parameter.
- output_nameOptional string
Additional properties such as output feature service name.
- contextOptional string
Additional settings such as processing extent and output spatial reference.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
result_layer : layer (FeatureCollection)
-
arcgis.
connect_origins_to_destinations
(origins_layer, destinations_layer, measurement_type='DrivingTime', origins_layer_route_id_field=None, destinations_layer_route_id_field=None, time_of_day=None, time_zone_for_time_of_day='GeoLocal', output_name=None, context=None, gis=None)¶ Calculates routes between pairs of points.
- origins_layerRequired layer (see Feature Input in documentation)
The routes start from points in the origins layer.
- destinations_layerRequired layer (see Feature Input in documentation)
The routes end at points in the destinations layer.
- measurement_typeRequired string
The routes can be determined by measuring travel distance or travel time along street network using different travel modes or by measuring straight line distance.
- origins_layer_route_id_fieldOptional string
The field in the origins layer containing the IDs that are used to match an origin with a destination.
- destinations_layer_route_id_fieldOptional string
The field in the destinations layer containing the IDs that are used to match an origin with a destination.
- time_of_dayOptional datetime.datetime
When measurementType is DrivingTime, this value specifies the time of day to be used for driving time calculations based on traffic. WalkingTime and TruckingTime measurementType do not support calculations based on traffic.
- time_zone_for_time_of_dayOptional string
Determines if the value specified for timeOfDay is specified in UTC or in a time zone that is local to the location of the origins.
- output_nameOptional string
Additional properties such as output feature service name.
- contextOptional string
Additional settings such as processing extent and output spatial reference.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
- dict with the following keys:
“routes_layer” : layer (FeatureCollection) “unassigned_origins_layer” : layer (FeatureCollection) “unassigned_destinations_layer” : layer (FeatureCollection)
-
arcgis.
create_buffers
(input_layer, distances=[], field=None, units='Meters', dissolve_type='None', ring_type='Disks', side_type='Full', end_type='Round', output_name=None, context=None, gis=None)¶ Creates buffer polygon(s) around input features.
- input_layerRequired layer (see Feature Input in documentation)
The input to be buffered.
- distancesOptional list of floats
The distance(s) that will be buffered.
- fieldOptional string
Buffers will be created using field values.
- unitsOptional string
The linear unit to be used with the distance value(s).
- dissolve_typeOptional string
Specifies the dissolve to be performed to remove buffer overlap.
- ring_typeOptional string
The ring type.
- side_typeOptional string
The side(s) of the input that will be buffered.
- end_typeOptional string
The shape of the buffer at the end of buffered line features.
- output_nameOptional string
Additional properties such as output feature service name.
- contextOptional string
Additional settings such as processing extent and output spatial reference.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
buffer_layer : layer (FeatureCollection)
-
arcgis.
create_drive_time_areas
(input_layer, break_values=[5, 10, 15], break_units='Minutes', travel_mode='Driving', overlap_policy='Overlap', time_of_day=None, time_zone_for_time_of_day='GeoLocal', output_name=None, context=None, gis=None)¶ input_layer : Required layer (see Feature Input in documentation)
break_values : Optional list of floats
break_units : Optional string
travel_mode : Optional string
overlap_policy : Optional string
time_of_day : Optional datetime.datetime
time_zone_for_time_of_day : Optional string
- output_nameOptional string
Additional properties such as output feature service name.
- contextOptional string
Additional settings such as processing extent and output spatial reference.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
drive_time_areas_layer : layer (FeatureCollection)
-
arcgis.
create_route_layers
(route_data_item, delete_route_data_item=False, tags=None, summary=None, route_name_prefix=None, folder_name=None, gis=None)¶ Creates route layer items on the portal from the input route data.
- route_data_itemRequired item
The route data item that is used to create route layer items.
- delete_route_data_itemRequired Boolean (see Feature Input in documentation)
Indicates if the input route data item should be deleted. The default value is False which does not delete the route data item.
- tags: Optional string
Tags used to describe and identify the route layer items. Individual tags are separated using a comma. The route name is always added as a tag even when a value for this argument is not specified.
- summary: Optional string
The summary displayed as part of the item information for the route layer item. If a value for this argument is not specified, a default summary text “Route and directions for <Route Name>” is used.
- route_name_prefixOptional string
A qualifier added to the title of every route layer item. This can be used to designate all routes that are shared for a specific purpose to have the same prefix in the title. The name of the route is always appended after this qualifier. If a value for the route_name_prefix is not specified, the title for the route layer item is created using only the route name.
- folder_name: Optional string
The folder within your personal online workspace (My Content in your ArcGIS Online or Portal for ArcGIS organization) where the route layer items will be created. If a folder with the specified name does not exist, a new folder will be created. If a folder with the specified name exists, the items will be created in the existing folder. If a value for folder_name is not specified, the route layer items are created in the root folder of your online workspace.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
route_layers : list (items)
-
arcgis.
create_viewshed
(input_layer, dem_resolution='Finest', maximum_distance=None, max_distance_units='Meters', observer_height=None, observer_height_units='Meters', target_height=None, target_height_units='Meters', generalize=True, output_name=None, context=None, gis=None)¶ Creates areas that are visible based on locations you specify.
input_layer : Required layer (see Feature Input in documentation)
dem_resolution : Optional string
maximum_distance : Optional float
max_distance_units : Optional string
observer_height : Optional float
observer_height_units : Optional string
target_height : Optional float
target_height_units : Optional string
generalize : Optional bool
output_name : Optional string
context : Optional string
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
viewshed_layer : layer (FeatureCollection)
-
arcgis.
create_watersheds
(input_layer, search_distance=None, search_units='Meters', source_database='FINEST', generalize=True, output_name=None, context=None, gis=None)¶ Creates catchment areas based on locations you specify.
input_layer : Required layer (see Feature Input in documentation)
search_distance : Optional float
search_units : Optional string
source_database : Optional string
generalize : Optional bool
output_name : Optional string
context : Optional string
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
- dict with the following keys:
“snap_pour_pts_layer” : layer (FeatureCollection) “watershed_layer” : layer (FeatureCollection)
-
arcgis.
derive_new_locations
(input_layers=[], expressions=[], output_name=None, context=None, gis=None)¶ The Derive New Locations task derives new features from the input layers that meet a query you specify. A query is made up of one or more expressions. There are two types of expressions: attribute and spatial. An example of an attribute expression is that a parcel must be vacant, which is an attribute of the Parcels layer (where STATUS = ‘VACANT’). An example of a spatial expression is that the parcel must also be within a certain distance of a river (Parcels within a distance of 0.75 Miles from Rivers).The Derive New Locations task is very similar to the Find Existing Locations task, the main difference is that the result of Derive New Locations can contain partial features.In both tasks, the attribute expression where and the spatial relationships within and contains return the same result. This is because these relationships return entire features.When intersects or withinDistance is used, Derive New Locations creates new features in the result. For example, when intersecting a parcel feature and a flood zone area that partially overlap each other, Find Existing Locations will return the entire parcel whereas Derive New Locations will return just the portion of the parcel that is within the flood zone.
- input_layersRequired list of strings
A list of layers that will be used in the expressions parameter.
- expressionsRequired string
Specify a list of expressions. Please refer documentation at http://developers.arcgis.com for more information on expressions.
- output_nameOptional string
Additional properties such as output feature service name.
- contextOptional string
Additional settings such as processing extent and output spatial reference.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
result_layer : layer (FeatureCollection)
-
arcgis.
dissolve_boundaries
(input_layer, dissolve_fields=[], summary_fields=[], output_name=None, context=None, gis=None)¶ Dissolve features based on specified fields.
- input_layerRequired layer (see Feature Input in documentation)
The layer containing polygon features that will be dissolved.
- dissolve_fieldsOptional list of strings
One or more fields from the input that control which polygons are merged. If no fields are supplied, all polygons that overlap or shared a common border will be dissolved into one polygon.
- summary_fieldsOptional list of strings
A list of field names and statistical types that will be used to summarize the output. Supported statistics include: Sum, Mean, Min, Max, and Stddev.
- output_nameOptional string
Additional properties such as output feature service name.
- contextOptional string
Additional settings such as processing extent and output spatial reference.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
dissolved_layer : layer (FeatureCollection)
-
arcgis.
enrich_layer
(input_layer, data_collections=[], analysis_variables=[], country=None, buffer_type=None, distance=None, units=None, output_name=None, context=None, gis=None)¶ The enrich_layer function enriches your data by getting facts about the people, places, and businesses that surround your data locations. For example: What kind of people live here? What do people like to do in this area? What are their habits and lifestyles? What kind of businesses are there in this area?The result will be a new layer of input features that includes all demographic and geographic information from given data collections.
- input_layerRequired layer (see Feature Input in documentation)
Feature layer to enrich with new data
- data_collectionsOptional list of strings
Data collections you wish to add to your features.
- analysis_variablesOptional list of strings
A subset of specific variables instead of dataCollections.
- countryOptional string
The two character country code that specifies the country of the input features. Eg. US (United States), FR (France), GB (United Kingdom) etc.
- buffer_typeOptional string
Area to be created around the point or line features for enrichment. Default is 1 Mile straight-line buffer radius.
- distanceOptional float
A double value that defines the straight-line distance or time (when drivingTime is used).
- unitsOptional string
The unit (eg. Miles, Minutes) to be used with the distance value(s) specified in the distance parameter to calculate the area.
- output_nameOptional string
Additional properties such as output feature service name.
- contextOptional string
Additional settings such as processing extent and output spatial reference.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
enriched_layer : layer (FeatureCollection)
-
arcgis.
extract_data
(input_layers, extent=None, clip=False, data_format=None, output_name=None, context=None, gis=None)¶ Select and download data for a specified area of interest. Layers that you select will be added to a zip file or layer package.
- input_layersRequired list of strings
The layers from which you can extract features.
- extentOptional string
The area that defines which features will be included in the output zip file or layer package.
- clipOptional bool
Select features that intersect the extent or clip features within the extent.
- data_formatOptional string
Format of the data that will be extracted and downloaded. Layer packages will always include file geodatabases.
- output_nameOptional string
Additional properties such as output feature service name.
- contextOptional string
Additional settings such as processing extent and output spatial reference.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
content_id : layer (FeatureCollection)
-
arcgis.
find_existing_locations
(input_layers=[], expressions=[], output_name=None, context=None, gis=None)¶ The Find Existing Locations task selects features in the input layer that meet a query you specify. A query is made up of one or more expressions. There are two types of expressions: attribute and spatial. An example of an attribute expression is that a parcel must be vacant, which is an attribute of the Parcels layer (where STATUS = ‘VACANT’). An example of a spatial expression is that the parcel must also be within a certain distance of a river (Parcels within a distance of 0.75 Miles from Rivers).
- input_layersRequired list of strings
A list of layers that will be used in the expressions parameter.
- expressionsRequired string
Specify a list of expressions. Please refer documentation at http://developers.arcgis.com for more information on creating expressions.
- output_nameOptional string
Additional properties such as output feature service name.
- contextOptional string
Additional settings such as processing extent and output spatial reference.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
result_layer : layer (FeatureCollection)
-
arcgis.
find_hot_spots
(analysis_layer, analysis_field=None, divided_by_field=None, bounding_polygon_layer=None, aggregation_polygon_layer=None, output_name=None, context=None, gis=None)¶ The Find Hot Spots function finds statistically significant clusters of incident points, weighted points, or weighted polygons. For incident data, the analysis field (weight) is obtained by aggregation. Output is a hot spot map.
gis : The GIS used for running this analysis analysis_layer : Required layer (see Feature Input in documentation)
The point or polygon feature layer for which hot spots will be calculated.
- analysis_fieldOptional string
The numeric field in the AnalysisLayer that will be analyzed.
divided_by_field : Optional string
- bounding_polygon_layerOptional layer (see Feature Input in documentation)
When the analysis layer is points and no AnalysisField is specified, you can provide polygons features that define where incidents could have occurred.
- aggregation_polygon_layerOptional layer (see Feature Input in documentation)
When the AnalysisLayer contains points and no AnalysisField is specified, you can provide polygon features into which the points will be aggregated and analyzed, such as administrative units.
- output_nameOptional string
Additional properties such as output feature service name.
- contextOptional string
Additional settings such as processing extent and output spatial reference.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
- dict with the following keys:
“hot_spots_result_layer” : layer (FeatureCollection) “process_info” : list of messages
-
arcgis.
find_nearest
(analysis_layer, near_layer, measurement_type='StraightLine', max_count=100, search_cutoff=2147483647, search_cutoff_units=None, time_of_day=None, time_zone_for_time_of_day='GeoLocal', output_name=None, context=None, gis=None)¶ Measures the straight-line distance, driving distance, or driving time from features in the analysis layer to features in the near layer, and copies the nearest features in the near layer to a new layer. Returns a layer containing the nearest features and a line layer that links the start locations to their nearest locations.
- analysis_layerRequired layer (see Feature Input in documentation)
For each feature in this layer, the task finds the nearest features from the nearLayer.
- near_layerRequired layer (see Feature Input in documentation)
The features from which the nearest locations are found.
- measurement_typeRequired string
The nearest locations can be determined by measuring straight-line distance, driving distance, or driving time
- max_countOptional int
The maximum number of near locations to find for each feature in analysisLayer.
- search_cutoffOptional float
Limits the search range to this value
- search_cutoff_unitsOptional string
The units for the value specified as searchCutoff
- time_of_dayOptional datetime.datetime
When measurementType is DrivingTime, this value specifies the time of day to be used for driving time calculations based on traffic.
time_zone_for_time_of_day : Optional string
- output_nameOptional string
Additional properties such as output feature service name
- contextOptional string
Additional settings such as processing extent and output spatial reference
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
- dict with the following keys:
“nearest_layer” : layer (FeatureCollection) “connecting_lines_layer” : layer (FeatureCollection)
-
arcgis.
find_similar_locations
(input_layer, search_layer, analysis_fields=[], input_query=None, number_of_results=0, output_name=None, context=None, gis=None)¶ Finds the locations that are most similar to one or more reference locations based on criteria that you specify.
input_layer : Required layer (see Feature Input in documentation)
search_layer : Required layer (see Feature Input in documentation)
analysis_fields : Required list of strings
input_query : Optional string
number_of_results : Optional int
output_name : Optional string
context : Optional string
- dict with the following keys:
“similar_result_layer” : layer (FeatureCollection) “process_info” : layer (FeatureCollection)
-
arcgis.
interpolate_points
(input_layer, field, interpolate_option='5', output_prediction_error=False, classification_type='GeometricInterval', num_classes=10, class_breaks=[], bounding_polygon_layer=None, predict_at_point_layer=None, output_name=None, context=None, gis=None)¶ The Interpolate Points function allows you to predict values at new locations based on measurements from a collection of points. The function takes point data with values at each point and returns areas classified by predicted values.
- input_layerRequired layer (see Feature Input in documentation)
The point layer whose features will be interpolated.
- fieldRequired string
Name of the numeric field containing the values you wish to interpolate.
- interpolate_optionOptional string
Integer value declaring your preference for speed versus accuracy, from 1 (fastest) to 9 (most accurate). More accurate predictions take longer to calculate.
- output_prediction_errorOptional bool
If True, a polygon layer of standard errors for the interpolation predictions will be returned in the predictionError output parameter.
- classification_typeOptional string
Determines how predicted values will be classified into areas.
- num_classesOptional int
This value is used to divide the range of interpolated values into distinct classes. The range of values in each class is determined by the classificationType parameter. Each class defines the boundaries of the result polygons.
- class_breaksOptional list of floats
If classificationType is Manual, supply desired class break values separated by spaces. These values define the upper limit of each class, so the number of classes will equal the number of entered values. Areas will not be created for any locations with predicted values above the largest entered break value. You must enter at least two values and no more than 32.
- bounding_polygon_layerOptional layer (see Feature Input in documentation)
A layer specifying the polygon(s) where you want values to be interpolated.
- predict_at_point_layerOptional layer (see Feature Input in documentation)
An optional layer specifying point locations to calculate prediction values. This allows you to make predictions at specific locations of interest.
- output_nameOptional string
Additional properties such as output feature service name.
- contextOptional string
Additional settings such as processing extent and output spatial reference.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
- dict with the following keys:
“result_layer” : layer (FeatureCollection) “prediction_error” : layer (FeatureCollection) “predicted_point_layer” : layer (FeatureCollection)
-
arcgis.
join_features
(target_layer, join_layer, spatial_relationship=None, spatial_relationship_distance=None, spatial_relationship_distance_units=None, attribute_relationship=None, join_operation='JoinOneToOne', summary_fields=None, output_name=None, context=None, gis=None)¶ Parameters:
target_layer: targetLayer (str). Required parameter.
join_layer: joinLayer (str). Required parameter.
- spatial_relationship: spatialRelationship (str). Optional parameter.
Choice list:[‘intersects’, ‘withindistance’, ‘completelycontains’, ‘completelywithin’, ‘within’, ‘contains’, ‘identicalto’]
spatial_relationship_distance: spatialRelationshipDistance (float). Optional parameter.
- spatial_relationship_distance_units: spatialRelationshipDistanceUnits (str). Optional parameter.
Choice list:[‘Meters’, ‘Kilometers’, ‘Feet’, ‘Yards’, ‘Miles’, ‘NauticalMiles’]
attribute_relationship: attributeRelationship (str). Optional parameter.
- join_operation: joinOperation (str). Optional parameter.
Choice list:[‘JoinOneToOne’, ‘JoinOneToMany’]
summary_fields: summaryFields (str). Optional parameter.
output_name: outputName (str). Optional parameter.
context: context (str). Optional parameter.
gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
- Returns:
output_layer - outputLayer as a str
See http://localhost:6080/arcgis/rest/directories/arcgisoutput/tasks_GPServer/tasks/JoinFeatures.htm for additional help.
-
arcgis.
merge_layers
(input_layer, merge_layer, merging_attributes=[], output_name=None, context=None, gis=None)¶ Combines two inputs of the same feature data type into a new output.
- input_layerRequired layer (see Feature Input in documentation)
The point, line, or polygon features to merge with the mergeLayer.
- merge_layerRequired layer (see Feature Input in documentation)
The point, line or polygon features to merge with inputLayer. mergeLayer must contain the same feature type point, line, or polygon) as the inputLayer.
- merging_attributesOptional list of strings
An array of values that describe how fields from the mergeLayer are to be modified. By default all fields from both inputs will be carried across to the output.
- output_nameOptional string
Additional properties such as output feature service name.
- contextOptional string
Additional settings such as processing extent and output spatial reference.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
merged_layer : layer (FeatureCollection)
-
arcgis.
overlay_layers
(input_layer, overlay_layer, overlay_type='Intersect', snap_to_input=False, output_type='Input', tolerance=None, output_name=None, context=None, gis=None)¶ Overlays the input layer with the overlay layer. Overlay operations supported are Intersect, Union, and Erase.
- input_layerRequired layer (see Feature Input in documentation)
The input analysis layer.
- overlay_layerRequired layer (see Feature Input in documentation)
The layer to be overlaid with the analysis layer.
- overlay_typeOptional string
The overlay type (INTERSECT, UNION, or ERASE) defines how the analysis layer and the overlay layer are combined.
- snap_to_inputOptional bool
When the distance between features is less than the tolerance, the features in the overlay layer will snap to the features in the input layer.
- output_typeOptional string
The type of intersection (INPUT, LINE, POINT).
- toleranceOptional float
The minimum distance separating all feature coordinates (nodes and vertices) as well as the distance a coordinate can move in X or Y (or both).
- output_nameOptional string
Additional properties such as output feature service name.
- contextOptional string
Additional settings such as processing extent and output spatial reference.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
output_layer : layer (FeatureCollection)
-
arcgis.
plan_routes
(stops_layer, route_count, max_stops_per_route, route_start_time, start_layer, start_layer_route_id_field=None, return_to_start=True, end_layer=None, end_layer_route_id_field=None, travel_mode='Driving', stop_service_time=0, max_route_time=525600, output_name=None, context=None, gis=None)¶ You provide a set of stops and the number of vehicles available to visit the stops, and Plan Routes determines how to efficiently assign the stops to the vehicles and route the vehicles to the stops.
Use this tool to plan work for a mobile team of inspectors, appraisers, in-home support service providers, and others; deliver or pick up items from remote locations; or offer transportation services to people.
stops_layer : Required layer (see Feature Input in documentation)
route_count : Required int
max_stops_per_route : Required int
route_start_time : Required datetime.datetime
start_layer : Required layer (see Feature Input in documentation)
start_layer_route_id_field : Optional string
return_to_start : Optional bool
end_layer : Optional layer (see Feature Input in documentation)
end_layer_route_id_field : Optional string
travel_mode : Optional string
stop_service_time : Optional float
max_route_time : Optional float
output_name : Optional string
context : Optional string
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
- dict with the following keys:
“routes_layer” : layer (FeatureCollection) “assigned_stops_layer” : layer (FeatureCollection) “unassigned_stops_layer” : layer (FeatureCollection)
-
arcgis.
summarize_nearby
(sum_nearby_layer, summary_layer, near_type='StraightLine', distances=[], units='Meters', time_of_day=None, time_zone_for_time_of_day='GeoLocal', return_boundaries=True, sum_shape=True, shape_units=None, summary_fields=[], group_by_field=None, minority_majority=False, percent_shape=False, output_name=None, context=None, gis=None)¶ The SummarizeNearby task finds features that are within a specified distance of features in the input layer. Distance can be measured as a straight-line distance, a drive-time distance (for example, within 10 minutes), or a drive distance (within 5 kilometers). Statistics are then calculated for the nearby features. For example:Calculate the total population within five minutes of driving time of a proposed new store location.Calculate the number of freeway access ramps within a one-mile driving distance of a proposed new store location to use as a measure of store accessibility.
- sum_nearby_layerRequired layer (see Feature Input in documentation)
Point, line, or polygon features from which distances will be measured to features in the summarizeLayer.
- summary_layerRequired layer (see Feature Input in documentation)
Point, line, or polygon features. Features in this layer that are within the specified distance to features in the sumNearbyLayer will be summarized.
- near_typeOptional string
Defines what kind of distance measurement you want to use to create areas around the nearbyLayer features.
- distancesRequired list of floats
An array of double values that defines the search distance for creating areas mentioned above
- unitsOptional string
The linear unit for distances parameter above. Eg. Miles, Kilometers, Minutes Seconds etc
- time_of_dayOptional datetime.datetime
For timeOfDay, set the time and day according to the number of milliseconds elapsed since the Unix epoc (January 1, 1970 UTC). When specified and if relevant for the nearType parameter, the traffic conditions during the time of the day will be considered.
- time_zone_for_time_of_dayOptional string
Determines if the value specified for timeOfDay is specified in UTC or in a time zone that is local to the location of the origins.
- return_boundariesOptional bool
If true, will return a result layer of areas that contain the requested summary information. The resulting areas are defined by the specified nearType. For example, if using a StraightLine of 5 miles, your result will contain areas with a 5 mile radius around the input features and specified summary information.If false, the resulting layer will return the same features as the input analysis layer with requested summary information.
- sum_shapeOptional bool
A boolean value that instructs the task to calculate count of points, length of lines or areas of polygons of the summaryLayer within each polygon in sumWithinLayer.
- shape_unitsOptional string
Specify units to summarize the length or areas when sumShape is set to true. Units is not required to summarize points.
- summary_fieldsOptional list of strings
A list of field names and statistical summary type that you wish to calculate for all features in the summaryLayer that are within each polygon in the sumWithinLayer . Eg: [“fieldname1 summary”, “fieldname2 summary”]
- group_by_fieldOptional string
Specify a field from the summaryLayer features to calculate statistics separately for each unique value of the field.
- minority_majorityOptional bool
This boolean parameter is applicable only when a groupByField is specified. If true, the minority (least dominant) or the majority (most dominant) attribute values within each group, within each boundary will be calculated.
- percent_shapeOptional bool
This boolean parameter is applicable only when a groupByField is specified. If set to true, the percentage of shape (eg. length for lines) for each unique groupByField value is calculated.
- output_nameOptional string
Additional properties such as output feature service name.
- contextOptional string
Additional settings such as processing extent and output spatial reference.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
- dict with the following keys:
“result_layer” : layer (FeatureCollection) “group_by_summary” : layer (FeatureCollection)
-
arcgis.
summarize_within
(sum_within_layer, summary_layer, sum_shape=True, shape_units=None, summary_fields=[], group_by_field=None, minority_majority=False, percent_shape=False, output_name=None, context=None, gis=None)¶ The SummarizeWithin task helps you to summarize and find statistics on the point, line, or polygon features (or portions of these features) that are within the boundaries of polygons in another layer. For example:Given a layer of watershed boundaries and a layer of land-use boundaries by land-use type, calculate total acreage of land-use type for each watershed.Given a layer of parcels in a county and a layer of city boundaries, summarize the average value of vacant parcels within each city boundary.Given a layer of counties and a layer of roads, summarize the total mileage of roads by road type within each county.
- sum_within_layerRequired layer (see Feature Input in documentation)
A polygon feature layer or featurecollection. Features, or portions of features, in the summaryLayer (below) that fall within the boundaries of these polygons will be summarized.
- summary_layerRequired layer (see Feature Input in documentation)
Point, line, or polygon features that will be summarized for each polygon in the sumWithinLayer.
- sum_shapeOptional bool
A boolean value that instructs the task to calculate count of points, length of lines or areas of polygons of the summaryLayer within each polygon in sumWithinLayer.
- shape_unitsOptional string
Specify units to summarize the length or areas when sumShape is set to true. Units is not required to summarize points.
- summary_fieldsOptional list of strings
A list of field names and statistical summary type that you wish to calculate for all features in the summaryLayer that are within each polygon in the sumWithinLayer. Eg:[“fieldname1 summary”, “fieldname2 summary”]
- group_by_fieldOptional string
Specify a field from the summaryLayer features to calculate statistics separately for each unique attribute value.
- minority_majorityOptional bool
This boolean parameter is applicable only when a groupByField is specified. If true, the minority (least dominant) or the majority (most dominant) attribute values within each group, within each boundary will be calculated.
- percent_shapeOptional bool
This boolean parameter is applicable only when a groupByField is specified. If set to true, the percentage of shape (eg. length for lines) for each unique groupByField value is calculated.
- output_nameOptional string
Additional properties such as output feature service name.
- contextOptional string
Additional settings such as processing extent and output spatial reference.
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
- dict with the following keys:
“result_layer” : layer (FeatureCollection) “group_by_summary” : layer (FeatureCollection)
-
arcgis.
trace_downstream
(input_layer, split_distance=None, split_units='Kilometers', max_distance=None, max_distance_units='Kilometers', bounding_polygon_layer=None, source_database=None, generalize=True, output_name=None, context=None, gis=None)¶ Determine the flow paths in a downstream direction from the locations you specify.
input_layer : Required layer (see Feature Input in documentation)
split_distance : Optional float
split_units : Optional string
max_distance : Optional float
max_distance_units : Optional string
bounding_polygon_layer : Optional layer (see Feature Input in documentation)
source_database : Optional string
generalize : Optional bool
output_name : Optional string
context : Optional string
- gis :
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
trace_layer : layer (FeatureCollection)