revrt.routing.base.BatchRouteProcessor#

class BatchRouteProcessor(routing_scenario, route_definitions, route_attrs=None)[source]#

Bases: object

Class to manage batches of route computations

Parameters:
  • routing_scenario (RoutingScenario) – Scenario describing the cost layers and routing options.

  • route_definitions (Iterable) – Sequence of (start_points, end_points) tuples defining which points to route between. Each of start_points and end_points should be a list of (row, col) index tuples.

  • route_attrs (dict, optional) – Mapping of tuples of the form (int, (int, int)) where the first integer represents the route ID and the tuple of integers represents the starting index to additional attributes to include in the output for that route. By default, None.

Methods

process(out_fp[, save_paths])

Compute all routes and save to disk

Attributes

default_attrs

Default attributes for all routes

route_attrs

Mapping of frozen route node pair sets to attributes

route_definitions

Validated route definitions for computation

routing_layers

Built routing layers for the scenario

property default_attrs[source]#

Default attributes for all routes

Type:

dict

property route_attrs[source]#

Mapping of frozen route node pair sets to attributes

Type:

dict

property route_definitions[source]#

Validated route definitions for computation

Type:

list

property routing_layers[source]#

Built routing layers for the scenario

Type:

RoutingLayerManager

process(out_fp, save_paths=False)[source]#

Compute all routes and save to disk

Parameters:
  • out_fp (path-like) – Path to output file. If save_paths=True, a GeoPackage will be created (recommend to pass in a filepath ending in “.gpkg”). Otherwise, a CSV file will be created (recommend to pass in a filepath ending in “.csv”).

  • save_paths (bool, default False) – Include shapely geometries in the output when True. By default, False.