sample_raster#
module wntr.gis.geospatial
- sample_raster(A, filepath, bands=1)[source]#
Sample a raster (e.g., GeoTIFF file) using Points in GeoDataFrame A.
This function can take either a filepath to a raster or a virtual raster (VRT), which combines multiple raster tiles into a single object. The function opens the raster(s) and samples it at the coordinates of the point geometries in A. This function assigns nan to values that match the raster’s nodata attribute. These sampled values are returned as a Series which has an index matching A.
- Parameters:
- Returns:
Pandas Series containing the sampled values for each geometry in gdf
- Return type:
Series