revrt.routing.base.RouteMetrics#

class RouteMetrics(routing_layers, route, optimized_objective, add_geom=False, attrs=None)[source]#

Bases: object

Class to compute route characteristics given layer cost maps

Parameters:
  • routing_layers (RoutingLayerManager) – Routing layer manager containing cost and tracker arrays.

  • route (list) – Ordered row and column indices defining the path.

  • optimized_objective (float) – Objective value returned by the routing solver.

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

  • attrs (dict, optional) – Additional metadata merged into the result dictionary. By default, None.

Methods

compute()

Assemble route metrics and optional geometry payload

Attributes

cell_size

Raster cell size in meters

cost

Optimized objective evaluated over the route

end_lat

Latitude of the terminal path cell

end_lon

Longitude of the terminal path cell

geom

Geometry for the computed path

total_path_length

Total path length in kilometers

property cell_size#

Raster cell size in meters

Type:

float

property total_path_length#

Total path length in kilometers

Type:

float

property cost#

Optimized objective evaluated over the route

Type:

float

property end_lat#

Latitude of the terminal path cell

Type:

float

property end_lon#

Longitude of the terminal path cell

Type:

float

property geom#

Geometry for the computed path

Type:

shapely.GeometryType

compute()[source]#

Assemble route metrics and optional geometry payload