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 the distance_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 a RasterLayer needs to be passed to the raster parameter as base layer to use for the calculation. If “travel_time” is used, then the travel_time() method is called and a friction layer can be passed to the raster attribute. If None is used, then the predefined distance_method attribute of the VectorLayer 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.