onstove.RasterLayer.travel_time#
- RasterLayer.travel_time(rows: ndarray, cols: ndarray, include_starting_cells: bool = False, output_path: str | None = None, create_raster: bool | None = True) RasterLayer[source]#
Calculates a travel time map using the raster data as cost surface and specific cells as starting points.
This method uses the data of the current
RasterLayeras a cost surface, to calculate the distance-weighted minimum cost map from specific cells (rowsandcols) to every other cell in the cost surface. It makes use of the skimage.graph.mcp.MCP_Geometric class.- Parameters:
- rows: np.ndarray
Row indexes of the cells to consider as starting points.
- cols: np.ndarray
Column indexes of the cells to consider as starting points.
- include_starting_cells: boolean, default `False`
Indicates whether to include the cost of the starting cells in the least cost path calculation.
- output_path: str, optional
A folder path where to save the output dataset. If not defined then the travel time dataset is not saved to disk.
- create_raster: bool, default True
Boolean condition. If True, a
RasterLayerwill be created and stored in thedistance_rasterattribute of the class. If False, aRasterLayerwith the travel time calculation is returned.
- Returns:
- RasterLayer
RasterLayerwith the least-cost travel time data.