The Sample tool extracts cell values from all of the input rasters at each input feature location.
The output is a hosted table layer or a hosted feature layer.
Examples
Some example applications of this tool include the following:
- Extract attributes for cell tower location from multiple rasters, such as land use, soil type, elevation, and distance to road.
- Extract soil temperature at different depths for a given set of points.
- From 30 years of monthly sea-surface temperature data, summarize at animal locations or within home ranges for a given time when an animal species was observed.
Usage notes
The Sample tool includes configurations for input layers, sample settings, and the result layer.
Input layer
The Input layer group includes the following parameters:
Imagery layer is the image or list of images whose values will be sampled based on the input location data.
Any combination of rasters, such as single band, multiband, multidimensional, or multivariate, can be provided as input rasters. The structure of the output table changes when the input rasters are multidimensional. When a multiband raster is provided as one of the input rasters, all of the bands in that input will be used. To process a selection of bands from an input multiband raster, first create a raster dataset composed of those particular bands. Then use the result in the list of input rasters.
To sample all slices from a multidimensional imagery layer, it must be the only input raster.- Location layer is the layer that identifies the positions that will be sampled. The following layer types are supported:
- Raster—Pixels containing valid values (not NoData) are used to extract the pixel values from all input rasters, and the center of the pixel is used for point locations.
- Point—Values will be sampled at each point location.
The count of features depends on additional factors such as filtering criteria and the analysis extent.
- Polyline or polygon—Values will be sampled at the polygon or polyline centroid. If the input raster is multidimensional, the values will be aggregated based on the Statistics type value.
The count of features depends on additional factors such as filtering criteria and the analysis extent.
Sample settings
The Sample settings group includes the following parameters:
- Resampling technique specifies the resampling algorithm that will be used. The options are as follows:
- Nearest—Nearest neighbor, which uses the value of the closest cell to assign a value to the output cell when resampling. This is the default.
- Bilinear—Bilinear interpolation, which determines the new value of a cell based on a weighted distance average of the four nearest input cell centers.
- Cubic—Cubic convolution, which determines the new value of a cell based on fitting a smooth curve through the 16 nearest input cell centers.
- Unique ID field is a field in the layer that contains a different value for each location or input feature.
- Process as multidimensional specifies whether the input imagery layers include multidimensional data.
- Acquisition information of location data specifies the time, depth, or other acquisition data associated with the location cells or features. This parameter is available when Process as multidimensional is enabled and includes the following subparameters:
- Dimension—The dimension from the multidimensional input layer.
- Start field or value—The field or dimension value that will be used to start the time range. Specify a field from the multidimensional input layer or provide a value.
- End field or value—The field or dimension value that will be used to end the time range. Specify a field from the multidimensional input layer or provide a value.
- Relative value or days before—Specifies a nonnegative number to add to the Dimension field or value to define the start of a dimension value range.
- Relative value or days after—Specifies a nonnegative number to add to the Dimension field or value to define the end of a dimension value range.
- Statistics type specifies the type of statistics that will be calculated. This parameter is available when Process as multidimensional is enabled. The following options are available:
- Minimum—Finds the minimum value within the specified range.
- Maximum—Finds the maximum value within the specified range.
- Median—Finds the median value within the specified range.
- Mean—Calculates the average for the specified range.
- Sum—Calculates the sum of the variables within the specified range.
- Majority—Finds the value that occurs most frequently.
- Minority—Finds the value that occurs least frequently.
- Standard Deviation—Calculates the standard deviation.
- Percentile—Calculates a defined percentile within the specified range.
- Percentile value specifies the percentile that will be used for sampling. This parameter is available when Process as multidimensional is enabled and Percentile is specified as the Statistics type value.
This value can range from 0 to 100. The default is 90.
- Buffer distance field or value is the distance around the location data features used for sampling multidimensional imagery layers. This parameter is available when Process as multidimensional is enabled.
Result layer
The Result layer group includes the following parameters:
- Output name specifies the name of the layer that is created and displayed. The name must be unique. If a layer with the same name already exists in your organization, the tool will fail and you will be prompted to use a different name.
- Output type is the type of layer that will be created. The output can be either a table layer or a feature layer.
- Output layout specifies whether sampled values will appear in rows or columns in the output table. This parameter is only available when the Imagery layer(s) parameter value is a multidimensional raster that contains one variable and one dimension, and each slice is a single-band raster.
- Save in folder specifies the name of a folder in My content where the result will be saved.
Environments
Analysis environment settings are additional parameters that affect a tool's results. You can access the tool's analysis environment settings from the Environment settings parameter group.
This tool honors the following analysis environments:
- Output coordinate system
- Processing extent
Note:
The default processing extent is Full extent. This default is different from Map Viewer Classic in which Use current map extent is enabled by default.
- Mask
- Parallel processing factor
Outputs
This tool includes the following outputs:
- A feature layer with the pixel values from the source imagery layers for each input location in the attribute table. A feature layer is created if the Output type parameter is set to Features. The feature layer will include the following fields:
- X—Indicates the horizontal coordinate of the input point.
- Y—Indicates the vertical coordinate of the input point.
- Fields containing values for each raster band or source raster (the name of the raster band will be included in the field name).
Note:
If the input layer is multidimensional, the output will include a field for each of the specified time slices.
- A table layer with the pixel values from the source imagery layers for each input location in the attribute table. A table layer is created if the Output type parameter is set to Table. The table layer will include the following columns:
- X—Indicates the horizontal coordinate of the input point.
- Y—Indicates the vertical coordinate of the input point.
- Columns containing values for each raster band or source raster (the name of the raster band will be included in the column name).
Usage requirements
This tool requires the following user type and configurations:
- Creator, Professional, or Professional Plus user type
- Publisher or Administrator role, or an equivalent custom role
- Available when the organization is configured for raster analytics with a premium capability license
Resources
Use the following resources to learn more: