arcgis.raster.functions module¶
Raster functions allow you to define processing operations that will be applied to one or more rasters. These functions are applied to the raster data on the fly as the data is accessed and viewed; therefore, they can be applied quickly without having to endure the time it would otherwise take to create a processed product on disk, for which raster analytics tools like arcgis.raster.analytics.generate_raster can be used.
Functions can be applied to various rasters (or images), including the following:
- Imagery layers
- Rasters within imagery layers
abs¶
-
functions.
abs
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Abs operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
acos¶
-
functions.
acos
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The acos operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
acosh¶
-
functions.
acosh
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The ACosH operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
apply¶
-
functions.
apply
(raster, fn_name, **kwargs)¶ Applies a server side raster function template defined by the imagery layer (image service) The name of the raster function template is available in the imagery layer properties.rasterFunctionInfos.
Function arguments are optional; argument names and default values are created by the author of the raster function template and are not known through the API. A client can simply provide the name of the raster function template only or, optionally, provide arguments to overwrite the default values. For more information about authoring server-side raster function templates, see <a href=”http://server.arcgis.com/en/server/latest/publish-services/windows/server-side-raster-functions.htm”>Server-side raster functions</a>.
Parameters: - raster – the input raster, or imagery layer
- fn_name – name of the server side raster function template, See imagery layer properties.rasterFunctionInfos
- kwargs – keyword arguments to override the default values of the raster function template, including astype
Returns: the output raster
arg_max¶
-
functions.
arg_max
(rasters, undefined_class=None, astype=None)¶ In the ArgMax method, all raster bands from every input raster are assigned a 0-based incremental band index, which is first ordered by the input raster index, as shown in the table below, and then by the relative band order within each input raster.
See http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/argstatistics-function.htm
Parameters: - rasters – the imagery layers filtered by where clause, spatial and temporal filters
- undefined_class – int, required
Returns: the output raster with this function applied to it
arg_median¶
-
functions.
arg_median
(rasters, undefined_class=None, astype=None)¶ The ArgMedian method returns the Band index for which the given pixel attains the median value of values from all bands.
Consider values from all bands as an array. After sorting the array in ascending order, the median is the one value separating the lower half of the array from the higher half. More specifically, if the ascend-sorted array has n values, the median is the ith (0-based) value, where:
See http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/argstatistics-function.htm
Parameters: - rasters – the imagery layers filtered by where clause, spatial and temporal filters
- undefined_class – int, required
Returns: the output raster with this function applied to it
arg_min¶
-
functions.
arg_min
(rasters, undefined_class=None, astype=None)¶ ArgMin is the argument of the minimum, which returns the Band index for which the given pixel attains its minimum value.
See http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/argstatistics-function.htm
Parameters: - rasters – the imagery layers filtered by where clause, spatial and temporal filters
- undefined_class – int, required
Returns: the output raster with this function applied to it
arg_statistics¶
-
functions.
arg_statistics
(rasters, stat_type=None, min_value=None, max_value=None, undefined_class=None, astype=None)¶ The arg_statistics function produces an output with a pixel value that represents a statistical metric from all bands of input rasters. The statistics can be the band index of the maximum, minimum, or median value, or the duration (number of bands) between a minimum and maximum value
See http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/argstatistics-function.htm
Parameters: - rasters – the imagery layers filtered by where clause, spatial and temporal filters
- stat_type – one of “max”, “min”, “median”, “duration”
- min_value – double, required if the type is duration
- max_value – double, required if the type is duration
- undefined_class – int, required if the type is maximum or minimum
Returns: the output raster with this function applied to it
arithmetic¶
-
functions.
arithmetic
(raster1, raster2, extent_type='FirstOf', cellsize_type='FirstOf', astype=None, operation_type=1)¶ The Arithmetic function performs an arithmetic operation between two rasters or a raster and a scalar, and vice versa.
Parameters: - raster1 – the first raster- imagery layers filtered by where clause, spatial and temporal filters
- raster2 – the 2nd raster - imagery layers filtered by where clause, spatial and temporal filters
- extent_type – one of “FirstOf”, “IntersectionOf” “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf “MeanOf”, “LastOf”
- operation_type – int 1 = Plus, 2 = Minus, 3 = Multiply, 4=Divide, 5=Power, 6=Mode
Returns: the output raster with this function applied to it
asin¶
-
functions.
asin
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The asin operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
asinh¶
-
functions.
asinh
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The ASinH operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
aspect¶
-
functions.
aspect
(raster)¶ aspect identifies the downslope direction of the maximum rate of change in value from each cell to its neighbors. Aspect can be thought of as the slope direction. The values of the output raster will be the compass direction of the aspect. For more information, see <a href=”http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/aspect-function.htm”>Aspect function</a> and <a href=”http://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/how-aspect-works.htm”>How Aspect works</a>.
Parameters: raster – the input raster / imagery layer Returns: aspect applied to the input raster
atan¶
-
functions.
atan
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The ATan operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
atan2¶
-
functions.
atan2
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The ATan2 operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
atanh¶
-
functions.
atanh
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The ATanH operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
band_arithmetic¶
-
functions.
band_arithmetic
(raster, band_indexes=None, astype=None, method=0)¶ The band_arithmetic function performs an arithmetic operation on the bands of a raster. For more information, see Band Arithmetic function at http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/band-arithmetic-function.htm
Parameters: - raster – the input raster / imagery layer
- band_indexes – band indexes or expression
- astype – output pixel type
- method – int (0 = UserDefined, 1 = NDVI, 2 = SAVI, 3 = TSAVI, 4 = MSAVI, 5 = GEMI, 6 = PVI, 7 = GVITM, 8 = Sultan)
Returns: band_arithmetic applied to the input raster
bitwise_and¶
-
functions.
bitwise_and
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The BitwiseAnd operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
bitwise_left_shift¶
-
functions.
bitwise_left_shift
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The BitwiseLeftShift operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
bitwise_not¶
-
functions.
bitwise_not
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The BitwiseNot operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
bitwise_or¶
-
functions.
bitwise_or
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The BitwiseOr operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
bitwise_right_shift¶
-
functions.
bitwise_right_shift
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The BitwiseRightShift operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
bitwise_xor¶
-
functions.
bitwise_xor
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The BitwiseXOr operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
boolean_and¶
-
functions.
boolean_and
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The BooleanAnd operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
boolean_not¶
-
functions.
boolean_not
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The BooleanNot operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
boolean_or¶
-
functions.
boolean_or
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The BooleanOr operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
boolean_xor¶
-
functions.
boolean_xor
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The BooleanXOr operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
classify¶
-
functions.
classify
(raster1, raster2, classifier_definition, astype=None)¶ classifies a segmented raster to a categorical raster.
Parameters: - raster1 – the first raster - imagery layers filtered by where clause, spatial and temporal filters
- raster2 – the 2nd raster - imagery layers filtered by where clause, spatial and temporal filters
- classifier_definition – the classifier parameters as a Python dictionary / json format
Returns: the output raster with this function applied to it
clip¶
-
functions.
clip
(raster, geometry=None, clip_outside=True, astype=None)¶ Clips a raster using a rectangular shape according to the extents defined or will clip a raster to the shape of an input polygon. The shape defining the clip can clip the extent of the raster or clip out an area within the raster.
Parameters: - raster – input raster
- geometry – clipping geometry
- clip_outside – boolean, If True, the imagery outside the extents will be removed, else the imagery within the clipping_geometry will be removed.
- astype – output pixel type
Returns: the clipped raster
colormap¶
-
functions.
colormap
(raster, colormap_name=None, colormap=None, astype=None)¶ Transforms the pixel values to display the raster data as a color (RGB) image, based on specific colors in a color map. For more information, see Colormap function at http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/colormap-function.htm
Parameters: - raster – input raster
- colormap_name – colormap name, if one of Random | NDVI | Elevation | Gray
- colormap –
[ [<value1>, <red1>, <green1>, <blue1>], //[int, int, int, int] [<value2>, <red2>, <green2>, <blue2>]
], :param astype: output pixel type :return: the clipped raster
composite_band¶
-
functions.
composite_band
(rasters, astype=None)¶ Combines multiple images to form a multiband image.
Parameters: - rasters – input rasters
- astype – output pixel type
Returns: the multiband image
con¶
-
functions.
con
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The con operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
contrast_brightness¶
-
functions.
contrast_brightness
(raster, contrast_offset=2, brightness_offset=1, astype=None)¶ The ContrastBrightness function enhances the appearance of raster data (imagery) by modifying the brightness or contrast within the image. This function works on 8-bit input raster only.
Parameters: - raster – input raster
- contrast_offset – double, -100 to 100
- brightness_offset – double, -100 to 100
- astype – pixel type of result raster
Returns: output raster
convolution¶
-
functions.
convolution
(raster, kernel=None, astype=None)¶ The Convolution function performs filtering on the pixel values in an image, which can be used for sharpening an image, blurring an image, detecting edges within an image, or other kernel-based enhancements. For more information,
see Convolution function at http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/convolution-function.htmParameters: - raster – input raster
- kernel – well known kernel from arcgis.raster.kernels or user defined kernel passed as a list of list
- astype – pixel type of result raster
Returns: output raster
cos¶
-
functions.
cos
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Cos operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
cosh¶
-
functions.
cosh
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The CosH operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
curvature¶
-
functions.
curvature
(raster, curvature_type='standard', z_factor=1, astype=None)¶ The Curvature function displays the shape or curvature of the slope. A part of a surface can be concave or convex; you can tell that by looking at the curvature value. The curvature is calculated by computing the second derivative of the surface. Refer to this conceptual help on how it works.
http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/curvature-function.htm
Parameters: - raster – input raster
- curvature_type – ‘standard’, ‘planform’, ‘profile’
- z_factor – double
- astype – output pixel type
Returns: the output raster
divide¶
-
functions.
divide
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Divide operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
duration¶
-
functions.
duration
(rasters, min_value=None, max_value=None, undefined_class=None, astype=None)¶ Returns the duration (number of bands) between a minimum and maximum value. The Duration method finds the longest consecutive elements in the array, where each element has a value greater than or equal to min_value and less than or equal to max_value, and then returns its length.
See http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/argstatistics-function.htm
Parameters: - rasters – the imagery layers filtered by where clause, spatial and temporal filters
- undefined_class – int, required
Returns: the output raster with this function applied to it
elevation_void_fill¶
-
functions.
elevation_void_fill
(raster, max_void_width=0, astype=None)¶ The elevation_void_fill function is used to create pixels where holes exist in your elevation. Refer to <a href=”http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/elevation-void-fill-function.htm”> this conceptual help</a> on how it works. The arguments for the elevation_void_fill function are as follows:
Parameters: - raster – input raster
- max_void_width – number. Maximum void width to fill. 0: fill all
- astype – output pixel type
Returns: the output raster
equal_to¶
-
functions.
equal_to
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The EqualTo operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
exp¶
-
functions.
exp
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Exp operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
exp10¶
-
functions.
exp10
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Exp10 operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
exp2¶
-
functions.
exp2
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Exp2 operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
expression¶
-
functions.
expression
(raster, expression='(B3 - B1 / B3 + B1)', astype=None)¶ Use a single-line algebraic formula to create a single-band output. The supported operators are -, +, /, *, and unary -. To identify the bands, prepend the band number with a B or b. For example: “BandIndexes”:”(B1 + B2) / (B3 * B5)”
Parameters: - raster – the input raster / imagery layer
- expression – the algebric formula
- astype – output pixel type
Returns: output raster
Returns:
extract_band¶
-
functions.
extract_band
(raster, band_ids=None, band_names=None, band_wavelengths=None, missing_band_action=None, wavelength_match_tolerance=None, astype=None)¶ The extract_band function allows you to extract one or more bands from a raster, or it can reorder the bands in a multiband image. The arguments for the extract_band function are as follows:
Parameters: - raster – input raster
- band_ids – array of int
- band_names – array of string
- band_wavelengths – array of double
- missing_band_action – int, 0 = esriMissingBandActionFindBestMatch, 1 = esriMissingBandActionFail
- wavelength_match_tolerance – double
- astype – output pixel type
Returns: the output raster
FLOAT¶
-
functions.
FLOAT
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Float operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
float_divide¶
-
functions.
float_divide
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The FloatDivide operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
floor_divide¶
-
functions.
floor_divide
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The FloorDivide operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
gemi¶
-
functions.
gemi
(raster, band_indexes='4 3', astype=None)¶ Global Environmental Monitoring Index GEMI = eta*(1-0.25*eta)-((Red-0.125)/(1-Red)) where eta = (2*(NIR^2-Red^2)+1.5*NIR+0.5*Red)/(NIR+Red+0.5)
Parameters: raster – the input raster / imagery layer :param band_indexes:”NIR Red”, e.g., “4 3” :param astype: output pixel type :return: output raster
geometric¶
-
functions.
geometric
(raster, geodata_transforms=None, append_geodata_xform=None, z_factor=None, z_offset=None, constant_z=None, correct_geoid=None, astype=None)¶ The geometric function transforms the image (for example, orthorectification) based on a sensor definition and a terrain model.This function was added at 10.1.The arguments for the geometric function are as follows:
Parameters: - raster – input raster
- geodata_transforms – Please refer to the Geodata Transformations documentation for more details.
- append_geodata_xform – boolean
- z_factor – double
- z_offset – double
- constant_z – double
- correct_geoid – boolean
- astype – output pixel type
Returns: the output raster
greater_than¶
-
functions.
greater_than
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The GreaterThan operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
greater_than_equal¶
-
functions.
greater_than_equal
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The GreaterThanEqual operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
gvitm¶
-
functions.
gvitm
(raster, band_indexes='1 2 3 4 5 6', astype=None)¶ Green Vegetation Index - Landsat TM GVITM = -0.2848*Band1-0.2435*Band2-0.5436*Band3+0.7243*Band4+0.0840*Band5-1.1800*Band7
Parameters: raster – the input raster / imagery layer :param band_indexes:”NIR Red”, e.g., “4 3” :param astype: output pixel type :return: output raster
hillshade¶
-
functions.
hillshade
(dem, azimuth=215.0, altitude=75.0, z_factor=0.3, slope_type=1, ps_power=None, psz_factor=None, remove_edge_effect=None, astype=None)¶ A hillshade is a grayscale 3D model of the surface taking the sun’s relative position into account to shade the image. For more information, see <a href=’http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/hillshade-function.htm’>hillshade function</a> and <a href=”http://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/how-hillshade-works.htm”>How hillshade works.</a> The arguments for the hillshade function are as follows:
Parameters: - dem – input DEM
- azimuth – double (e.g. 215.0)
- altitude – double (e.g. 75.0)
- z_factor – double (e.g. 0.3)
- slope_type – new at 10.2. 1=DEGREE, 2=PERCENTRISE, 3=SCALED. default is 1.
- ps_power – new at 10.2. double, used together with SCALED slope type
- psz_factor – new at 10.2. double, used together with SCALED slope type
- remove_edge_effect – new at 10.2. boolean, true of false
- astype – output pixel type
Returns: the output raster
INT¶
-
functions.
INT
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Int operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
is_null¶
-
functions.
is_null
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The IsNull operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
less_than¶
-
functions.
less_than
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The LessThan operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
less_than_equal¶
-
functions.
less_than_equal
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The LessThanEqual operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
ln¶
-
functions.
ln
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Ln operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
local¶
-
functions.
local
(rasters, operation, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The local function allows you to perform bitwise, conditional, logical, mathematical, and statistical operations on a pixel-by-pixel basis. For more information, see <a href=”http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/local-function.htm”>local function</a>.
- License:At 10.5, you must license your ArcGIS Server as ArcGIS Server 10.5.1 Enterprise Advanced or
- ArcGIS Image Server to use this resource. At versions prior to 10.5, the hosting ArcGIS Server needs to have a Spatial Analyst license.
The arguments for the local function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- operation – int see reference at http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//004000000149000000
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
log10¶
-
functions.
log10
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Log10 operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
log2¶
-
functions.
log2
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Log2 operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
majority¶
-
functions.
majority
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None)¶ The Majority operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- ignore_nodata – True or False, set to True to ignore NoData values
- astype – output pixel type
Returns: the output raster
mask¶
-
functions.
mask
(raster, no_data_values=None, included_ranges=None, no_data_interpretation=None, astype=None)¶ The mask function changes the image by specifying a certain pixel value or a range of pixel values as no data. The arguments for the mask function are as follows:
Parameters: - raster – input raster
- no_data_values – array of string [“band0_val”,”band1_val”,…]
- included_ranges – array of double [band0_lowerbound,band0_upperbound,band1…],
- no_data_interpretation – int 0=MatchAny, 1=MatchAll
- astype – output pixel type
Returns: the output raster
max¶
-
functions.
max
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None)¶ The Max operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
mean¶
-
functions.
mean
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None)¶ The Mean operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- ignore_nodata – True or False, set to True to ignore NoData values
- astype – output pixel type
Returns: the output raster
med¶
-
functions.
med
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None)¶ The Med operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- ignore_nodata – True or False, set to True to ignore NoData values
- astype – output pixel type
Returns: the output raster
min¶
-
functions.
min
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None)¶ The Min operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- ignore_nodata – True or False, set to True to ignore NoData values
- astype – output pixel type
Returns: the output raster
minority¶
-
functions.
minority
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None)¶ The Minority operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- ignore_nodata – True or False, set to True to ignore NoData values
- astype – output pixel type
Returns: the output raster
minus¶
-
functions.
minus
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The binary Minus (subtraction,-) operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
ml_classify¶
-
functions.
ml_classify
(raster, signature, astype=None)¶ - The ml_classify function allows you to perform a supervised classification using the maximum likelihood classification
- algorithm. The hosting ArcGIS Server needs to have a Spatial Analyst license.LicenseLicense:At 10.5, you must license your ArcGIS Server as ArcGIS Server 10.5.1 Enterprise Advanced or ArcGIS Image Server to use this resource. At versions prior to 10.5, the hosting ArcGIS Server needs to have a Spatial Analyst license. The arguments for the ml_classify function are as follows:
Parameters: - raster – input raster
- signature – string. a signature string returned from computeClassStatistics (GSG)
- astype – output pixel type
Returns: the output raster
mod¶
-
functions.
mod
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Mod operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
mode¶
msavi¶
-
functions.
msavi
(raster, band_indexes='4 3', astype=None)¶ Modified Soil Adjusted Vegetation Index MSAVI2 = (1/2)*(2(NIR+1)-sqrt((2*NIR+1)^2-8(NIR-Red)))
Parameters: - raster – the input raster / imagery layer
- band_indexes – “NIR Red”, e.g., “4 3”
- astype – output pixel type
Returns: output raster
MULTIPLY¶
ndvi¶
-
functions.
ndvi
(raster, band_indexes='4 3', astype=None)¶ Normalized Difference Vegetation Index NDVI = ((NIR - Red)/(NIR + Red))
Parameters: - raster – the input raster / imagery layer
- band_indexes – Band Indexes “NIR Red”, e.g., “4 3”
- astype – output pixel type
Returns: Normalized Difference Vegetation Index raster
negate¶
-
functions.
negate
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Negate operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
not_equal¶
-
functions.
not_equal
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The NotEqual operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
plus¶
-
functions.
plus
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The binary Plus (addition,+) operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
power¶
-
functions.
power
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Power operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
pvi¶
-
functions.
pvi
(raster, band_indexes='4 3 0.3 0.5', astype=None)¶ Perpendicular Vegetation Index PVI = (NIR-a*Red-b)/(sqrt(1+a^2))
Parameters: raster – the input raster / imagery layer :param band_indexes:”NIR Red a b”, e.g., “4 3 0.3 0.5” :param astype: output pixel type :return: output raster
cellstats_range¶
-
functions.
cellstats_range
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None)¶ The Range operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- ignore_nodata – True or False, set to True to ignore NoData values
- astype – output pixel type
Returns: the output raster
remap¶
-
functions.
remap
(raster, input_ranges=None, output_values=None, geometry_type=None, geometries=None, no_data_ranges=None, allow_unmatched=None, astype=None)¶ The remap function allows you to change or reclassify the pixel values of the raster data. For more information, see <a href=”http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/remap-function.htm”>remap function</a>.
The arguments for the remap function are as follows:
Parameters: - raster – input raster
- input_ranges – [double, double,…], input ranges are specified in pairs: from (inclusive) and to (exclusive).
- output_values – [double, …], output values of corresponding input ranges
- geometry_type – added at 10.3
- geometries – added at 10.3
- no_data_ranges – [double, double, …], nodata ranges are specified in pairs: from (inclusive) and to (exclusive).
- allow_unmatched – Boolean, specify whether to keep the unmatched values or turn into nodata.
- astype – output pixel type
Returns: the output raster
resample¶
-
functions.
resample
(raster, resampling_type=None, input_cellsize=None, astype=None)¶ The resample function resamples pixel values from a given resolution.The arguments for the resample function are as follows:
Parameters: - raster – input raster
- resampling_type – one of NearestNeighbor,Bilinear,Cubic,Majority,BilinearInterpolationPlus,BilinearGaussBlur, BilinearGaussBlurPlus, Average, Minimum, Maximum,VectorAverage(require two bands)
- input_cellsize – point that defines cellsize in source spatial reference
- astype – output pixel type
Returns: the output raster
round_down¶
-
functions.
round_down
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The RoundDown operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
round_up¶
-
functions.
round_up
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The RoundUp operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
savi¶
-
functions.
savi
(raster, band_indexes='4 3 0.33', astype=None)¶ Soil-Adjusted Vegetation Index SAVI = ((NIR - Red) / (NIR + Red + L)) x (1 + L) where L represents amount of green vegetative cover, e.g., 0.5
Parameters: - raster – the input raster / imagery layer
- band_indexes – “BandIndexes”: “NIR Red L”, for example, “4 3 0.33”
- astype – output pixel type
Returns: output raster
segment_mean_shift¶
-
functions.
segment_mean_shift
(raster, spectral_detail=None, spatial_detail=None, spectral_radius=None, spatial_radius=None, min_num_pixels_per_segment=None, astype=None)¶ The segment_mean_shift function produces a segmented output. Pixel values in the output image represent the converged RGB colors of the segment. The input raster needs to be a 3-band 8-bit image. If the imagery layer is not a 3-band 8-bit unsigned image, you can use the Stretch function before the segment_mean_shift function.
License:At 10.5, you must license your ArcGIS Server as ArcGIS Server 10.5.1 Enterprise Advanced or ArcGIS Image Server to use this resource. At versions prior to 10.5, the hosting ArcGIS Server needs to have a Spatial Analyst license.
When specifying arguments for SegmentMeanShift, use either SpectralDetail,SpatialDetail as a pair, or use SpectralRadius, SpatialRadius. They have an inverse relationship. SpectralRadius = 21 - SpectralDetail, SpatialRadius = 21 - SpectralRadius
The arguments for the segment_mean_shift function are as follows:
Parameters: - raster – input raster
- spectral_detail – double 0-21. Bigger value is faster and has more segments.
- spatial_detail – int 0-21. Bigger value is faster and has more segments.
- spectral_radius – double. Bigger value is slower and has less segments.
- spatial_radius – int. Bigger value is slower and has less segments.
- min_num_pixels_per_segment – int
- astype – output pixel type
Returns: the output raster
set_null¶
-
functions.
set_null
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The SetNull operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
shaded_relief¶
-
functions.
shaded_relief
(raster, azimuth=None, altitude=None, z_factor=None, colormap=None, slope_type=None, ps_power=None, psz_factor=None, remove_edge_effect=None, astype=None)¶ Shaded relief is a color 3D model of the terrain, created by merging the images from the Elevation-coded and Hillshade methods. For more information, see <a href=”http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/shaded-relief-function.htm”>Shaded relief</a> function.
The arguments for the shaded_relief function are as follows:
Parameters: - raster – input raster
- azimuth – double (e.g. 215.0)
- altitude – double (e.g. 75.0)
- z_factor – double (e.g. 0.3)
- colormap – [[<value1>, <red1>, <green1>, <blue1>], [<value2>, <red2>, <green2>, <blue2>]]
- slope_type – 1=DEGREE, 2=PERCENTRISE, 3=SCALED. default is 1.
- ps_power – double, used together with SCALED slope type
- psz_factor – double, used together with SCALED slope type
- remove_edge_effect – boolean, True or False
- astype – output pixel type
Returns: the output raster
sin¶
-
functions.
sin
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Sin operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
sinh¶
-
functions.
sinh
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The SinH operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
slope¶
-
functions.
slope
(dem, z_factor=None, slope_type=None, ps_power=None, psz_factor=None, remove_edge_effect=None, astype=None)¶ slope represents the rate of change of elevation for each pixel. For more information, see <a href=”http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/slope-function.htm”>slope function</a> and <a href=”http://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/how-slope-works.htm”>How slope works</a>. The arguments for the slope function are as follows:
Parameters: - dem – input DEM
- z_factor – double (e.g. 0.3)
- slope_type – new at 10.2. 1=DEGREE, 2=PERCENTRISE, 3=SCALED. default is 1.
- ps_power – new at 10.2. double, used together with SCALED slope type
- psz_factor – new at 10.2. double, used together with SCALED slope type
- remove_edge_effect – new at 10.2. boolean, true of false
- astype – output pixel type
Returns: the output raster
sqrt¶
-
functions.
sqrt
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Square Root operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
square¶
-
functions.
square
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Square operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
focal_statistics¶
-
functions.
focal_statistics
(raster, kernel_columns=None, kernel_rows=None, stat_type=None, columns=None, rows=None, fill_no_data_only=None, astype=None)¶ The focal_statistics function calculates focal statistics for each pixel of an image based on a defined focal neighborhood. For more information, see <a href=”http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/statistics-function.htm”>statistics function</a>. The arguments for the statistics function are as follows:
Parameters: - raster – input raster
- kernel_columns – int (e.g. 3)
- kernel_rows – int (e.g. 3)
- stat_type – int 1=Min, 2=Max, 3=Mean, 4=StandardDeviation
- columns – int (e.g. 3)
- rows – int (e.g. 3)
- fill_no_data_only – bool
- astype – output pixel type
Returns: the output raster
std¶
-
functions.
std
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None)¶ The Std operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- ignore_nodata – True or False, set to True to ignore NoData values
- astype – output pixel type
Returns: the output raster
stretch¶
-
functions.
stretch
(raster, stretch_type=0, min=None, max=None, num_stddev=None, statistics=None, dra=None, min_percent=None, max_percent=None, gamma=None, compute_gamma=None, sigmoid_strength_level=None, astype=None)¶ The stretch function enhances an image through multiple stretch types. For more information, see <a href=”http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/stretch-function.htm”>stretch function</a>.
Gamma stretch works with all stretch types. The Gamma parameter is needed when UseGamma is set to true. Min and Max can be used to define output minimum and maximum. DRA is used to get statistics from the extent in the export_image request. ComputeGamma will automatically calculate best gamma value to render exported image based on empirical model.
Stretch type None does not require other parameters. Stretch type StdDev requires NumberOfStandardDeviations, Statistics, or DRA (true). Stretch type Histogram (Histogram Equalization) requires the source dataset to have histograms or additional DRA (true). Stretch type MinMax requires Statistics or DRA (true). Stretch type PercentClip requires MinPercent, MaxPercent, and DRA (true), or histograms from the source dataset. Stretch type Sigmoid does not require other parameters.
Optionally, set the SigmoidStrengthLevel (1 to 6) to adjust the curvature of Sigmoid curve used in color stretch.
The arguments for the stretch function are as follows:
Parameters: - raster – input raster
- stretch_type – str, one of None, StdDev, Histogram, MinMax, PercentClip, 9 = Sigmoid
- min – double
- max – double
- num_stddev – double (e.g. 2.5)
- statistics – double (e.g. 2.5)[<min1>, <max1>, <mean1>, <standardDeviation1>], //[double, double, double, double][<min2>, <max2>, <mean2>, <standardDeviation2>]],
- dra – boolean. derive statistics from current request, Statistics parameter is ignored when DRA is true
- min_percent – double (e.g. 0.25), applicable to PercentClip
- max_percent – double (e.g. 0.5), applicable to PercentClip
- gamma – array of doubles
- compute_gamma – optional, applicable to any stretch type when “UseGamma” is “true”
- sigmoid_strength_level – int (1~6), applicable to Sigmoid
- astype – output pixel type
Returns: the output raster
sultan¶
-
functions.
sultan
(raster, band_indexes='1 2 3 4 5 6', astype=None)¶ - Sultan’s Formula (transform to 3 band 8 bit image)
- Band 1 = (Band5 / Band6) x 100 Band 2 = (Band5 / Band1) x 100 Band 3 = (Band3 / Band4) x (Band5 / Band4) x 100
Parameters: raster – the input raster / imagery layer :param band_indexes:”Band1 Band2 Band3 Band4 Band5 Band6”, e.g., “1 2 3 4 5 6” :param astype: output pixel type :return: output raster
sum¶
-
functions.
sum
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None)¶ The Sum operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- ignore_nodata – True or False, set to True to ignore NoData values
- astype – output pixel type
Returns: the output raster
tan¶
-
functions.
tan
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Tan operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
tanh¶
-
functions.
tanh
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The TanH operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
threshold¶
-
functions.
threshold
(raster, astype=None)¶ - The binary threshold function produces the binary image. It uses the Otsu method and assumes the input image to have
- a bi-modal histogram. The arguments for the threshold function are as follows:
Parameters: - raster – input raster
- astype – output pixel type
Returns: the output raster
times¶
-
functions.
times
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', astype=None)¶ The Times (multiplication,*) operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- astype – output pixel type
Returns: the output raster
transpose_bits¶
-
functions.
transpose_bits
(raster, input_bit_positions=None, output_bit_positions=None, constant_fill_check=None, constant_fill_value=None, fill_raster=None, astype=None)¶ The transpose_bits function performs a bit operation. It extracts bit values from the source data and assigns them to new bits in the output data.The arguments for the transpose_bits function are as follows:
If constant_fill_check is False, it assumes there is an input fill_raster. If an input fill_raster is not given, it falls back constant_fill_check to True and looks for constant_fill_value. Filling is used to initialize pixel values of the output raster. Landsat 8 has a quality assessment band. The following are the example input and output bit positions to extract confidence levels by mapping them to 0-3: * Landsat 8 Water: {“input_bit_positions”:[4,5],”output_bit_positions”:[0,1]} * Landsat 8 Cloud Shadow: {“input_bit_positions”:[6,7],”output_bit_positions”:[0,1]} * Landsat 8 Vegetation: {“input_bit_positions”:[8,9],”output_bit_positions”:[0,1]} * Landsat 8 Snow/Ice: {“input_bit_positions”:[10,11],”output_bit_positions”:[0,1]} * Landsat 8 Cirrus: {“input_bit_positions”:[12,13],”output_bit_positions”:[0,1]} * Landsat 8 Cloud: {“input_bit_positions”:[14,15],”output_bit_positions”:[0,1]} * Landsat 8 Designated Fill: {“input_bit_positions”:[0],”output_bit_positions”:[0]} * Landsat 8 Dropped Frame: {“input_bit_positions”:[1],”output_bit_positions”:[0]} * Landsat 8 Terrain Occlusion: {“input_bit_positions”:[2],”output_bit_positions”:[0]}
Parameters: - raster – input raster
- input_bit_positions – array of long, required
- output_bit_positions – array of long, required
- constant_fill_check – bool, optional
- constant_fill_value – int, required
- fill_raster – optional, the fill raster
- astype – output pixel type
Returns: the output raster
tsavi¶
-
functions.
tsavi
(raster, band_indexes='4 3 0.33 0.50 1.50', astype=None)¶ Transformed Soil Adjusted Vegetation Index TSAVI = (s(NIR-s*Red-a))/(a*NIR+Red-a*s+X*(1+s^2))
Parameters: - raster – the input raster / imagery layer
- band_indexes – “NIR Red s a X”, e.g., “4 3 0.33 0.50 1.50” where a = the soil line intercept, s = the soil line slope, X = an adjustment factor that is set to minimize soil noise
- astype – output pixel type
Returns: output raster
unit_conversion¶
-
functions.
unit_conversion
(raster, from_unit=None, to_unit=None, astype=None)¶ The unit_conversion function performs unit conversions.The arguments for the unit_conversion function are as follows: from_unit and to_unit take the following str values: Speed Units: MetersPerSecond, KilometersPerHour, Knots, FeetPerSecond, MilesPerHour Temperature Units: Celsius,Fahrenheit,Kelvin Distance Units: str, one of Inches, Feet, Yards, Miles, NauticalMiles, Millimeters, Centimeters, Meters
Parameters: - raster – input raster
- from_unit – units constant listed below (int)
- to_unit – units constant listed below (int)
- astype – output pixel type
Returns: the output raster
variety¶
-
functions.
variety
(rasters, extent_type='FirstOf', cellsize_type='FirstOf', ignore_nodata=False, astype=None)¶ The Variety operation
The arguments for this function are as follows:
Parameters: - rasters – array of rasters. If a scalar is needed for the operation, the scalar can be a double or string
- extent_type – one of “FirstOf”, “IntersectionOf”, “UnionOf”, “LastOf”
- cellsize_type – one of “FirstOf”, “MinOf”, “MaxOf, “MeanOf”, “LastOf”
- ignore_nodata – True or False, set to True to ignore NoData values
- astype – output pixel type
Returns: the output raster
vector_field_renderer¶
-
functions.
vector_field_renderer
(raster, is_uv_components=None, reference_system=None, mass_flow_angle_representation=None, calculation_method='Vector Average', symbology_name='Single Arrow', astype=None)¶ The vector_field_renderer function symbolizes a U-V or Magnitude-Direction raster.The arguments for the vector_field_renderer function are as follows:
Parameters: - raster – input raster
- is_uv_components – bool
- reference_system – int 1=Arithmetic, 2=Angular
- mass_flow_angle_representation – int 0=from 1=to
- calculation_method – string, “Vector Average” |
- symbology_name – string, “Single Arrow” |
- astype – output pixel type
Returns: the output raster