revrt.routing.base.BatchRouteProcessor#
- class BatchRouteProcessor(routing_scenario, route_definitions, route_attrs=None)[source]#
Bases:
objectClass 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 ofstart_pointsandend_pointsshould 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 attributes for all routes
Mapping of frozen route node pair sets to attributes
Validated route definitions for computation
Built routing layers for the scenario
- 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, defaultFalse) – Include shapely geometries in the output whenTrue. By default,False.