Configs2026年7月3日·1 分钟阅读

Valhalla — Open Source Multi-Modal Routing Engine

Valhalla is a C++ routing engine for OpenStreetMap with dynamic costing, tiled data storage, and support for driving, cycling, walking, and multi-modal transit routing.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Valhalla Overview
先审查命令
npx -y tokrepo@latest install 5c765ffb-767a-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

Introduction

Valhalla is a routing engine built by Mapzen (now maintained by the community and Mapbox contributors) that uses OpenStreetMap data stored in a tiled format. It supports dynamic costing, meaning route preferences can be adjusted at query time without reprocessing the entire graph.

What Valhalla Does

  • Computes routes for auto, bicycle, pedestrian, truck, motorcycle, and multi-modal profiles
  • Supports dynamic costing that adjusts penalties for highways, tolls, and ferries per request
  • Generates isochrone and isodistance polygons from any origin point
  • Matches GPS traces to the road network with its map matching service
  • Provides time-distance matrices for origin-destination analysis

Architecture Overview

Valhalla stores the road graph in a tiled format on disk, allowing incremental updates without full reprocessing. The routing algorithm uses a bidirectional A* search with dynamic edge costing evaluated at query time. Costing models define speed, access, and penalties per road type and can be parameterized in each request. The HTTP API (built with Prime Server) serves route, isochrone, matrix, and locate endpoints.

Self-Hosting & Configuration

  • Deploy with Docker using the ghcr.io/gis-ops/docker-valhalla/valhalla image
  • Provide OSM PBF files in the custom_files directory for automatic tile building
  • Configure costing defaults and service parameters in valhalla.json
  • Enable elevation by providing SRTM/ASTER tile data in the configuration
  • Run behind Nginx or Caddy for TLS termination and caching in production

Key Features

  • Dynamic costing lets users adjust route preferences (avoid tolls, prefer highways) per request
  • Tiled graph storage enables partial updates without rebuilding the entire dataset
  • Multi-modal routing combines walking segments with public transit schedules
  • Elevation-aware profiles that factor in grade for cycling and pedestrian routes
  • Compact tile format keeps a planet-wide dataset in manageable storage

Comparison with Similar Tools

  • OSRM — faster raw query speed, but uses static edge weights requiring full reprocessing
  • GraphHopper — Java-based, simpler configuration, but lacks dynamic costing flexibility
  • OpenTripPlanner — stronger transit routing, but heavier resource requirements
  • Google Maps Platform — cloud service with broader data, per-request pricing

FAQ

Q: What is dynamic costing? A: It means route cost factors (speed, penalties, access) are evaluated at query time rather than baked into preprocessed data, so different requests can use different preferences without rebuilding.

Q: Can Valhalla route with public transit? A: Yes. Valhalla supports multi-modal routing by combining walking segments with GTFS transit data when configured.

Q: How much disk space do tiles require? A: A planet-wide tile set is roughly 100-150 GB. Country-level extracts are typically 1-10 GB.

Q: How do I update map data? A: Replace the OSM PBF file and rebuild tiles. The tiled format supports incremental updates for changed regions.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产