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
methodas input and calls the right method using either user predefined or default parameters. The calculated distance raster is then stored in thedistance_rasterattribute 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 aRasterLayerneeds to be passed to therasterparameter 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 therasterattribute. If None is used, then the predefineddistance_methodattribute of theVectorLayerclass is used instead.- raster: RasterLayer
Raster layer used as base or friction layer depending on the
methodused (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.