geost.spatial.get_raster_values#
- geost.spatial.get_raster_values(x: ndarray, y: ndarray, raster_to_read: str | Path | DataArray) ndarray [source]#
Return sampled values from a raster at the given (x, y) locations.
- Parameters:
x (np.ndarray) – 1D array of x-coordinates, same length as ‘y’.
y (np.ndarray) – 1D array of y-coordinates, same length as ‘x’.
raster_to_read (str | Path | xr.DataArray) – Location of a raster file or an xr.DataArray with dimensions ‘x’ and ‘y’. This raster is used to sample values from at all (x, y) locations.
- Returns:
1D array of sampled values
- Return type:
np.ndarray