# arcgis.raster.analytics module¶

Functions for calling the Raster Analysis Tools. The RasterAnalysisTools service is used by ArcGIS Server to provide distributed raster analysis.

## get_datastores¶

arcgis.raster.analytics.get_datastores(gis=None)

Returns a helper object to manage raster analytics datastores in the GIS. If a gis isn’t specified, returns datastore manager of arcgis.env.active_gis

## is_supported¶

arcgis.raster.analytics.is_supported(gis=None)

Returns True if the GIS supports raster analytics. If a gis isn’t specified, checks if arcgis.env.active_gis supports raster analytics

## generate_raster¶

arcgis.raster.analytics.generate_raster(raster_function, function_arguments=None, output_raster_properties=None, output_name=None, process_as_multidimensional=None, build_transpose=None, context=None, *, gis=None, future=False, **kwargs)

Function allows you to execute raster analysis on a distributed server deployment.

Returns

output_raster : Imagery layer item

## interpolate_points¶

arcgis.raster.analytics.interpolate_points(input_point_features, interpolate_field, optimize_for='BALANCE', transform_data=False, size_of_local_models=None, number_of_neighbors=None, output_cell_size=None, output_prediction_error=False, output_name=None, context=None, *, gis=None, future=False, **kwargs)

This tool allows you to predict values at new locations based on measurements from a collection of points. The tool takes point data with values at each point and returns a raster of predicted values:

• An air quality management district has sensors that measure pollution levels. Interpolate Points can be used to predict pollution levels at locations that don’t have sensors, such as locations with at-risk populations- schools or hospitals, for example.

• Predict heavy metal concentrations in crops based on samples taken from individual plants.

• Predict soil nutrient levels (nitrogen, phosphorus, potassium, and so on) and other indicators (such as electrical conductivity) in order to study their relationships to crop yield and prescribe precise amounts of fertilizer for each location in the field.

• Meteorological applications include prediction of temperatures, rainfall, and associated variables (such as acid rain).

Returns

named tuple with name values being :

• output_raster (the output_raster item description is updated with the process_info)

• process_info (if run in a non-Jupyter environment, use process_info.data to get the HTML data)

• output_error_raster (if output_prediction_error is set to True).

## create_viewshed¶

analytics.create_viewshed(input_observer_features, optimize_for=None, maximum_viewing_distance=None, maximum_viewing_distance_field=None, minimum_viewing_distance=None, minimum_viewing_distance_field=None, viewing_distance_is_3d=None, observers_elevation=None, observers_elevation_field=None, observers_height=None, observers_height_field=None, target_height=None, target_height_field=None, above_ground_level_output_name=None, output_name=None, context=None, *, gis=None, future=False, **kwargs)

Function allows you to execute raster analysis on a distributed server deployment.

Returns

named tuple with name values being:

• output_raster

• output_above_ground_level_raster (generated if value specified for above_ground_level_output_name)

## summarize_raster_within¶

analytics.summarize_raster_within(input_raster_layer_to_summarize, zone_field='Value', statistic_type='Mean', ignore_missing_values=True, output_name=None, context=None, *, gis=None, future=False, **kwargs)

Summarizes a raster based on areas (zones) defined by the first input layer (input_zone_layer).

Returns

output_raster : Imagery layer item

## calculate_density¶

analytics.calculate_density(count_field=None, search_distance=None, output_area_units=None, output_cell_size=None, output_name=None, context=None, *, gis=None, future=False, **kwargs)

Density analysis takes known quantities of some phenomenon and creates a density map by spreading these quantities across the map. You can use this function, for example, to show concentrations of lightning strikes or tornadoes, access to health care facilities, and population densities.

This 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.

For point input, each point should represent the location of some event or incident, and the result layer represents a count of the incident per unit area. A larger density value in a new location means that there are more points near that location. In many cases, the result layer can be interpreted as a risk surface for future events. For example, if the input points represent locations of lightning strikes, the result layer can be interpreted as a risk surface for future lightning strikes.

For line input, the line density surface represents the total amount of line that is near each location. The units of the calculated density values are the length of line-per-unit area. For example, if the lines represent rivers, the result layer will represent the total length of rivers that are within the search radius. This result can be used to identify areas that are hospitable to grazing animals.

Other use cases of this tool include the following:

• Creating crime density maps to help police departments properly allocate resources to high crime areas.

• Calculating densities of hospitals within a county. The result layer will show areas with high and low accessibility to hospitals, and this information can be used to decide where new hospitals should be built.

• Identifying areas that are at high risk of forest fires based on historical locations of forest fires.

• Locating communities that are far from major highways in order to plan where new roads should be constructed.

Returns

output_raster : Imagery layer item

## classify¶

analytics.classify(input_classifier_definition, additional_input_raster=None, output_name=None, context=None, *, gis=None, future=False, **kwargs)

The Classify function will create categories of pixels based on the input raster and the classifier definition dictionary that was generated from the train_classifier function.

 Argument Description input_raster Required ImageryLayer object. input_classifier_definition Required dict. The classifier definition dictionary generated from the train_classifier function. Example:{“EsriClassifierDefinitionFile”:0, “FileVersion”:3,”NumberDefinitions”:1, “Definitions”:[…]} additional_input_raster Optional ImageryLayer object. This can be a segmented raster. output_name Optional String. If specified, an Imagery Layer of given name is created. Else, an Image Service is created by the method and used as the output raster. You can pass in an existing Image Service Item from your GIS to use that instead. Alternatively, you can pass in the name of the output Image Service that should be created by this method to be used as the output for the tool. A RuntimeError is raised if a service by that name already exists context context contains additional settings that affect task execution. context parameter overwrites values set through arcgis.env parameter This function has the following settings: Extent (extent): A bounding box that defines the analysis area. Example:{“extent”: {“xmin”: -122.68, “ymin”: 45.53, “xmax”: -122.45, “ymax”: 45.6, “spatialReference”: {“wkid”: 4326}}} Output Spatial Reference (outSR): The output raster will be projected into the output spatial reference. Example:{“outSR”: {spatial reference}} Snap Raster (snapRaster): The output raster will have its cells aligned with the specified snap raster. Example:{‘snapRaster’: {‘url’: ‘’}} Cell Size (cellSize): The output raster will have the resolution specified by cell size. Example:{‘cellSize’: {‘x’: 11}} or {‘cellSize’: {‘url’: }} or {‘cellSize’: ‘MaxOfIn’} Parallel Processing Factor (parallelProcessingFactor): controls Raster Processing (CPU) service instances. Example:Syntax example with a specified number of processing instances: {“parallelProcessingFactor”: “2”} Syntax example with a specified percentage of total processing instances: {“parallelProcessingFactor”: “60%”} Resampling Method (resamplingMethod): The output raster will be resampled to method specified. The supported values are: Bilinear, Nearest, Cubic. Example:{‘resamplingMethod’: “Nearest”} gis Keyword only parameter. Optional GIS object. If not speficied, the currently active connection is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously. folder Keyword only parameter. Optional str or dict. Creates a folder in the portal, if it does not exist, with the given folder name and persists the output in this folder. The dictionary returned by the gis.content.create_folder() can also be passed in as input. Example:{‘username’: ‘user1’, ‘id’: ‘6a3b77c187514ef7873ba73338cf1af8’, ‘title’: ‘trial’}
Returns

output_raster : Imagery Layer item

## segment¶

analytics.segment(spectral_detail=15.5, spatial_detail=15, minimum_segment_size_in_pixels=20, band_indexes=[0, 1, 2], remove_tiling_artifacts=False, output_name=None, context=None, *, gis=None, future=False, **kwargs)

Groups together adjacent pixels having similar spectral and spatial characteristics into segments, known as objects.

Returns

output_raster : Imagery Layer item

## train_classifier¶

analytics.train_classifier(input_training_sample_json, classifier_parameters, segmented_raster=None, segment_attributes='COLOR;MEAN', *, gis=None, future=False, **kwargs)

The Train Classifier task is a service to train image classifiers and return an .ecs file in dictionary format. The .ecs file is used in the classify function.

 Argument Description input_raster Required ImageryLayer object input_training_sample_json Optional JSON. This is the dictionary representation of the training samples. To convert feature layer to JSON, perform: query_result = .query() input_training_sample_json = query_result.to_json Set input_training_sample_json to None, for iso method. classifier_parameters Required dict. The classifier algorithm and parameters used in the supervised training. Random trees example: {“method”:”rt”, “params”: { “maxNumTrees”:50, “maxTreeDepth”:30, “maxSampleClass”:1000 } } Support Vector machine example {“method”:”svm”, “params”:{“maxSampleClass”:1000} } Maximum likelihood example{“method”:”mlc”} ISO example{“method”:”iso”, “params”: { “maxNumClasses”: 20, “maxIteration”: 20, “minNumSamples”: 20, “skipFactor”: 10, “maxNumMerge”: 5, “maxMergeDist”: 0.5 }} segmented_raster Required ImageryLayer object segment_attributes Optional string. The string of segment attributes used in the training (separated by semicolon). It is the permutation of the following attributes: COLOR; MEAN; STD; COUNT; COMPACTNESS; RECTANGULARITY. Example:“COLOR; MEAN” gis Keyword only parameter. Optional GIS object. If not speficied, the currently active connection is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously.
Returns

output_raster : Imagery Layer item

## convert_feature_to_raster¶

analytics.convert_feature_to_raster(output_cell_size, value_field=None, output_name=None, context=None, *, gis=None, future=False, **kwargs)

Creates a new ImageryLayer from an existing feature layer. Any feature layer containing point, line, or polygon features can be converted to an ImageryLayer.

The cell center is used to decide the value of the output raster pixel. The input field type determines the type of output raster. If the field is integer, the output raster will be integer; if it is floating point, the output will be floating point.

 Argument Description input_feature Required feature layer. The input feature layer to convert to a raster dataset. output_cell_size Required dict. The cell size and unit for the output imagery layer. The available units are Feet, Miles, Meters, and Kilometers. Example{“distance”:60,”units”:meters} value_field Optional string. The field that will be used to assign values to the output raster. output_name Optional. If not provided, an Image Service is created by the method and used as the output raster. You can pass in an existing Image Service Item from your GIS to use that instead. Alternatively, you can pass in the name of the output Image Service that should be created by this method to be used as the output for the tool. A RuntimeError is raised if a service by that name already exists context context contains additional settings that affect task execution. context parameter overwrites values set through arcgis.env parameter This function has the following settings: Extent (extent): A bounding box that defines the analysis area. Example:{“extent”: {“xmin”: -122.68, “ymin”: 45.53, “xmax”: -122.45, “ymax”: 45.6, “spatialReference”: {“wkid”: 4326}}} Output Spatial Reference (outSR): The output raster will be projected into the output spatial reference. Example:{“outSR”: {spatial reference}} Snap Raster (snapRaster): The output raster will have its cells aligned with the specified snap raster. Example:{‘snapRaster’: {‘url’: ‘’}} Mask (mask): Only cells that fall within the analysis mask will be considered in the operation. Example:{“mask”: {“url”: “”}} Parallel Processing Factor (parallelProcessingFactor): controls Raster Processing (CPU) service instances. Example:Syntax example with a specified number of processing instances: {“parallelProcessingFactor”: “2”} Syntax example with a specified percentage of total processing instances: {“parallelProcessingFactor”: “60%”} gis Optional GIS object. If not speficied, the currently active connection is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously. folder Keyword only parameter. Optional str or dict. Creates a folder in the portal, if it does not exist, with the given folder name and persists the output in this folder. The dictionary returned by the gis.content.create_folder() can also be passed in as input. Example:{‘username’: ‘user1’, ‘id’: ‘6a3b77c187514ef7873ba73338cf1af8’, ‘title’: ‘trial’}
Returns

output_raster : Imagery layer item

## convert_raster_to_feature¶

analytics.convert_raster_to_feature(field='Value', output_type='Polygon', simplify=True, output_name=None, context=None, create_multipart_features=False, max_vertices_per_feature=None, *, gis=None, future=False, **kwargs)

Function converts imagery data to feature class vector data.

 Argument Description input_raster Required Imagery Layer. The input raster that will be converted to a feature dataset. field Optional string - field that specifies which value will be used for the conversion. It can be any integer or a string field. A field containing floating-point values can only be used if the output is to a point dataset. Default is “Value” output_type Optional string. One of the following: [‘Point’, ‘Line’, ‘Polygon’] simplify Optional bool, This option that specifies how the features should be smoothed. It is only available for line and polygon output. True, then the features will be smoothed out. This is the default. if False, then The features will follow exactly the cell boundaries of the raster dataset. output_name Optional. If not provided, a Feature layer is created by the method and used as the output. You can pass in an existing Feature Service Item from your GIS to use that instead. Alternatively, you can pass in the name of the output Feature Service that should be created by this method to be used as the output for the tool. A RuntimeError is raised if a service by that name already exists context context contains additional settings that affect task execution. context parameter overwrites values set through arcgis.env parameter This function has the following settings: Extent (extent): A bounding box that defines the analysis area. Example:{“extent”: {“xmin”: -122.68, “ymin”: 45.53, “xmax”: -122.45, “ymax”: 45.6, “spatialReference”: {“wkid”: 4326}}} Output Spatial Reference (outSR): The output raster will be projected into the output spatial reference. Example:{“outSR”: {spatial reference}} create_multipart_features Optional boolean. Specifies whether the output polygons will consist of single-part or multipart features. True: Specifies that multipart features will be created based on polygons that have the same value. False: Specifies that individual features will be created for each polygon. This is the default. max_vertices_per_feature Optional int. The vertex limit used to subdivide a polygon into smaller polygons. gis Optional GIS object. If not speficied, the currently active connection is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously. folder Keyword only parameter. Optional str or dict. Creates a folder in the portal, if it does not exist, with the given folder name and persists the output in this folder. The dictionary returned by the gis.content.create_folder() can also be passed in as input. Example:{‘username’: ‘user1’, ‘id’: ‘6a3b77c187514ef7873ba73338cf1af8’, ‘title’: ‘trial’}
Returns

output_raster : Imagery layer item

## copy_raster¶

analytics.copy_raster(output_cellsize=None, resampling_method='NEAREST', clip_setting=None, output_name=None, process_as_multidimensional=None, build_transpose=None, context=None, *, gis=None, future=False, **kwargs)

The Copy Raster task takes single raster input and generates the output image using parallel processing.

The input raster can be clipped, resampled, and reprojected based on the setting.

 Argument Description input_raster Required feature layer. The input feature layer to convert to a raster dataset. output_cellsize Required dict. The cell size and unit for the output imagery layer. The available units are Feet, Miles, Meters, and Kilometers. eg - {“distance”:60,”units”:meters} resampling_method Optional string. The field that will be used to assign values to the output raster. clip_setting Optional string. The field that will be used to assign values to the output raster. output_name Optional. If not provided, an Image Service is created by the method and used as the output raster. You can pass in an existing Image Service Item from your GIS to use that instead. Alternatively, you can pass in the name of the output Image Service that should be created by this method to be used as the output for the tool. A RuntimeError is raised if a service by that name already exists process_as_multidimensional Optional bool, Process as multidimensional if set to True, if the input is multidimensional raster. build_transpose Optional bool, if set to true, transforms the output multidimensional raster. Valid only if process_as_multidimensional is set to True. context context contains additional settings that affect task execution. context parameter overwrites values set through arcgis.env parameter This function has the following settings: Output Spatial Reference (outSR): The output raster will be projected into the output spatial reference. Example:{“outSR”: {spatial reference}} gis Optional GIS object. If not speficied, the currently active connection is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously. folder Keyword only parameter. Optional str or dict. Creates a folder in the portal, if it does not exist, with the given folder name and persists the output in this folder. The dictionary returned by the gis.content.create_folder() can also be passed in as input. Example:{‘username’: ‘user1’, ‘id’: ‘6a3b77c187514ef7873ba73338cf1af8’, ‘title’: ‘trial’}
Returns

output_raster : Imagery layer item

## create_image_collection¶

analytics.create_image_collection(input_rasters, raster_type_name, raster_type_params=None, out_sr=None, context=None, *, gis=None, future=False, **kwargs)

Create a collection of images that will participate in the ortho-mapping project. Provides provision to use input rasters by reference and to specify image collection properties through context parameter.

 Argument Description image_collection Required, the name of the image collection to create. The image collection can be an existing image service, in which the function will create a mosaic dataset and the existing hosted image service will then point to the new mosaic dataset. If the image collection does not exist, a new multi-tenant service will be created. This parameter can be the Item representing an existing image_collection or it can be a string representing the name of the image_collection (either existing or to be created.) input_rasters Required, the list of input rasters to be added to the image collection being created. This parameter can be any one of the following: - List of portal Items of the images - An image service URL - Shared data path (this path must be accessible by the server) - Name of a folder on the portal raster_type_name Required string. The name of the raster type to use for adding data to the image collection. Choice list: [‘UAV/UAS’, ‘Aerial’, ‘ScannedAerial’, ‘Landsat 7 EMT+’, ‘Landsat 8’, ‘Sentinel-2’, ‘ZY3-SASMAC’, ‘ZY3-CRESDA’] raster_type_params Optional dict. Additional raster_type specific parameters. The process of add rasters to the image collection can be controlled by specifying additional raster type arguments. The raster type parameters argument is a dictionary. out_sr Optional integer. Additional parameters of the service. The following additional parameters can be specified: - Spatial reference of the image_collection; The well-known ID of the spatial reference or a spatial reference dictionary object for the input geometries. If the raster type name is set to “UAV/UAS”, the spatial reference of the output image collection will be determined by the raster type parameters defined. context Optional dict. The context parameter is used to provide additional input parameters. Syntax: {“image_collection_properties”: {“imageCollectionType”:”Satellite”},”byref”:True} use image_collection_properties key to set value for imageCollectionType. Note The “imageCollectionType” property is important for image collection that will later on be adjusted by orthomapping system service. Based on the image collection type, the orthomapping system service will choose different algorithm for adjustment. Therefore, if the image collection is created by reference, the requester should set this property based on the type of images in the image collection using the following keywords. If the imageCollectionType is not set, it defaults to “UAV/UAS” If byref is set to ‘True’, the data will not be uploaded. If it is not set, the default is ‘False’ gis Keyword only parameter. Optional GIS. The GIS on which this tool runs. If not specified, the active GIS is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously. folder Keyword only parameter. Optional str or dict. Creates a folder in the portal, if it does not exist, with the given folder name and persists the output in this folder. The dictionary returned by the gis.content.create_folder() can also be passed in as input. Example:{‘username’: ‘user1’, ‘id’: ‘6a3b77c187514ef7873ba73338cf1af8’, ‘title’: ‘trial’}
Returns

The imagery layer item

# Usage Example: To create an image collection.
image_item_list = [<Item title:"YUN_0040.JPG" type:Image owner:admin>,

params = {"gps": [['YUN_0040.JPG', 34.0069887, -117.09279029999999],
['YUN_0041.JPG', 34.0070131, -117.09311519972222],
['YUN_0042.JPG', 34.0070381, -117.09346329972222],
['YUN_0043.JPG', 34.00706339972222, -117.09381479999999],
['YUN_0044.JPG', 34.0070879, -117.09416449999999],
"cameraProperties":{"maker":"Yuneec","model":"E90","focallength":8,"columns":5472,"rows":3648,"pixelsize":0.0024},
"isAltitudeFlightHeight":"false",
"averagezdem": {"url": "https://rais.dev.geocloud.com/arcgis/rest/services/Hosted/WorldSRTM90m/ImageServer"}}

img_coll_result = create_image_collection(image_collection="imageCollection",
input_rasters=image_item_list,
raster_type_name="UAV/UAS",
raster_type_params=params,
out_sr=32632)


analytics.add_image(input_rasters, raster_type_name=None, raster_type_params=None, context=None, *, gis=None, future=False, **kwargs)

Add a collection of images to an existing image collection. It provides provision to use input rasters by reference and to specify image collection properties through context parameter.

It can be used when new data is available to be included in the same orthomapping project. When new data is added to the image collection the entire image collection must be reset to the original state.

 Argument Description input_rasters Required list. The list of input rasters to be added to the image collection being created. This parameter can be any one of the following types: List of portal Items of the images An image service URL Shared data path (this path must be accessible by the server) Name of a folder on the portal image_collection Required item. The item representing the image collection to add input_rasters to. The image collection must be an existing image collection. This is the output image collection (mosaic dataset) item or url or uri. raster_type_name Required string. The name of the raster type to use for adding data to the image collection. Choice list: [‘UAV/UAS’, ‘Aerial’, ‘ScannedAerial’, ‘Landsat 7 EMT+’, ‘Landsat 8’, ‘Sentinel-2’, ‘ZY3-SASMAC’, ‘ZY3-CRESDA’] raster_type_params Optional dict. Additional raster type specific parameters. The process of add rasters to the image collection can be controlled by specifying additional raster type arguments. Syntax: {“gps”: [[“image1.jpg”, “10”, “2”, “300”], [“image2.jpg”, “10”, “3”, “300”], [“image3.jpg”, “10”, “4”, “300”]], “cameraProperties”: {“Maker”: “Canon”, “Model”: “5D Mark II”, “FocalLength”: 20, “PixelSize”: 10, “x0”: 0, “y0”: 0, “columns”: 4000, “rows”: 3000}, “constantZ”: 300,”isAltitudeFlightHeight”: “True”,”dem”: {“url”: “https://…”} context Optional dict. The context parameter is used to provide additional input parameters. Syntax: {“image_collection_properties”: {“imageCollectionType”:”Satellite”},”byref”:’True’} Use image_collection_properties key to set value for imageCollectionType. Note The “imageCollectionType” property is important for image collection that will later on be adjusted by orthomapping system service. Based on the image collection type, the orthomapping system service will choose different algorithm for adjustment. Therefore, if the image collection is created by reference, the requester should set this property based on the type of images in the image collection using the following keywords. If the imageCollectionType is not set, it defaults to “UAV/UAS” If byref is set to ‘True’, the data will not be uploaded. If it is not set, the default is ‘False’ gis Keyword only parameter. Optional GIS. The GIS on which this tool runs. If not specified, the active GIS is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously.
Returns

The imagery layer item

# Usage Example: To add an image to an existing image collection.

params = {"gps":[["YUN_0040.JPG",34.006989,-117.09279,725.13]],
"cameraProperties":{"maker":"Yuneec","model":"E90","focallength":8,"columns":5472,"rows":3648,"pixelsize":0.0024},
"isAltitudeFlightHeight":"false",
"averagezdem": {"url": "https://rais.dev.geocloud.com/arcgis/rest/services/Hosted/WorldSRTM90m/ImageServer"}}



## delete_image¶

analytics.delete_image(where, *, gis=None, future=False, **kwargs)

delete_image allows users to remove existing images from the image collection (mosaic dataset). The function will only delete the raster item in the mosaic dataset and will not remove the source image.

 Argument Description image_collection Required, the input image collection from which to delete images This can be the ‘itemID’ of an exisiting portal item or a url to an Image Service or a uri where Required string. A SQL where clause for selecting the images to be deleted from the image collection gis Keyword only parameter. Optional GIS. The GIS on which this tool runs. If not specified, the active GIS is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously.
Returns

The imagery layer url

# Usage Example: To delete an existing image from the image collection.

del_img = delete_image(image_collection=img_coll_item, where="OBJECTID=10")


## delete_image_collection¶

analytics.delete_image_collection(*, gis=None, future=False, **kwargs)

Delete the image collection. This service tool will delete the image collection image service, that is, the portal-hosted image layer item. It will not delete the source images that the image collection references.

 Argument Description image_collection Required, the input image collection to delete. The image_collection can be a portal Item or an image service URL or a URI. The image_collection must exist. gis Keyword only parameter. Optional GIS. The GIS on which this tool runs. If not specified, the active GIS is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously.
Returns

Boolean value indicating whether the deletion was successful or not.

# Usage Example: To delete an existing image collection.

delete_flag = delete_image_collection(image_collection=image_collection_item)


## list_datastore_content¶

analytics.list_datastore_content(filter=None, *, gis=None, future=False, **kwargs)

List the contents of the datastore registered with the server (fileShares, cloudStores, rasterStores).

 Argument Description datastore Required string or list. fileshare, rasterstore or cloudstore datastore from which the contents are to be listed. It can be a string specifying the datastore path eg “/fileShares/SensorData”, “/cloudStores/testcloud”, “/rasterStores/rasterstore” or it can be a Datastore object containing a fileshare, rasterstore or a cloudstore path. eg: ds=analytics.get_datastores() ds_items =ds.search() ds_items[1] ds_items[1] may be specified as input for datastore It can also be a list of datastore paths or list of datastore object containing a fileshare, rasterstore or cloudstore path. In order to list the datastore items, one can specify just the name of the datastore eg: fileShares or eg: cloudStore,rasterStore filter Optional. To filter out the raster contents to be displayed gis Keyword only parameter. Optional GIS. The GIS on which this tool runs. If not specified, the active GIS is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously.
Returns

List of contents in the datastore

## build_footprints¶

analytics.build_footprints(computation_method='RADIOMETRY', value_range=None, context=None, *, gis=None, future=False, **kwargs)

Computes the extent of every raster in an image collection.

 Argument Description image_collection Required. The input image collection.The image_collection can be a portal Item or an image service URL or a URI. The image_collection must exist. computation_method Optional string. Refine the footprints using one of the following methods: RADIOMETRY, GEOMETRY Default: RADIOMETRY value_range Optional. Parameter to specify the value range. context context contains additional settings that affect task execution. context parameter overwrites values set through arcgis.env parameter This function has the following settings: Parallel Processing Factor (parallelProcessingFactor): controls Raster Processing (CPU) service instances. Example:Syntax example with a specified number of processing instances: {“parallelProcessingFactor”: “2”} Syntax example with a specified percentage of total processing instances: {“parallelProcessingFactor”: “60%”} gis Optional GIS object. If not speficied, the currently active connection is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously.
Returns

The imagery layer url

## build_overview¶

analytics.build_overview(cell_size=None, context=None, *, gis=None, future=False, **kwargs)

Generates overviews on an image collection.

 Argument Description image_collection Required. The input image collection.The image_collection can be a portal Item or an image service URL or a URI. The image_collection must exist. cell_size optional float or int, to set the cell size for overview. context context contains additional settings that affect task execution. context parameter overwrites values set through arcgis.env parameter This function has the following settings: Parallel Processing Factor (parallelProcessingFactor): controls Raster Processing (CPU) service instances. Example:Syntax example with a specified number of processing instances: {“parallelProcessingFactor”: “2”} Syntax example with a specified percentage of total processing instances: {“parallelProcessingFactor”: “60%”} gis Optional GIS object. If not speficied, the currently active connection is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously.
Returns

The imagery layer url

## calculate_statistics¶

analytics.calculate_statistics(skip_factors=None, context=None, *, gis=None, future=False, **kwargs)

Calculates statistics for an image collection

 Argument Description image_collection Required. The input image collection.The image_collection can be a portal Item or an image service URL or a URI. The image_collection must exist. skip_factors optional dictionary, Controls the portion of the raster that is used when calculating the statistics. eg: {“x”:5,”y”:5} x value represents - the number of horizontal pixels between samples y value represents - the number of vertical pixels between samples. context context contains additional settings that affect task execution. context parameter overwrites values set through arcgis.env parameter This function has the following settings: Parallel Processing Factor (parallelProcessingFactor): controls Raster Processing (CPU) service instances. Example:Syntax example with a specified number of processing instances: {“parallelProcessingFactor”: “2”} Syntax example with a specified percentage of total processing instances: {“parallelProcessingFactor”: “60%”} Function also supports following keys through context: ignoreValues, skipExisting, areaOfInterest gis Optional GIS object. If not speficied, the currently active connection is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously.
Returns

The imagery layer url

## optimum_travel_cost_network¶

analytics.optimum_travel_cost_network(input_cost_raster, output_optimum_network_name=None, output_neighbor_network_name=None, context=None, *, gis=None, future=False, **kwargs)

Calculates the optimum cost network from a set of input regions.

 Argument Description input_regions_raster Required Imagery Layer object. The layer that defines the regions to find the optimum travel cost netork for. The layer can be raster or feature. input_cost_raster Required Imagery Layer object. A raster defining the impedance or cost to move planimetrically through each cell. output_optimum_network_name Optional. If not provided, a feature layer is created by the method and used as the output. You can pass in an existing feature layer Item from your GIS to use that instead. Alternatively, you can pass in the name of the output feature layer that should be created by this method to be used as the output for the tool. A RuntimeError is raised if a service by that name already exists output_neighbor_network_name Optional. This is the name of the output neighbour network feature layer that will be created. context context contains additional settings that affect task execution. context parameter overwrites values set through arcgis.env parameter This function has the following settings: Extent (extent): A bounding box that defines the analysis area. Example:{“extent”: {“xmin”: -122.68, “ymin”: 45.53, “xmax”: -122.45, “ymax”: 45.6, “spatialReference”: {“wkid”: 4326}}} Output Spatial Reference (outSR): The output raster will be projected into the output spatial reference. Example:{“outSR”: {spatial reference}} Parallel Processing Factor (parallelProcessingFactor): controls Raster Processing (CPU) service instances. Example:Syntax example with a specified number of processing instances: {“parallelProcessingFactor”: “2”} Syntax example with a specified percentage of total processing instances: {“parallelProcessingFactor”: “60%”} gis Optional GIS object. If not speficied, the currently active connection is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously. folder Keyword only parameter. Optional str or dict. Creates a folder in the portal, if it does not exist, with the given folder name and persists the output in this folder. The dictionary returned by the gis.content.create_folder() can also be passed in as input. Example:{‘username’: ‘user1’, ‘id’: ‘6a3b77c187514ef7873ba73338cf1af8’, ‘title’: ‘trial’}
Returns

output_raster : Imagery layer item

## determine_travel_costpath_as_polyline¶

analytics.determine_travel_costpath_as_polyline(input_cost_raster, input_destination_data, path_type='BEST_SINGLE', output_polyline_name=None, destination_field=None, context=None, *, gis=None, future=False, **kwargs)

Calculates the least cost polyline path between sources and known destinations.

 Argument Description input_source_data The layer that identifies the cells to determine the least costly path from. This parameter can have either a raster input or a feature input. input_cost_raster A raster defining the impedance or cost to move planimetrically through each cell. The value at each cell location represents the cost-per-unit distance for moving through the cell. Each cell location value is multiplied by the cell resolution while also compensating for diagonal movement to obtain the total cost of passing through the cell. The values of the cost raster can be an integer or a floating point, but they cannot be negative or zero as you cannot have a negative or zero cost. input_destination_data The layer that defines the destinations used to calculate the distance. This parameter can have either a raster input or a feature input. path_type A keyword defining the manner in which the values and zones on the input destination data will be interpreted in the cost path calculations. A string describing the path type, which can either be BEST_SINGLE, EACH_CELL, or EACH_ZONE. BEST_SINGLE: For all cells on the input destination data, the least-cost path is derived from the cell with the minimum of the least-cost paths to source cells. This is the default. EACH_CELL: For each cell with valid values on the input destination data, at least-cost path is determined and saved on the output raster. With this option, each cell of the input destination data is treated separately, and a least-cost path is determined for each from cell. EACH_ZONE: For each zone on the input destination data, a least-cost path is determined and saved on the output raster. With this option, the least-cost path for each zone begins at the cell with the lowest cost distance weighting in the zone. output_polyline_name Optional. If not provided, a feature layer is created by the method and used as the output. You can pass in an existing feature layer Item from your GIS to use that instead. Alternatively, you can pass in the name of the output feature layer that should be created by this method to be used as the output for the tool. A RuntimeError is raised if a service by that name already exists destination_field The field used to obtain values for the destination locations. context Context contains additional settings that affect task execution. gis Keyword only parameter. Optional GIS. the GIS on which this tool runs. If not specified, the active GIS is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously. folder Keyword only parameter. Optional str or dict. Creates a folder in the portal, if it does not exist, with the given folder name and persists the output in this folder. The dictionary returned by the gis.content.create_folder() can also be passed in as input. Example:{‘username’: ‘user1’, ‘id’: ‘6a3b77c187514ef7873ba73338cf1af8’, ‘title’: ‘trial’}
Returns

The imagery layer url

## generate_multidimensional_anomaly¶

analytics.generate_multidimensional_anomaly(variables=None, method='DIFFERENCE_FROM_MEAN', calculation_interval=None, ignore_nodata=True, output_name=None, context=None, *, gis=None, future=False, **kwargs)

Computes the anomaly for each slice in a multidimensional raster to generate a multidimensional dataset. An anomaly is the deviation of an observation from its standard or mean value. Function available in ArcGIS Image Server 10.8 and higher.

 Argument Description input_multidimensional_raster The input imagery layer object. variables Optional List. The variable or variables for which anomalies will be calculated. If no variable is specified, all variables with a time dimension will be analyzed. method Optional String. Specifies the method that will be used to calculate the anomaly. DIFFERENCE_FROM_MEAN : The difference between a pixel value and the mean of that pixel’s values across slices defined by the interval will be calculated. This is the default. PERCENT_DIFFERENCE_FROM_MEAN : The percent difference between a pixel value and the mean of that pixel’s values across slices defined by the interval will be calculated. PERCENT_OF_MEAN : The percent of the mean will be calculated. Z_SCORE : The z-score for each pixel will be calculated. A z-score of 0 indicates the pixel’s value is identical to the mean. A z-score of 1 indicates the pixel’s value is 1 standard deviation from the mean. If a z-score is 2, the pixel’s value is 2 standard deviations from the mean, and so on. DIFFERENCE_FROM_MEDIAN : The difference between a pixel value and the median of that pixel’s values across slices defined by the interval will be calculated PERCENT_DIFFERENCE_FROM_MEDIAN : The percent difference between a pixel value and the median of that pixel’s values across slices defined by the interval will be calculated. PERCENT_OF_MEDIAN : The percent of the median will be calculated. calculation_interval Optional String. Specifies the temporal interval that will be used to calculate the mean. ALL : Calculates the mean across all slices for each pixel. YEARLY : Calculates the yearly mean for each pixel. RECURRING_MONTHLY : Calculates the monthly mean for each pixel. RECURRING_WEEKLY : Calculates the weekly mean for each pixel. RECURRING_DAILY : Calculates the daily mean for each pixel. HOURLY : Calculates the hourly mean for each pixel. ignore_nodata Optional Boolean. Specifies whether NoData values are ignored in the analysis. True : The analysis will include all valid pixels along a given dimension and ignore any NoData pixels. This is the default. False : The analysis will result in NoData if there are any NoData values for the pixel along the given dimension. output_name Optional String. If not provided, an Image Service is created by the method and used as the output raster. You can pass in an existing Image Service Item from your GIS to use that instead. Alternatively, you can pass in the name of the output Image Service that should be created by this method to be used as the output for the tool. A RuntimeError is raised if a service by that name already exists context context contains additional settings that affect task execution. context parameter overwrites values set through arcgis.env parameter This function has the following settings: Extent (extent): A bounding box that defines the analysis area. Example:{“extent”: {“xmin”: -122.68, “ymin”: 45.53, “xmax”: -122.45, “ymax”: 45.6, “spatialReference”: {“wkid”: 4326}}} Output Spatial Reference (outSR): The output raster will be projected into the output spatial reference. Example:{“outSR”: {spatial reference}} Snap Raster (snapRaster): The output raster will have its cells aligned with the specified snap raster. Example:{‘snapRaster’: {‘url’: ‘’}} Cell Size (cellSize): The output raster will have the resolution specified by cell size. Example:{‘cellSize’: {‘x’: 11}} or {‘cellSize’: {‘url’: }} or {‘cellSize’: ‘MaxOfIn’} Parallel Processing Factor (parallelProcessingFactor): controls Raster Processing (CPU) service instances. Example:Syntax example with a specified number of processing instances: {“parallelProcessingFactor”: “2”} Syntax example with a specified percentage of total processing instances: {“parallelProcessingFactor”: “60%”} gis Keyword only parameter. Optional GIS. the GIS on which this tool runs. If not specified, the active GIS is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously. folder Keyword only parameter. Optional str or dict. Creates a folder in the portal, if it does not exist, with the given folder name and persists the output in this folder. The dictionary returned by the gis.content.create_folder() can also be passed in as input. Example:{‘username’: ‘user1’, ‘id’: ‘6a3b77c187514ef7873ba73338cf1af8’, ‘title’: ‘trial’}
# Usage Example 1: This example generates an anomaly multidimensional raster for temperature data, comparing pixel values with the mean
# pixel value across all slices.

generate_anomaly = generate_multidimensional_anomaly(input_multidimensional_raster=multidimensional_lyr_input,
variables=["oceantemp"],
method="PERCENT_DIFFERENCE_FROM_MEAN",
temporal_interval="YEARLY",
output_name="temp_anomaly",
ignore_nodata=True,
gis=gis,
folder="generate_mdim_anomaly")

Returns

output_raster : Imagery Layer Item

## build_multidimensional_transpose¶

analytics.build_multidimensional_transpose(context=None, *, gis=None, future=False, **kwargs)

Transposes a multidimensional raster dataset, which chunks the multidimensional data along each dimension to optimize performance when accessing pixel values across all slices. Function available in ArcGIS Image Server 10.8 and higher.

 Argument Description input_multidimensional_raster Required ImageryLayer object. The input multidimensional raster. Portal Item can be passed. context context contains additional settings that affect task execution. context parameter overwrites values set through arcgis.env parameter Parallel Processing Factor (parallelProcessingFactor): controls Raster Processing (CPU) service instances. Example:Syntax example with a specified number of processing instances: {“parallelProcessingFactor”: “2”} Syntax example with a specified percentage of total processing instances: {“parallelProcessingFactor”: “60%”} gis Keyword only parameter. Optional GIS object. the GIS on which this tool runs. If not specified, the active GIS is used. future Keyword only parameter. Optional Boolean. If True, the result will be a GPJob object and results will be returned asynchronously.
Returns

output_raster : Imagery Layer URL

# Usage Example 1: Build the transpose for a sea surface temperature CRF dataset.

build_mdim_transpose_op = build_multidimensional_transpose(input_multidimensional_raster=multidimensional_lyr_input, gis=gis)


## aggregate_multidimensional_raster¶

analytics.aggregate_multidimensional_raster(dimension=None, variables=None, aggregation_method='MEAN', aggregation_definition='ALL', interval_keyword=None, interval_value=None, interval_unit=None, interval_ranges=None, aggregation_function=None, ignore_nodata=True, output_name=None, context=None, *, gis=None, future=False, **kwargs)

Generates a multidimensional image service by aggregating existing multidimensional raster variables along a dimension. Function available in ArcGIS Image Server 10.8 and higher.

 Argument Description input_multidimensional_raster Required ImageryLayer object. The input multidimensional raster. Portal Item can be passed. dimension Required String. The aggregation dimension. This is the dimension along which the variables will be aggregated. variables Optional List. The variable or variables that will be aggregated along the given dimension. If no variable is specified, all variables with the selected dimension will be aggregated. For example, to aggregate your daily temperature data into monthly average values, specify temperature as the variable to be aggregated. If you do not specify any variables and you have both daily temperature and daily precipitation variables, both variables will be aggregated into monthly averages and the output multidimensional raster will include both variables. aggregation_method Optional String. Specifies the mathematical method that will be used to combine the aggregated slices in an interval. MEAN : Calculates the mean of a pixel’s values across all slices in the interval. This is the default. MAXIMUM : Calculates the maximum value of a pixel across all slices in the interval. MAJORITY : Calculates the value that occurred most frequently for a pixel across all slices in the interval. MINIMUM : Calculates the minimum value of a pixel across all slices in the interval. MINORITY : Calculates the value that occurred least frequently for a pixel across all slices in the interval. MEDIAN : Calculates the median value of a pixel across all slices in the interval. RANGE : Calculates the range of values for a pixel across all slices in the interval. STD : Calculates the standard deviation of a pixel’s values across all slices in the interval. SUM : Calculates the sum of a pixel’s values across all slices in the interval. VARIETY : Calculates the number of unique values of a pixel across all slices in the interval. CUSTOM : Calculates the value of a pixel based on a custom raster function. When the aggregation_method is set to CUSTOM, the aggregation_function parameter becomes available. aggregation_definition Optional String. Specifies the dimension interval for which the data will be aggregated. ALL : The data values will be aggregated across all slices. This is the default. INTERVAL_KEYWORD : The variable data will be aggregated using a commonly known interval. INTERVAL_VALUE : The variable data will be aggregated using a user-specified interval and unit. INTERVAL_RANGES : The variable data will be aggregated between specified pairs of values or dates. interval_keyword Optional String. Specifies the keyword interval that will be used when aggregating along the dimension. This parameter is required when the aggregation_def parameter is set to INTERVAL_KEYWORD, and the aggregation must be across time. HOURLY : The data values will be aggregated into hourly time steps, and the result will include every hour in the time series. DAILY : The data values will be aggregated into daily time steps, and the result will include every day in the time series. WEEKLY : The data values will be aggregated into weekly time steps, and the result will include every week in the time series. DEKADLY : Divides each month into 3 periods of 10 days each (last period might have more or less than 10 days) and each month would output 3 slices. PENTADLY : Divides each month into 6 periods of 5 days each (last period might have more or less than 5 days) and each month would output 6 slices. MONTHLY : The data values will be aggregated into monthly time steps, and the result will include every month in the time series. QUARTERLY : The data values will be aggregated into quarterly time steps, and the result will include every quarter in the time series. YEARLY : The data values will be aggregated into yearly time steps, and the result will include every year in the time series. RECURRING_DAILY : The data values will be aggregated into daily time steps, and the result includes each one aggregated value per day. The output will include, at most, 366 daily time slices RECURRING_WEEKLY : The data values will be aggregated into weekly time steps, and the result will include one aggregated value per week. The output will include, at most, 53 weekly time slices. RECURRING_MONTHLY : The data values will be aggregated into weekly time steps, and the result will include one aggregated value per month. The output will include, at most, 12 monthly time slices. RECURRING_QUARTERLY : The data values will be aggregated into weekly time steps, and the result will include one aggregated value per quarter. The output will include, at most, 4 quarterly time slices. interval_value Optional String. The size of the interval that will be used for the aggregation. This parameter is required when the aggregation_def parameter is set to INTERVAL_VALUE. For example, to aggregate 30 years of monthly temperature data into 5-year increments, enter 5 as the interval_value, and specify interval_unit as YEARS. interval_unit Optional Integer. The unit that will be used for the interval value. This parameter is required when the dimension parameter is set to a time field and the aggregation_def parameter is set to INTERVAL_VALUE. If you are aggregating over anything other than time, this option will not be available and the unit for the interval value will match the variable unit of the input multidimensional raster data. HOURS : The data values will be aggregated into hourly time slices at the interval provided. DAYS : The data values will be aggregated into daily time slices at the interval provided. WEEKS : The data values will be aggregated into weekly time slices at the interval provided. MONTHS : The data values will be aggregated into monthly time slices at the interval provided. YEARS : The data values will be aggregated into yearly time slices at the interval provided. interval_ranges Optional List of dictionary objects. Interval ranges specified as list of dictionary objects that will be used to aggregate groups of values. This parameter is required when the aggregation_definition parameter is set to INTERVAL_RANGE. If dimension is StdTime, then the value must be specified in human readable time format (YYYY-MM-DDTHH:MM:SS). Syntax:[{“minValue”:””,”maxValue”:””}, {“minValue”:””,”maxValue”:””}] Example:[{“minValue”:”2012-01-15T03:00:00”,”maxValue”:”2012-01-15T09:00:00”}, {“minValue”:”2012-01-15T12:00:00”,”maxValue”:”2012-01-15T21:00:00”}] aggregation_function Optional RFT dict object or Raster Funtion Template item from portal. A custom raster function that will be used to compute the pixel values of the aggregated rasters. This parameter is required when the aggregation_method parameter is set to CUSTOM. ignore_nodata Optional Boolean. Specifies whether NoData values are ignored in the analysis. True : The analysis will include all valid pixels along a given dimension and ignore any NoData pixels. This is the default. False : The analysis will result in NoData if there are any NoData values for the pixel along the given dimension. output_name Optional String. If not provided, an Image Service is created by the method and used as the output raster. You can pass in an existing Image Service Item from your GIS to use that instead. Alternatively, you can pass in the name of the output Image Service that should be created by this method to be used as the output for the tool. A RuntimeError is raised if a service by that name already exists context context contains additional settings that affect task execution. context parameter overwrites values set through arcgis.env parameter This function has the following settings: Extent (extent): A bounding box that defines the analysis area. Example:{“extent”: {“xmin”: -122.68, “ymin”: 45.53, “xmax”: -122.45, “ymax”: 45.6, “spatialReference”: {“wkid”: 4326}}} Output Spatial Reference (outSR): The output raster will be projected into the output spatial reference. Example:{“outSR”: {spatial reference}} Snap Raster (snapRaster): The output raster will have its cells aligned with the specified snap raster. Example:{‘snapRaster’: {‘url’: ‘’}} Cell Size (cellSize): The output raster will have the resolution specified by cell size. Example:{‘cellSize’: {‘x’: 11}} or {‘cellSize’: {‘url’: }} or {‘cellSize’: ‘MaxOfIn’} Parallel Processing Factor (parallelProcessingFactor): controls Raster Processing (CPU) service instances. Example:Syntax example with a specified number of processing instances: {“parallelProcessingFactor”: “2”} Syntax example with a specified percentage of total processing instances: {“parallelProcessingFactor”: “60%”} gis Keyword only parameter. Optional GIS. the GIS on which this tool runs. If not specified, the active GIS is used. future Keyword only parameter. Optional Boolean. If True, the result will be a GPJob object and results will be returned asynchronously. folder Keyword only parameter. Optional str or dict. Creates a folder in the portal, if it does not exist, with the given folder name and persists the output in this folder. The dictionary returned by the gis.content.create_folder() can also be passed in as input. Example:{‘username’: ‘user1’, ‘id’: ‘6a3b77c187514ef7873ba73338cf1af8’, ‘title’: ‘trial’}
Returns

output_raster : Imagery Layer Item

# Usage Example 1: This example aggregates temperature data into yearly data with the average temperature values.

agg_multi_dim = aggregate_multidimensional_raster(input_multidimensional_raster=multidimensional_lyr_input,
variables=["temperature"],
dimension="StdTime",
aggregation_method="MAXIMUM",
aggregation_definition="INTERVAL_KEYWORD",
interval_keyword="YEARLY",
interval_value=None,
output_name="yearly_temp",
ignore_nodata=True,
gis=gis,
folder="aggregate_mdim_raster")

# Usage Example 2: This example aggregates temperature data into hourly data with the average temperature values for multiple variables.

agg_multi_dim = aggregate_multidimensional_raster(input_multidimensional_raster=multidimensional_lyr_input,
variables=["cceiling","ccover","gust","temperature"],
dimension="StdTime",
aggregation_method="MEAN",
aggregation_definition="INTERVAL_VALUE",
interval_value=3,
interval_unit="HOURS",
output_name="hourly_data",
ignore_nodata=True,
gis=gis,
folder={'username': 'user1', 'id': '6a3b77c187514ef7873ba73338cf1af8', 'title': 'aggregate_mdim_raster'})

# Usage Example 3: This example aggregates temperature data using a custom aggregation function for multiple variables. This example uses aggregation function
# uploaded as a Raster Function Template item on portal.

agg_multi_dim = aggregate_multidimensional_raster(input_multidimensional_raster=multidimensional_lyr_input,
variables=["temperature"],
dimension="StdTime",
aggregation_method="CUSTOM",
aggregation_definition="INTERVAL_RANGES",
interval_ranges=[["2012-01-15T03:00:00","2012-01-15T09:00:00"],["2012-01-15T12:00:00","2012-01-15T21:00:00"]],
aggregation_function=rft_item,
output_name="temp_range4",
ignore_nodata=True,
gis=gis)


## generate_trend_raster¶

analytics.generate_trend_raster(dimension=None, variables=None, trend_line_type='LINEAR', frequency=None, ignore_nodata=True, output_name=None, context=None, *, gis=None, future=False, **kwargs)

Estimates the trend for each pixel along a dimension for a given variable in a multidimensional raster. Function available in ArcGIS Image Server 10.8 and higher.

 Argument Description input_multidimensional_raster Required ImageryLayer object. The input multidimensional raster. Portal Item can be passed. dimension Required String. The dimension along which a trend will be extracted for the variable or variables selected in the analysis. variables Optional List. The variable or variables for which trends will be calculated. If no variable is specified, the first variable in the multidimensional raster will be analyzed. trend_line_type Optional String. Specifies the type of line to be used to fit to the pixel values along a dimension. LINEAR : Fits the pixel values for a variable along a linear trend line. This is the default. POLYNOMIAL : Fits the pixel values for a variable along a second order polynomial trend line. HARMONIC : Fits the pixel values for a variable along a harmonic trend line. frequency Optional long. If the line_type parameter is set to HARMONIC, the default value is 1 ,or one harmonic cycle per year. If the line_type parameter is set to POLYNOMIAL, the default value is 2, or second order polynomial. ignore_nodata Optional Boolean. Specifies whether NoData values are ignored in the analysis. True : The analysis will include all valid pixels along a given dimension and ignore any NoData pixels. This is the default. False : The analysis will result in NoData if there are any NoData values for the pixel along the given dimension. output_name Optional String. If not provided, an Image Service is created by the method and used as the output raster. You can pass in an existing Image Service Item from your GIS to use that instead. Alternatively, you can pass in the name of the output Image Service that should be created by this method to be used as the output for the tool. A RuntimeError is raised if a service by that name already exists context context contains additional settings that affect task execution. context parameter overwrites values set through arcgis.env parameter This function has the following settings: Extent (extent): A bounding box that defines the analysis area. Example:{“extent”: {“xmin”: -122.68, “ymin”: 45.53, “xmax”: -122.45, “ymax”: 45.6, “spatialReference”: {“wkid”: 4326}}} Output Spatial Reference (outSR): The output raster will be projected into the output spatial reference. Example:{“outSR”: {spatial reference}} Snap Raster (snapRaster): The output raster will have its cells aligned with the specified snap raster. Example:{‘snapRaster’: {‘url’: ‘’}} Cell Size (cellSize): The output raster will have the resolution specified by cell size. Example:{‘cellSize’: {‘x’: 11}} or {‘cellSize’: {‘url’: }} or {‘cellSize’: ‘MaxOfIn’} Parallel Processing Factor (parallelProcessingFactor): controls Raster Processing (CPU) service instances. Example:Syntax example with a specified number of processing instances: {“parallelProcessingFactor”: “2”} Syntax example with a specified percentage of total processing instances: {“parallelProcessingFactor”: “60%”} gis Keyword only parameter. Optional GIS. the GIS on which this tool runs. If not specified, the active GIS is used. future Keyword only parameter. Optional Boolean. If True, the result will be a GPJob object and results will be returned asynchronously. folder Keyword only parameter. Optional str or dict. Creates a folder in the portal, if it does not exist, with the given folder name and persists the output in this folder. The dictionary returned by the gis.content.create_folder() can also be passed in as input. Example:{‘username’: ‘user1’, ‘id’: ‘6a3b77c187514ef7873ba73338cf1af8’, ‘title’: ‘trial’}
Returns

output_raster : Imagery Layer Item

# Usage Example 1: This example aggregates temperature data into yearly data with the average temperature values.

trend_coeff_multidim  = generate_trend_raster(input_multidimensional_raster=multidimensional_lyr_input,
variables=["NightLightData"],
dimension="StdTime",
trend_line_type='POLYNOMIAL',
frequency=2,
ignore_nodata=True,
output_name="polynomial_trend_coefficients",
gis=gis,
folder="generate_trend_raster")


## predict_using_trend_raster¶

analytics.predict_using_trend_raster(variables=None, dimension_definition='BY_VALUE', dimension_values=None, start=None, end=None, interval_value=1, interval_unit=None, output_name=None, context=None, *, gis=None, future=False, **kwargs)

Estimates the trend for each pixel along a dimension for a given variable in a multidimensional raster. Function available in ArcGIS Image Server 10.8 and higher.

 Argument Description input_multidimensional_raster Required ImageryLayer object. The input multidimensional raster. Portal Item can be passed. variables Optional List. The variable or variables that will be predicted in the analysis. If no variables are specified, all variables will be used. dimension_definition Required String. Specifies the method used to provide prediction dimension values. BY_VALUE : The prediction will be calculated for a single dimension value or a list of dimension values defined by the dimension_values parameter. This is the default. For example, you want to predict yearly precipitation for the years 2050, 2100, and 2150. BY_INTERVAL - The prediction will be calculated for an interval of the dimension defined by a start and an end value. For example, you want to predict yearly precipitation for every year between 2050 and 2150. dimension_values Optional list. The dimension value or values to be used in the prediction. This parameter is required when dimension_def parameter is set to BY_VALUE. start Optional String.The start date, height, or depth of the dimension interval to be used in the prediction. end Optional String. The end date, height, or depth of the dimension interval to be used in the prediction. interval_value Optional Float. The number of steps between two dimension values to be included in the prediction. The default value is 1 For example, to predict temperature values every five years, use a value of 5. interval_unit Optional String. Specifies the unit that will be used for the value interval. This parameter only applies when the dimension of analysis is a time dimension. HOURS - The prediction will be calculated for each hour in the range of time described by the start, end, and interval_value parameters. DAYS - The prediction will be calculated for each day in the range of time described by the start, end, and interval_value parameters. WEEKS - The prediction will be calculated for each week in the range of time described by the start, end, and interval_value parameters. MONTHS - The prediction will be calculated for each month in the range of time described by the start, end, and interval_value parameters. YEARS - The prediction will be calculated for each year in the range of time described by the start, end, and interval_value parameters. output_name Optional String. If not provided, an Image Service is created by the method and used as the output raster. You can pass in an existing Image Service Item from your GIS to use that instead. Alternatively, you can pass in the name of the output Image Service that should be created by this method to be used as the output for the tool. A RuntimeError is raised if a service by that name already exists context context contains additional settings that affect task execution. context parameter overwrites values set through arcgis.env parameter This function has the following settings: Extent (extent): A bounding box that defines the analysis area. Example:{“extent”: {“xmin”: -122.68, “ymin”: 45.53, “xmax”: -122.45, “ymax”: 45.6, “spatialReference”: {“wkid”: 4326}}} Output Spatial Reference (outSR): The output raster will be projected into the output spatial reference. Example:{“outSR”: {spatial reference}} Snap Raster (snapRaster): The output raster will have its cells aligned with the specified snap raster. Example:{‘snapRaster’: {‘url’: ‘’}} Cell Size (cellSize): The output raster will have the resolution specified by cell size. Example:{‘cellSize’: {‘x’: 11}} or {‘cellSize’: {‘url’: }} or {‘cellSize’: ‘MaxOfIn’} Parallel Processing Factor (parallelProcessingFactor): controls Raster Processing (CPU) service instances. Example:Syntax example with a specified number of processing instances: {“parallelProcessingFactor”: “2”} Syntax example with a specified percentage of total processing instances: {“parallelProcessingFactor”: “60%”} gis Keyword only parameter. Optional GIS. the GIS on which this tool runs. If not specified, the active GIS is used. future Keyword only parameter. Optional Boolean. If True, the result will be a GPJob object and results will be returned asynchronously. folder Keyword only parameter. Optional str or dict. Creates a folder in the portal, if it does not exist, with the given folder name and persists the output in this folder. The dictionary returned by the gis.content.create_folder() can also be passed in as input. Example:{‘username’: ‘user1’, ‘id’: ‘6a3b77c187514ef7873ba73338cf1af8’, ‘title’: ‘trial’}
Returns

output_raster : Imagery Layer Item

# Usage Example 1: This example generates the forecasted precipitation and temperature for January 1, 2050, and January 1, 2100.

predict_output = predict_using_trend_raster(input_multidimensional_raster=multidimensional_lyr_input,
variables=["temp","precip"],
dimension_definition='BY_VALUE',
dimension_values=["2050-01-01T00:00:00","2100-01-01T00:00:00"],
output_name="predicted_temp_precip",
gis=gis.
folder="predict_trend")

# Usage Example 2: This example generates the forecasted NDVI values for each month in year 2025.

predict_output = predict_using_trend_raster(input_multidimensional_raster=multidimensional_lyr_input,
variables=["NDVI"],
dimension_definition='BY_INTERVAL',
start="2025-01-01T00:00:00",
end="2025-12-31T00:00:00",
interval_value=1,
interval_unit="MONTHS",
output_name="predict_using_trend_raster",
gis=gis,
folder={'username': 'user1', 'id': '6a3b77c187514ef7873ba73338cf1af8', 'title': 'trial'})


## find_argument_statistics¶

analytics.find_argument_statistics(dimension=None, dimension_definition='ALL', interval_keyword=None, variables=None, statistics_type='ARGUMENT_MIN', min_value=None, max_value=None, multiple_occurrence_value=None, ignore_nodata=True, output_name=None, context=None, *, gis=None, future=False, **kwargs)

Extracts the dimension value at which a given statistic is attained for each pixel in a multidimensional raster. Function available in ArcGIS Image Server 10.8 and higher.

 Argument Description input_raster Required ImageryLayer object. The input raster. Portal Item can be passed. dimension Required String. The dimension from which the statistic will be extracted. If the input raster is not a multidimensional raster, this parameter is not required. dimension_definition Required String. Specifies the dimension interval for which the data will be analyzed. ALL : The data values will be analyzed across all slices. This is the default. INTERVAL_KEYWORD :The variable data will be analyzed using a commonly known interval. Example:‘ALL’ interval_keyword Required String. Specifies the keyword interval that will be used when analyzing along the dimension. This parameter is required when the dimension_definition parameter is set to INTERVAL_KEYWORD, and the analysis must be across time. Possible options: HOURLY, DAILY, WEEKLY, MONTHLY, QUARTERLY, YEARLY, RECURRING_DAILY, RECURRING_WEEKLY, RECURRING_MONTHLY, RECURRING_QUARTERLY variables Optional List. The variable or variables to be analyzed. If the input raster is not multidimensional, the pixel values of the multiband raster are considered the variable. If the input raster is multidimensional and no variable is specified, all variables with the selected dimension will be analyzed. For example, to find the years in which temperature values were highest, specify temperature as the variable to be analyzed. If you do not specify any variables and you have both temperature and precipitation variables, both variables will be analyzed and the output multidimensional raster will include both variables. statistics_type Optional String. Specifies the statistic to extract from the variable or variables along the given dimension. ARGUMENT_MIN : The dimension value at which the minimum variable value is reached will be extracted. This is the default. ARGUMENT_MAX : The dimension value at which the maximum variable value is reached will be extracted. ARGUMENT_MEDIAN : The dimension value at which the median variable value is reached will be extracted. DURATION : The longest dimension duration for which the variable values fall between the minimum and maximum values. min_value Optional Float. The minimum variable value to be used to extract the duration. This parameter is required when the statistics_type parameter is set to DURATION. max_value Optional Float. The maximum variable value to be used to extract the duration. multiple_occurrence_value Optional Long. Specifies the pixel value to use to indicate that a given argument statistic was reached more than once in the input raster dataset. If not specified, the pixel value will be the value of the dimension the first time the argument statistic was reached. ignore_nodata Optional Boolean. Specifies whether NoData values are ignored in the analysis. True : The analysis will include all valid pixels along a given dimension and ignore any NoData pixels. This is the default. False : The analysis will result in NoData if there are any NoData values for the pixel along the given dimension. output_name Optional String. If not provided, an Image Service is created by the method and used as the output raster. You can pass in an existing Image Service Item from your GIS to use that instead. Alternatively, you can pass in the name of the output Image Service that should be created by this method to be used as the output for the tool. A RuntimeError is raised if a service by that name already exists context context contains additional settings that affect task execution. context parameter overwrites values set through arcgis.env parameter This function has the following settings: Extent (extent): A bounding box that defines the analysis area. Example:{“extent”: {“xmin”: -122.68, “ymin”: 45.53, “xmax”: -122.45, “ymax”: 45.6, “spatialReference”: {“wkid”: 4326}}} Output Spatial Reference (outSR): The output raster will be projected into the output spatial reference. Example:{“outSR”: {spatial reference}} Snap Raster (snapRaster): The output raster will have its cells aligned with the specified snap raster. Example:{‘snapRaster’: {‘url’: ‘’}} Cell Size (cellSize): The output raster will have the resolution specified by cell size. Example:{‘cellSize’: {‘x’: 11}} or {‘cellSize’: {‘url’: }} or {‘cellSize’: ‘MaxOfIn’} Parallel Processing Factor (parallelProcessingFactor): controls Raster Processing (CPU) service instances. Example:Syntax example with a specified number of processing instances: {“parallelProcessingFactor”: “2”} Syntax example with a specified percentage of total processing instances: {“parallelProcessingFactor”: “60%”} gis Keyword only parameter. Optional GIS. the GIS on which this tool runs. If not specified, the active GIS is used. future Keyword only parameter. Optional Boolean. If True, the result will be a GPJob object and results will be returned asynchronously. folder Keyword only parameter. Optional str or dict. Creates a folder in the portal, if it does not exist, with the given folder name and persists the output in this folder. The dictionary returned by the gis.content.create_folder() can also be passed in as input. Example:{‘username’: ‘user1’, ‘id’: ‘6a3b77c187514ef7873ba73338cf1af8’, ‘title’: ‘trial’}
Returns

output_raster : Imagery Layer Item

# Usage Example 1: This example finds the minimum precipitation and temperature values across a time series multidimensional raster.
# If the same minimum value is found multiple times, the pixel value will be 99999.

arg_stat_output = arcgis.raster.analytics.find_argument_statistics(input_raster=input_layer,
dimension="StdTime",
variables=["precip","temp"],
statistics_type='ARGUMENT_MIN',
multiple_occurrence_value=99999,
ignore_nodata=True,
output_name="arg_stat_output",
gis=gis,
folder="find_argument_statistics")

# Usage Example 2: This example finds the longest time interval for which salinity fell between 10 and 15 units of measurement in the multidimensional raster.

arg_stat_output = find_argument_statistics(input_raster=input_layer,
dimension="StdTime",
variables=["salinity"],
statistics_type='DURATION',
min_value=10,
max_value=15,
ignore_nodata=True,
output_name="arg_stat_output",
gis=gis,
folder={'username': 'user1', 'id': '6a3b77c187514ef7873ba73338cf1af8', 'title': 'trial'})


## linear_spectral_unmixing¶

analytics.linear_spectral_unmixing(input_spectral_profile, value_option=[], output_name=None, context=None, *, gis=None, future=False, **kwargs)

Performs subpixel classification and calculates the fractional abundance of endmembers for individual pixels. Function available in ArcGIS Image Server 10.8 and higher.

 Argument Description input_raster Required ImageryLayer object. The input raster. Portal Item can be passed. input_spectral_profile Required Dict or String. The class spectral profile information. value_option Optional String. Specifies the options to define the output pixel values. SUM_TO_ONE : Class values for each pixel are provided in decimal format with the sum of all classes equal to 1. For example, Class1 = 0.16; Class2 = 0.24; Class3 = 0.60. NON_NEGATIVE : There will be no negative output values. output_name Optional String. If not provided, an Image Service is created by the method and used as the output raster. You can pass in an existing Image Service Item from your GIS to use that instead. Alternatively, you can pass in the name of the output Image Service that should be created by this method to be used as the output for the tool. A RuntimeError is raised if a service by that name already exists context context contains additional settings that affect task execution. context parameter overwrites values set through arcgis.env parameter This function has the following settings: Extent (extent): A bounding box that defines the analysis area. Example:{“extent”: {“xmin”: -122.68, “ymin”: 45.53, “xmax”: -122.45, “ymax”: 45.6, “spatialReference”: {“wkid”: 4326}}} Output Spatial Reference (outSR): The output raster will be projected into the output spatial reference. Example:{“outSR”: {spatial reference}} Snap Raster (snapRaster): The output raster will have its cells aligned with the specified snap raster. Example:{‘snapRaster’: {‘url’: ‘’}} Cell Size (cellSize): The output raster will have the resolution specified by cell size. Example:{‘cellSize’: {‘x’: 11}} or {‘cellSize’: {‘url’: }} or {‘cellSize’: ‘MaxOfIn’} Parallel Processing Factor (parallelProcessingFactor): controls Raster Processing (CPU) service instances. Example:Syntax example with a specified number of processing instances: {“parallelProcessingFactor”: “2”} Syntax example with a specified percentage of total processing instances: {“parallelProcessingFactor”: “60%”} gis Keyword only parameter. Optional GIS. the GIS on which this tool runs. If not specified, the active GIS is used. future Keyword only parameter. Optional Boolean. If True, the result will be a GPJob object and results will be returned asynchronously. folder Keyword only parameter. Optional str or dict. Creates a folder in the portal, if it does not exist, with the given folder name and persists the output in this folder. The dictionary returned by the gis.content.create_folder() can also be passed in as input. Example:{‘username’: ‘user1’, ‘id’: ‘6a3b77c187514ef7873ba73338cf1af8’, ‘title’: ‘trial’}
Returns

output_raster : Imagery Layer Item

# Usage Example 1: This example calculates the fractional abundance of classes from a classifier definition file (.ecd)
# located in a datastore registered with the raster analytics server and generates a multiband raster.

unmixing_output = linear_spectral_unmixing(input_raster=input_layer,
input_spectral_profile="/fileShares/Mdim/SpectralUnmixing_json.ecd",
output_name="linear_spectral_unmixing",
gis=gis,
folder="linear_spectral_unmixing")

# Usage Example 2: This example calculates the fractional abundance of classes from a dictionary and generates a multiband raster.

input_spectral_profile_dict = {"EsriEndmemberDefinitionFile":0,"FileVersion":1,"NumberEndmembers":3,"NumberBands":7,
"Endmembers":[{"EndmemberID":1,"EndmemberName":"urban","SpectralProfile":[88,42,48,38,86,115,59]},
{"EndmemberID":2,"EndmemberName":"vegetation","SpectralProfile":[50,21,20,35,50,110,23]},
{"EndmemberID":3,"EndmemberName":"water","SpectralProfile":[51,20,14,9,7,116,4]}]}

unmixing_outputs = arcgis.raster.analytics.linear_spectral_unmixing(input_raster=multidimensional_lyr_input,
input_spectral_profile=input_spectral_profile_dict,
value_option=["SUM_TO_ONE","NON_NEGATIVE"],
output_name="linear_spectral_unmixing",
gis=gis,
folder={'username': 'user1', 'id': '6a3b77c187514ef7873ba73338cf1af8', 'title': 'trial'})


## subset_multidimensional_raster¶

analytics.subset_multidimensional_raster(variables=None, dimension_definition='ALL', dimension_ranges=None, dimension_values=None, dimension=None, start_of_first_iteration=None, end_of_first_iteration=None, iteration_step=None, iteration_unit=None, output_name=None, context=None, *, gis=None, future=False, **kwargs)

Subsets a multidimensional raster by slicing data along defined variables and dimensions. Function available in ArcGIS Image Server 10.8 and higher.

 Argument Description input_multidimensional_raster Required ImageryLayer object. The input multidimensional raster. Portal Item can be passed. variables Optional list. The variables that will be included in the output multidimensional raster. If no variable is specified, all of the variables will be used. dimension_definition Optional String. Specifies the method that will be used to slice the dimension. ALL : The full range for each dimension will be used. This is the default. BY_RANGES : The dimension will be sliced using a range or a list of ranges. BY_ITERATION : The dimension will be sliced over a specified interval. BY_VALUE : The dimension will be sliced using a list of dimension values. dimension_ranges Optional list of dicts. This slices the data based on the dimension name and the minimum and maximum values for the range. This parameter is required when the dimension_definition is set to BY_RANGE. If dimension is StdTime, then the min value and max value must be specified in human readable time format (YYYY-MM-DDTHH:MM:SS). dimension_values has to be specified as: [{“dimension”:””, “minValue”:””, “maxValue”:””}, {“dimension”:””, “minValue”:””, “maxValue”:””}] Example:[{“dimension”:”StdTime”, “minValue”:”2013-05-17T00:00:00”, “maxValue”:”2013-05-17T03:00:00”}, {“dimension”:”StdZ”, “minValue”:”-5000”, “maxValue”:”-4000”}] dimension_values Optional list of dicts. This slices the data based on the dimension name and the value specified. This parameter is required when the dimension_definition is set to BY_VALUE. If dimension is StdTime, then the value must be specified in human readable time format (YYYY-MM-DDTHH:MM:SS). dimension_values has to be specified as: [{“dimension”:””, “value”:””}, {“dimension”:””, “value”:””}] Example:[{“dimension”:”StdTime”, “value”:”2012-01-15T03:00:00”}, {“dimension”:” StdZ “, “value”:”-4000”}] dimension Optional string. The dimension along which the variables will be sliced. start_of_first_iteration Optional string. The beginning of the interval. This parameter is required when the dimension_definition is set to BY_ITERATION end_of_first_iteration Optional String.The end of the interval. This parameter is required when the dimension_definition is set to BY_ITERATION iteration_step Optional Float. The interval over which the data will be sliced. This parameter is required when the dimension_definition is set to BY_ITERATION iteration_unit Optional String. The iteration unit. This parameter is required when the dimension_definition is set to BY_ITERATION HOURS - Uses hours as the specified unit of time. DAYS - Uses days as the specified unit of time. WEEKS - Uses weeks as the specified unit of time. MONTHS - Uses months as the specified unit of time. YEARS -Uses years as the specified unit of time. output_name Optional String. If not provided, an Image Service is created by the method and used as the output raster. You can pass in an existing Image Service Item from your GIS to use that instead. Alternatively, you can pass in the name of the output Image Service that should be created by this method to be used as the output for the tool. A RuntimeError is raised if a service by that name already exists context context contains additional settings that affect task execution. context parameter overwrites values set through arcgis.env parameter This function has the following settings: Extent (extent): A bounding box that defines the analysis area. Example:{“extent”: {“xmin”: -122.68, “ymin”: 45.53, “xmax”: -122.45, “ymax”: 45.6, “spatialReference”: {“wkid”: 4326}}} Output Spatial Reference (outSR): The output raster will be projected into the output spatial reference. Example:{“outSR”: {spatial reference}} Snap Raster (snapRaster): The output raster will have its cells aligned with the specified snap raster. Example:{‘snapRaster’: {‘url’: ‘’}} Cell Size (cellSize): The output raster will have the resolution specified by cell size. Example:{‘cellSize’: {‘x’: 11}} or {‘cellSize’: {‘url’: }} or {‘cellSize’: ‘MaxOfIn’} Parallel Processing Factor (parallelProcessingFactor): controls Raster Processing (CPU) service instances. Example:Syntax example with a specified number of processing instances: {“parallelProcessingFactor”: “2”} Syntax example with a specified percentage of total processing instances: {“parallelProcessingFactor”: “60%”} gis Keyword only parameter. Optional GIS. the GIS on which this tool runs. If not specified, the active GIS is used. future Keyword only parameter. Optional Boolean. If True, the result will be a GPJob object and results will be returned asynchronously. folder Keyword only parameter. Optional str or dict. Creates a folder in the portal, if it does not exist, with the given folder name and persists the output in this folder. The dictionary returned by the gis.content.create_folder() can also be passed in as input. Example:{‘username’: ‘user1’, ‘id’: ‘6a3b77c187514ef7873ba73338cf1af8’, ‘title’: ‘trial’}
Returns

output_raster : Imagery layer item

# Usage Example 1: This creates a new multidimensional image service with variables cceiling and ccover for StdTime  dimensions
values - 2012-01-15T03:00:00 and  2012-01-15T09:00:00

subset_output = subset_multidimensional_raster(input_multidimensional_raster=input_multidimensional_lyr,
variables=["cceiling","ccover"],
dimension_definition='BY_VALUE',
dimension_values=[{"dimension":"StdTime", "value":"2012-01-15T03:00:00"},
{"dimension":"StdTime", "value":"2012-01-15T09:00:00"}]
output_name="subset_op",
gis=gis,
folder="subset_multidimensional_raster")


## costpath_as_polyline¶

analytics.costpath_as_polyline(input_cost_distance_raster, input_cost_backlink_raster, path_type='BEST_SINGLE', destination_field=None, output_polyline_name=None, context=None, *, gis=None, future=False, **kwargs)

Calculates the least cost polyline path between sources and known destinations. Function available in ArcGIS Image Server 10.8 and higher.

Returns

output_raster : Imagery layer item

## define_nodata¶

analytics.define_nodata(nodata, query_filter=None, num_of_bands=None, composite_value=False, *, gis=None, future=False, **kwargs)

Function specifies one or more values to be represented as NoData. Function available in ArcGIS Image Server 10.8 and higher.

 Argument Description input_raster Required ImageryLayer object. Portal Item can be passed. nodata Required dictionary. The value must be specified in dict form and can have keys - noDataValues, includedRanges e.g. {“noDataValues”: [0]} {“noDataValues”: [0, 255, 0]} {“includedRanges”: [0, 255]} {“includedRanges”: [0, 255, 1, 255, 4, 250]} query_filter Optional str. An SQL statement to select specific raster in the image collection. Only the selected rasters will have their NoData values changed. Examples: “OBJECTID > 3” num_of_bands Optional int. The number of bands in the input raster. Example: 3 composite_value Optional boolean. Choose whether all bands must be NoData in order for the pixel to be classified as NoData. False : If any of the bands have pixels of NoData, then the pixel is classified as NoData. This is the default. True : All of the bands must have pixels of NoData in order for the pixel to be classified as NoData. gis Optional GIS object. If not speficied, the currently active connection is used. future Keyword only parameter. Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously.
Returns

The imagery layer url

# Usage Example 1: To set no data values.
define_nodata_op = define_nodata(input_raster=image_collection,
composite_value=False,
nodata={"noDataValues": [110,105,101]},
num_of_bands=3,
query_filter="OBJECTID < 12",
future=False,
gis=gis,
)

# Usage Example 2: To set included ranges.
define_nodata_op = define_nodata(input_raster=image_collection,
composite_value=True,
nodata={"includedRanges": [150, 200, 0, 200, 50, 200]},
num_of_bands=3,
query_filter="OBJECTID > 7",
future=True,
gis=gis,
)