reVX.setbacks.setbacks_cli.preprocess_setbacks_config

preprocess_setbacks_config(config, features, generic_setback_multiplier=None)[source]

Pre-process setbacks computation config.

Parameters:
  • config (dict) – Setbacks compute config. This config will be updated to include a the node_feature_type, node_file_path, and node_multiplier keys based on user input.

  • features (dict) – Dictionary specifying which features/data to process. The keys of this dictionary must be the a key from the SETBACK_SPECS dictionary or the feature_specs input dictionary specifying the feature type to run setbacks for. The value of each key must be a path or a list of paths to calculate that particular setback for. The path(s) can contain unix-style file-pattern matching syntax to point to multiple files. The paths may be specified relative to the config file. For example:

    features: {
        "parcel": "../relative/path/to/parcel_colorado.gpkg",
        "road": [
            "/full/path/to/road/data/*.gpkg",
            "../../relative/path/to/data_i[l,n].gpkg",
        ]
    }
    

    With this input, parcel setbacks would be computed for the data in ../relative/path/to/parcel_colorado.gpkg, and road setbacks would be calculated for all GeoPackage data files in /full/path/to/road/data/ and for the files ../../relative/path/to/data_il.gpkg and ../../relative/path/to/data_in.gpkg.

  • generic_setback_multiplier (int | float | str, optional) – Optional setback multiplier to use where local regulations are not supplied. This multiplier will be applied to the base_setback_dist (or the turbine tip-height) to calculate the setback. If supplied along with regulations_fpath, this input will be used to apply a setback to all counties not listed in the regulations file. This input can also be a path to a config file containing feature types as keys and feature-specific generic multipliers as values. For example:

    {
        "parcel": 1.1,
        "road": 2,
        "structure": 3.5
    }
    

    If specified this way, every key in the features inputs must also be given in the generic multipliers config. If None, no generic setback computation is performed. By default, None.

Returns:

config (dict) – Updated setbacks computation config dictionary.

Raises:
  • ValueError – If features is not a dictionary, or any key in features is not a valid key of SETBACKS.

  • FileNotFoundError – If no input GeoPackage files are found on disk.