onstove.VectorLayer.get_distance_raster#
- VectorLayer.get_distance_raster(method: str = None, raster: str | RasterLayer | None = None, output_path: str | None = None)[source]#
This method calls the specified distance calculation method.
It takes a
method
as input and calls the right method using either user predefined or default parameters. The calculated distance raster is then stored in thedistance_raster
attribute of the class.- Parameters:
- method: str, optional
Name of the method to use for the distance calculation. It can take “proximity”, “travel_time” or None as options. If “proximity” is used, then the
proximity()
method is called and aRasterLayer
needs to be passed to theraster
parameter as base layer to use for the calculation. If “travel_time” is used, then thetravel_time()
method is called and a friction layer can be passed to theraster
attribute. If None is used, then the predefineddistance_method
attribute of theVectorLayer
class is used instead.- raster: RasterLayer
Raster layer used as base or friction layer depending on the
method
used (see above).- output_path: str, optional
A folder path where to save the output dataset. If not defined then the distance raster dataset is not saved.