revrt.spatial_characterization.cli.buffered_route_characterizations#

buffered_route_characterizations(geotiff_fp, route_fp, row_widths=None, row_width_ranges=None, multiplier_scalar=1.0, prefix=None, copy_properties=None, parallel=False, row_width_key='voltage', chunks='auto', **kwargs)[source]#

Compute route characterizations/statistics

Each route is buffered before computing statistics.

Parameters:
  • geotiff_fp (path-like) – Path to the raster file.

  • route_fp (path-like) – Path to the vector file of routes. Must contain a “geometry” column and the row_width_key column (used to map to path ROW width).

  • row_widths (dict, optional) – A dictionary specifying the row widths in the following format: {"row_width_id": row_width_meters}. The row_width_id is a value used to match each route with a particular ROW width (this is typically a voltage). The value should be found under the row_width_key entry of the route_fp.

    Important

    At least one of row_widths or row_width_ranges must be provided.

    By default, None.

  • row_width_ranges (list, optional) – Optional list of dictionaries, where each dictionary contains the keys “min”, “max”, and “width”. This can be used to specify row widths based on ranges of values (e.g. voltage). For example, the following input:

    [
        {"min": 0, "max": 70, "width": 20},
        {"min": 70, "max": 150, "width": 30},
        {"min": 200, "max": 350, "width": 40},
        {"min": 400, "max": 500, "width": 50},
    ]
    

    would map voltages in the range 0 <= volt < 70 to a row width of 20 meters, 70 <= volt < 150 to a row width of 30 meters, 200 <= volt < 350 to a row width of 40 meters, and so-on.

    Important

    Any values in the row_widths dict will take precedence over these ranges. So if a voltage of 138 kV is mapped to a row width of 25 meters in the row_widths dict, that value will be used instead of the 30 meter width specified by the ranges above.

    By default, None.

  • multiplier_scalar (float, optional) – Optional multiplier value to apply to layer before computing statistics. This is useful if you want to scale the values in the raster before computing statistics. By default, 1.0.

  • prefix (str, optional) – A string representing a prefix to add to each stat name. If you wish to have the prefix separated by a delimiter, you must include it in this string (e.g. prefix="test_"). By default, None.

  • copy_properties (iterable of str, optional) – Iterable of columns names to copy over from the zone feature. By default, None.

  • parallel (bool, optional) – Option to perform processing in parallel using dask. By default, False.

  • row_width_key (str, default "voltage") – Name of column in vector file of routes used to map to the ROW widths. By default, "voltage".

  • chunks (tuple or str, default "auto") – chunks keyword argument to pass down to rioxarray.open_rasterio(). Use this to control the Dask chunk size. By default, "auto".

Returns:

pd.DataFrame – Pandas DataFrame containing computed characteristics/stats.