Select to view content in your preferred language

How exactly does Sample (Spatial analysis tools) work

150
3
a month ago
Ben4
by
New Contributor

Hi All,

Sorry if this is a silly question but I am having trouble digesting the ArcGIS Pro website. Do you all know exactly how the Sample tool works, I'm having trouble and cant understand. Does it take the value of the center cell within a polygon, or is it taking the mean of all the cells within the polygon? If anyone else has experience with it and can explain what is going on that would be super helpful!

Thanks,

Ben

0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

Sample (Spatial Analyst)—ArcGIS Pro | Documentation

How Sample works—ArcGIS Pro | Documentation

Locations are defined by the input type as described in the 4th bullet point.

Perhaps you could clarify whether you are using a raster, points or polyline/polygon as inputs.

The latter has a qualifier.

The mean value of all cells that intersect each polyline or polygon will be calculated if the input is a two-dimensional raster or multiple rasters. Additional statistic types can be specified if the input is a multidimensional raster and is processed as multidimensional.

the second link explains subtlies for multidimensional rasters etc.


... sort of retired...
0 Kudos
Ben4
by
New Contributor

Hi Dan,

I am using a polygon, as my input to sample a raster. Does this mean that sample is taking a mean of all cells intersecting and within the polygon? Is the value that Sample returns a Mean of all of the means of all the cells or is it a mean of all the cells?

Thanks,

Ben 

0 Kudos
DanPatterson
MVP Esteemed Contributor

Are you not getting multiple locations for your polygon input featureclass?

Run a quick test with your data.

Select one polygon. export it to its own featureclass.  Compare to your other run.

Also, check the help again

Sample (Spatial Analyst)—ArcGIS Pro | Documentation

way down

If the Generate Feature Class parameter is checked (generate_feature_class = "FEATURE_CLASS" in Python), the output is a point feature class with the sampled values in its attribute table......

Raster—Points will be created using the location of the cell center.
Point—A point will be created at each of the point locations.
Polyline or polygon—A point will be created at each polygon or polyline centroid.


... sort of retired...
0 Kudos