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¶
-
analytics.
get_datastores
()¶ 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¶
-
analytics.
is_supported
()¶ 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¶
-
analytics.
generate_raster
(function_arguments=None, output_raster_properties=None, output_name=None, *, gis=None, **kwargs)¶ raster_function : Required, see http://resources.arcgis.com/en/help/rest/apiref/israsterfunctions.html
function_arguments : Optional, for specifying input Raster alone, portal Item can be passed
output_raster_properties : Optional
- output_nameOptional. 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
gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
output_raster : Image layer item
interpolate_points¶
-
analytics.
interpolate_points
(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, *, gis=None, **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).
- input_point_featuresRequired point layer containing locations with known values
The point layer that contains the points where the values have been measured.
- interpolate_fieldRequired string - field to interpolate
Choose the field whose values you wish to interpolate. The field must be numeric.
- optimize_forOptional string - Choose your preference for speed versus accuracy.
More accurate predictions take longer to calculate. This parameter alters the default values of several other parameters of Interpolate Points in order to optimize speed of calculation, accuracy of results, or a balance of the two. By default, the tool will optimize for balance. One of the following: [‘SPEED’, ‘BALANCE’, ‘ACCURACY’]
- transform_dataOptional bool - Choose whether to transform your data to the normal distribution.
Interpolation is most accurate for data that follows a normal (bell-shaped) distribution. If your data does not appear to be normally distributed, you should perform a transformation.
- size_of_local_modelsOptional int - Size of local models
Interpolate Points works by building local interpolation models that are mixed together to create the final prediction map. This parameter controls how many points will be contained in each local model. Smaller values will make results more local and can reveal small-scale effects, but it may introduce some instability in the calculations. Larger values will be more stable, but some local effects may be missed. The value can range from 30 to 500, but typical values are between 50 and 200.
- number_of_neighborsOptional int - Number of Neighbors
Predictions are calculated based on neighboring points. This parameter controls how many points will be used in the calculation. Using a larger number of neighbors will generally produce more accurate results, but the results take longer to calculate. This value can range from 1 to 64, but typical values are between 5 and 15.
- output_cell_sizeOptional LinearUnit - Output cell size
Enter the cell size and unit for the output rasters. The available units are Feet, Miles, Meters, and Kilometers.
- output_prediction_errorOptional bool - Output prediction error
Choose whether you want to create a raster of standard errors for the predicted values. Standard errors are useful because they provide information about the reliability of the predicted values. A simple rule of thumb is that the true value will fall within two standard errors of the predicted value 95 percent of the time. For example, suppose a new location gets a predicted value of 50 with a standard error of 5. This means that this tool’s best guess is that the true value at that location is 50, but it reasonably could be as low as 40 or as high as 60. To calculate this range of reasonable values, multiply the standard error by 2, add this value to the predicted value to get the upper end of the range, and subtract it from the predicted value to get the lower end of the range.
- output_nameOptional. 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
gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
named tuple with name values being output_raster, output_error_raster and process_info
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, *, gis=None, **kwargs)¶ Compute visibility for an input elevation raster using geodesic method.
input_elevation_surface : Required string
input_observer_features : Required FeatureSet
- optimize_forOptional string
One of the following: [‘SPEED’, ‘ACCURACY’]
maximum_viewing_distance : Optional LinearUnit
maximum_viewing_distance_field : Optional string
minimum_viewing_distance : Optional LinearUnit
minimum_viewing_distance_field : Optional string
viewing_distance_is_3d : Optional bool
observers_elevation : Optional LinearUnit
observers_elevation_field : Optional string
observers_height : Optional LinearUnit
observers_height_field : Optional string
target_height : Optional LinearUnit
target_height_field : Optional string
above_ground_level_output_name : Optional string
- output_nameOptional. 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
gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
- dict with the following keys:
“output_raster” : layer “output_above_ground_level_raster” : layer
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, *, gis=None, **kwargs)¶ - input_zone_layerRequired layer - area layer to summarize a raster layer within defined boundaries.
The layer that defines the boundaries of the areas, or zones, that will be summarized. The layer can be a raster or feature data. For rasters, the zones are defined by all locations in the input that have the same cell value. The areas do not have to be contiguous.
- input_raster_layer_to_summarizeRequired - raster layer to summarize.
The raster cells in this layer will be summarized by the areas (zones) that they fall within.
- zone_fieldRequired string - field to define the boundaries. This is the attribute of the layer that will be used
to define the boundaries of the areas. For example, suppose the first input layer defines the management unit boundaries, with attributes that define the region, the district, and the parcel ID of each unit. You also have a raster layer defining a biodiversity index for each location. With the field you select, you can decide to calculate the average biodiversity at local, district, or regional levels.
- statistic_typeOptional string - statistic to calculate.
You can calculate statistics of any numerical attribute of the points, lines, or areas within the input area layer. The available statistics types when the selected field is integer are Mean, Maximum, Median, Minimum, Minority, Range, Standard deviation(STD), Sum, and Variety. If the field is floating point, the options are Mean, Maximum, Minimum, Range, Standard deviation, and Sum. One of the following: [‘Mean’, ‘Majority’, ‘Maximum’, ‘Median’, ‘Minimum’, ‘Minority’, ‘Range’, ‘STD’, ‘SUM’, ‘Variety’]
- ignore_missing_valuesOptional bool.
If you choose to ignore missing values, only the cells that have a value in the layer to be summarized will be used in determining the output value for that area. Otherwise, if there are missing values anywhere in an area, it is deemed that there is insufficient information to perform statistical calculations for all the cells in that zone, and that area will receive a null (NoData) value in the output.
- output_nameOptional. 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
gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
output_raster : Image layer item
calculate_density¶
-
analytics.
calculate_density
(count_field=None, search_distance=None, output_area_units=None, output_cell_size=None, output_name=None, *, gis=None, **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 tool, for example, to show concentrations of lightning strikes or tornadoes, access to health care facilities, and population densities.
This tool 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.
- input_point_or_line_featuresRequired feature layer - The input point or line layer that will be used to calculate
the density layer.
- count_fieldOptional string - count field
Provide a field specifying the number of incidents at each location. For example, if you have points that represent cities, you can use a field representing the population of the city as the count field, and the resulting population density layer will calculate larger population densities near cities with larger populations. If the default choice of None is used, then each location will be assumed to represent a single count.
- search_distanceOptional LinearUnit - Search distance
Enter a distance specifying how far to search to find point or line features when calculating density values. For example, if you provide a search distance of 10,000 meters, the density of any location in the output layer is calculated based on features that are within 10,000 meters of the location. Any location that does not have any incidents within 10,000 meters will receive a density value of zero. If no distance is provided, a default will be calculated that is based on the locations of the input features and the values in the count field (if a count field is provided).
- output_area_unitsOptional string - Output area units
Specify the output area unit. Density is count divided by area, and this parameter specifies the unit of the area in the density calculation. The available areal units are Square Miles and Square Kilometers.
- output_cell_sizeOptional LinearUnit - Output cell size
Enter the cell size and unit for the output rasters.
- output_nameOptional. 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
gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
output_raster : Image layer item
classify¶
-
analytics.
classify
(input_classifier_definition, additional_input_raster=None, output_name=None, *, gis=None, **kwargs)¶ input_raster : Required string
input_classifier_definition : Required string
additional_input_raster : Optional string
- output_nameOptional. 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
gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
output_raster : Image 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, *, gis=None, **kwargs)¶ Groups together adjacent pixels having similar spectral and spatial characteristics into segments, known as objects.
Argument
Description
input_raster
Required ImageryLayer object
spectral_detail
Optional float. Default is 15.5. Set the level of importance given to the spectral differences of features in your imagery. Valid values range from 1.0 to 20.0. A high value is appropriate when you have features you want to classify separately but have somewhat similar spectral characteristics. Smaller values create spectrally smoother outputs.
For example, setting a higher spectral detail value for a forested scene, will preserve greater discrimination between the different tree species, resulting in more segments.
spatial_detail
Optional float. Default is 15. Set the level of importance given to the proximity between features in your imagery. Valid values range from 1 to 20. A high value is appropriate for a scene where your features of interest are small and clustered together. Smaller values create spatially smoother outputs.
For example, in an urban scene, you could classify an impervious surface using a smaller spatial detail, or you could classify buildings and roads as separate classes using a higher spatial detail.
minimum_segment_size_in_pixels
Optional float. Default is 20. Merge segments smaller than this size with their best fitting neighbor segment. This is related to the minimum mapping unit for a mapping project. Units are in pixels.
band_indexes
Optional List of integers. Default is [0,1,2] Define which 3 bands are used in segmentation. Choose the bands that visually discriminate your features of interest best.
remove_tiling_artifacts
Optional Bool. Default is False. If False, the tool will not run to remove tiling artifacts after segmentation. The result may seem blocky at some tiling boundaries.
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
gis
Optional GIS object. If not speficied, the currently active connection is used.
- 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, **kwargs)¶ input_raster : Required string
input_training_sample_json : Required string
segmented_raster : Optional string
classifier_parameters : Required string
segment_attributes : Required string
gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
output_classifier_definition
convert_feature_to_raster¶
-
analytics.
convert_feature_to_raster
(output_cell_size, value_field=None, output_name=None, *, gis=None, **kwargs)¶ Creates a new raster dataset from an existing feature dataset. Any feature class containing point, line, or polygon features can be converted to a raster dataset. 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.
input_feature : Required. The input feature layer to convert to a raster dataset.
- output_cell_sizeRequired LinearUnit. The cell size and unit for the output rasters.
The available units are Feet, Miles, Meters, and Kilometers. eg - {“distance”:60,”units”:meters}
value_field : Optional string. The field that will be used to assign values to the output raster.
- output_nameOptional. The name of the layer that will be created in My Content.
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
gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
output_raster : Image layer item
convert_raster_to_feature¶
-
analytics.
convert_raster_to_feature
(field='Value', output_type='Polygon', simplify=True, output_name=None, *, gis=None, **kwargs)¶ This service tool converts imagery data to feature class vector data.
input_raster : Required. The input raster that will be converted to a feature dataset.
- fieldOptional 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_typeOptional string
One of the following: [‘Point’, ‘Line’, ‘Polygon’]
- simplifyOptional 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_nameOptional. If not provided, an 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
gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
output_features : Image layer item
copy_raster¶
-
analytics.
copy_raster
(output_cellsize=None, resampling_method='NEAREST', clip_setting=None, output_name=None, *, gis=None, **kwargs)¶ input_raster : Required string
output_cellsize : Optional string
- resampling_methodOptional string
One of the following: [‘NEAREST’, ‘BILINEAR’, ‘CUBIC’, ‘MAJORITY’]
clip_setting : Optional string
- output_nameOptional. 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
gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
output_raster : Image 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, **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, the name of the raster type to use for adding data to the image collection.
raster_type_params
Optional, 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, 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, The context parameter is used to provide additional input parameters
{“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
Optional GIS. The GIS on which this tool runs. If not specified, the active GIS is used.
- Returns
The imagery layer item
add_image¶
-
analytics.
add_image
(input_rasters, raster_type_name=None, raster_type_params=None, context=None, *, gis=None, **kwargs)¶ Add a collection of images to an existing image_collection. 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, 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
image_collection
Required, 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, the name of the raster type to use for adding data to the image collection.
raster_type_params
Optional, 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.
context
- Optional, The context parameter is used to provide additional input parameters
{“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
Optional GIS. The GIS on which this tool runs. If not specified, the active GIS is used.
- Returns
The imagery layer item
delete_image¶
-
analytics.
delete_image
(where, *, gis=None, **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
Optional GIS. The GIS on which this tool runs. If not specified, the active GIS is used.
- Returns
The imagery layer url
delete_image_collection¶
-
analytics.
delete_image_collection
(*, gis=None, **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
Optional GIS. The GIS on which this tool runs. If not specified, the active GIS is used.
- Returns
Boolean value indicating whether the deletion was successful or not
list_datastore_content¶
-
analytics.
list_datastore_content
(filter=None, *, gis=None, **kwargs)¶ List the contents of the datastore registered with the server (fileShares, cloudStores, rasterStores).
Argument
Description
datastore
Required. 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
filter
Optional. To filter out the raster contents to be displayed
gis
Optional GIS. The GIS on which this tool runs. If not specified, the active GIS is used.
- Returns
List of contents in the datastore
build_footprints¶
-
analytics.
build_footprints
(computation_method='RADIOMETRY', value_range=None, context=None, *, gis=None, **kwargs)¶ Computes the extent of every raster in a mosaic dataset.
- image_collectionRequired. 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_methodOptional. Refine the footprints using one of the following methods:
RADIOMETRY, GEOMETRY Default: RADIOMETRY
value_range: Optional. Parameter to specify the value range.
- contextOptional dictionary. Can be used to specify values for keys like:
whereClause, minValue, maxValue, numVertices, shrinkDistance, maintainEdge, skipDerivedImages, updateBoundary, requestSize, minRegionSize, simplification, edgeTorelance, maxSliverSize, minThinnessRatio
gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
output_raster : Image layer item
build_overview¶
-
analytics.
build_overview
(cell_size=None, context=None, *, gis=None, **kwargs)¶ - image_collectionRequired. 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 : optional dictionary
gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
output_raster : Image layer item
calculate_statistics¶
-
analytics.
calculate_statistics
(skip_factors=None, context=None, *, gis=None, **kwargs)¶ Calculates statistics for an image collection
- image_collectionRequired. 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_factorsoptional 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.
- contextoptional dictionary. Can be used to specify parameters for calculating statistics. Keys can be
ignoreValues, skipExisting, areaOfInterest
gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
output_raster : Image layer item
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, **kwargs)¶ calculates the optimum cost network from a set of input regions.
- input_regions_rasterThe layer that defines the regions to find the optimum travel cost netork for.
The layer can be raster or feature.
input_cost_raster : A raster defining the impedance or cost to move planimetrically through each cell.
- output_optimum_network_nameOptional. 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.
gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
output_raster : Image 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, *, gis=None, **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
gis
Optional GIS. the GIS on which this tool runs. If not specified, the active GIS is used.
- Returns
The imagery layer url