Extract Values to Points
Adds to each point the value of the raster at its location.
Pitfall. Points and raster in different CRSs give wrong or empty values unless the engine reprojects the points first.
Pitfall. Some engines interpolate by default, so values differ from the cell's value except at cell centres.
Pitfall. Points outside the raster or on nodata cells get nodata, null or an error depending on the engine.
| Also called | sample raster values, raster sampling, point query, Extract Multi Values to Points, drill a raster |
|---|---|
| Group | raster/extraction |
| Checks | crs.agreement, raster.nodata |
| Pitfalls | 3 listed above |
| Columbus tool | Not stated |
| Notes | Not stated |
| Status | active |
| Broader | Not stated |
| Narrower | Not stated |
| Related |
Parameters
| Name | Type | Required | Default | Values | Note |
|---|---|---|---|---|---|
resampling | enum | no | nearest | nearest, bilinear | nearest: the value of the cell the point falls in; bilinear: interpolated from the four nearest cell centres. |
Inputs and outputs
| Direction | Name | Type | Geometry | Note |
|---|---|---|---|---|
| Input | points | vector | point | Not stated |
| Input | raster | raster | Not stated | Not stated |
| Output | output | vector | point | Not stated |
In each engine
| Engine | Tool | Parameters | Differences |
|---|---|---|---|
gdal | gdal raster pixel-info |
|
|
grass | v.what.rast |
|
|
postgis-raster | st_value |
|
Preset: {"band":1} |
qgis | native:rastersampling |
|
|
rasterio | rasterio.sample.sample_gen |
|
|
rasterstats | rasterstats.gen_point_query |
|
|
terra | terra::extract |
|
|
whiteboxtools | ExtractRasterValuesAtPoints |
|
|