--- warning: DO NOT CHANGE THIS MANUALLY, THIS IS GENERATED BY https://github.com/duckdb/community-extensions repository, check README there title: valhalla_routing excerpt: | DuckDB Community Extensions DuckDB extension for routing and travel time calculations using Valhalla routing engine extension: name: valhalla_routing description: DuckDB extension for routing and travel time calculations using Valhalla routing engine version: '2026102301' language: C++ build: cmake license: MIT maintainers: - onnimonni requires_toolchains: - valhalla excluded_platforms: windows_amd64_mingw repo: github: midwork-finds-jobs/duckdb-valhalla-routing andium: d379f55ff8d80080b5b8e927c53d3062e6a57fab variegata: e73ec94493444fa0ae452474e4329dda13b4d138 ref: 7d4bf9ad8f3fb7ba5031519cf982d535c16c0eab docs: hello_world: | -- Load extensions INSTALL httpfs; LOAD httpfs; INSTALL spatial; LOAD spatial; LOAD valhalla_routing; -- Download and build tiles (Pure SQL!) SELECT valhalla_build_tiles( 'https://download.geofabrik.de/europe/monaco-latest.osm.pbf', './monaco_tiles' ); -- Load tiles SET valhalla_tiles = './monaco_tiles'; -- Calculate route SELECT round(r.distance_km, 1) as km, round(r.duration_minutes, 1) as minutes, ST_NPoints(r.geometry) as waypoints FROM ( SELECT valhalla_route( ST_Point(7.4275, 43.7397), -- Casino Monte-Carlo ST_Point(7.4254, 43.7308), -- Oceanographic Museum 'auto' ) as r ); extended_description: | # DuckDB Valhalla Routing Extension Point-to-point routing with distance, duration, and geometry using the Valhalla routing engine. ## Key Features (v0.2.0) - **Pure SQL Workflow**: Download and build tiles entirely from SQL using `valhalla_build_tiles()` - **Smart Configuration**: Use `SET valhalla_tiles = './path'` to load routing data - **Flexible Input**: Accepts WKT strings, WKB blobs, or GEOMETRY types - **GEOMETRY Output**: Returns proper GEOMETRY types (via macro) or WKB blobs - **Multi-Mode Routing**: Supports auto, bicycle, pedestrian, truck, bus, taxi, motor_scooter - **Matrix Queries**: Calculate N×M travel time matrices - **Spatial Integration**: Works seamlessly with DuckDB spatial extension ## Functions **Tile Management (NEW in v0.2.0):** - `valhalla_build_tiles(pbf_url, output_dir)` - Download PBF and build routing tiles - `SET valhalla_tiles = 'path'` - Load tiles (auto-detects valhalla.json) **Routing:** - `valhalla_route(from, to, costing)` - Returns GEOMETRY type (recommended) - `valhalla_route_wkb(from, to, costing)` - Returns WKB BLOB - `travel_time_matrix(lats1, lons1, lats2, lons2, costing)` - Distance/duration matrix - `travel_time_locate(lat, lon, costing)` - Snap coordinates to road network - `travel_time_request(action, json)` - Raw Valhalla JSON API ## Quick Start (100% Pure SQL) ```sql -- Build tiles from HTTP URL SELECT valhalla_build_tiles( 'https://download.geofabrik.de/europe/monaco-latest.osm.pbf', './tiles' ); -- Load and route SET valhalla_tiles = './tiles'; SELECT valhalla_route(ST_Point(7.42, 43.73), ST_Point(7.43, 43.74), 'auto'); ``` ## Documentation - [README.md](https://github.com/midwork-finds-jobs/duckdb-valhalla-routing/blob/main/README.md) - Quick start and API reference - [ITALY.md](https://github.com/midwork-finds-jobs/duckdb-valhalla-routing/blob/main/ITALY.md) - Complete Italy dataset guide - [examples/](https://github.com/midwork-finds-jobs/duckdb-valhalla-routing/tree/main/examples) - Ready-to-use examples ## Datasets Tested with: - Italy (2.4 GB tiles): Rome, Milan, Venice, Florence - Estonia: Tallinn-Tartu examples - Monaco: Test data Download OSM extracts from [Geofabrik](https://download.geofabrik.de/) extension_star_count: 10 extension_star_count_pretty: 10 extension_download_count: 24560 extension_download_count_pretty: 24.6k image: '/images/community_extensions/social_preview/preview_community_extension_valhalla_routing.png' layout: community_extension_doc --- ### Compatibility Matrix This table covers all DuckDB releases that have not reached [end-of-life](https://duckdb.org/release_calendar), including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.
| Platform | 1.4.4 | 1.4.5 | 1.5.5 | 1.5.6 | 2.0.0 | | :--- | :---: | :---: | :---: | :---: | :---: | | Linux AMD64 | ✅ | ❌ | ✅ | ✅ | ✅ | | Linux ARM64 | ✅ | ❌ | ✅ | ✅ | ✅ | | macOS AMD64 | ✅ | ❌ | ✅ | ✅ | ✅ | | macOS ARM64 | ✅ | ❌ | ✅ | ✅ | ✅ | | Windows AMD64 | ✅ | ❌ | ✅ | ✅ | ✅ | | Windows ARM64 | ❌ | ❌ | ❌ | ❌ | ❌ | | WebAssembly | ✅ | ❌ | ✅ | ✅ | ✅ | ### Installing and Loading ```sql INSTALL {{ page.extension.name }} FROM community; LOAD {{ page.extension.name }}; ``` {% if page.docs.hello_world %} ### Example ```sql {{ page.docs.hello_world }}``` {% endif %} {% if page.docs.extended_description %} ### About {{ page.extension.name }} {{ page.docs.extended_description }} {% endif %} ### Added Functions
| function_name | function_type | description | comment | examples | |-------------------------|---------------|-------------|---------|----------| | travel_time | scalar | NULL | NULL | | | travel_time_is_loaded | scalar | NULL | NULL | | | travel_time_load_config | scalar | NULL | NULL | | | travel_time_locate | scalar | NULL | NULL | | | travel_time_matrix | table | NULL | NULL | | | travel_time_request | scalar | NULL | NULL | | | valhalla_build_tiles | scalar | NULL | NULL | | | valhalla_route_wkb | scalar | NULL | NULL | | ### Overloaded Functions
This extension does not add any function overloads. ### Added Types
This extension does not add any types. ### Added Settings
| name | description | input_type | scope | aliases | typed_value | |----------------|---------------------------------------------------------|------------|--------|---------|-------------| | temp_directory | Set the directory to which temporary files are written. | VARCHAR | GLOBAL | [] | post.db.tmp | | valhalla_tiles | Path to Valhalla tiles directory or config file | VARCHAR | GLOBAL | [] | |