Skip to content

v1.0.2

Choose a tag to compare

@gmpassos gmpassos released this 31 May 04:07
  • Multi-profile routing (car, motorcycle, bicycle) and toll avoidance.

  • lib/src/osm/vehicle_profile.dart (new):

    • Added VehicleProfile, controlling how source tags (routable highway classes,
      access, speed, one-way) are interpreted per transport mode.
    • Bundled VehicleProfile.car, .motorcycle, and .bicycle. Bicycles route over
      cycleways/paths, exclude motorways/trunks, ignore motor-vehicle one-way rules
      (but honor oneway:bicycle), and travel at a flat, capped speed.
  • lib/src/osm/osm_converter.dart:

    • OsmConverter now takes a profile (default VehicleProfile.car); routability,
      access, speed and one-way interpretation are driven by it. Build one graph per
      profile and store each under a profile-scoped id.
    • Parses the toll tag and flags toll segments on emitted edges.
  • lib/src/routing/route_finder.dart:

    • Added avoidTolls to findRoute/findRoutes. Toll roads are heavily (but
      finitely) penalized via the uniform penalty-Dijkstra, so toll-free routes are
      preferred while a tolled route is still returned when unavoidable.
  • lib/src/model/geo_route.dart:

    • GeoRoute now reports tollCount (toll sections crossed) and a hasTolls
      getter, so the findRoutes result can be filtered into toll-free vs tolled
      routes.
    • GeoRoute implements Comparable: sorting a route list orders it by fewest
      tolls first, then shortest distance (not-found routes sort last).
  • Model/graph/serialization:

    • GeoEdge.tolls (an int count, with a hasToll getter), RoutingGraph.adjToll
      (+ isToll/tollsOf), propagated through GraphBuilder and GraphCompressor
      (a merged chain sums the toll counts of its collapsed segments).
    • Breaking on-disk change: graph format bumped to v2 to store adjToll; graphs
      written by earlier versions must be rebuilt.