Valhalla - green-ecolution/backend GitHub Wiki

Efficient route planning

Valhalla is an open-source routing engine designed for fast and efficient route planning, supporting various transportation modes such as driving, cycling, walking, and transit. It provides customizable routing capabilities and precise turn-by-turn navigation.

Key Features

Key Features of Valhalla Routing:

  • Multi-Modal Routing: Supports multiple transportation modes, including car, bicycle, pedestrian, and public transit.
  • Turn-by-Turn Navigation: Provides detailed navigation instructions.
  • Customizable Costing Models: Allows for tuning route calculations based on speed, time, or other factors.
  • Time-Distance Matrix: Computes travel times and distances between multiple locations efficiently.
  • Elevation Data Integration: Considers elevation changes in route calculations.
  • OpenStreetMap-Based: Uses OSM data for global coverage and accuracy.
  • Flexible API: Offers REST-based endpoints for routing, matrix calculations, and more.
  • Toll & Traffic Consideration Can factor in toll roads and real-time or historical traffic data.
  • Offline Capability – Can run without an internet connection with preloaded maps.

Local Deployment

To set up a local environment to work with our system, spin up a container as described here: docker-valhalla

Let's assume that we set up valhalla in a Docker Compose file like this:

#! .docker/docker-compose.infra.yaml

services:
  # [...]
  valhalla:
    image: ghcr.io/gis-ops/docker-valhalla/valhalla:latest
    ports:
      - "8002:8002"
    volumes:
      - ./infra/valhalla/custom_files:/custom_files
    deploy:
      resources:
        reservations:
          cpus: "1"
          memory: 256m
        limits:
          cpus: "2"
          memory: 1g

Valhalla is used to calculate a route and Vroom to optimize it. For further configuration information refer to Vroom. For more details about Valhalla, visit the official repository.

Then the Green Ecolution configuration would look like this:

#! config/config.<env>.yaml
routing:
    start_point:
        - 9.434764259345679
        - 54.768731253913806
    end_point:
        - 9.434764259345679
        - 54.768731253913806
    watering_point:
        - 9.434764259345679
        - 54.768731253913806
    valhalla:
        host: http://localhost:8002
        optimization:
            vroom:
                host: http://localhost:2525

start_point, end_point and watering_point are needed to optimize the route with Vroom.

⚠️ **GitHub.com Fallback** ⚠️