routingdemo

command
v0.52.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

README

Routing demo — no setup required

From the repository root:

go run ./cmd/routingdemo
go run ./cmd/routingdemo -iterations 1000
go run ./cmd/routingdemo -json

The embedded, synthetic five-node OSM network requires no downloads, model, API key or tile server. A car must detour around a turn restriction. Bicycles are explicitly exempt, and pedestrians are unaffected by this vehicle restriction. Both endpoints are off-road and snap onto partial street segments. Output compares metres, estimated travel seconds, graph build time and mean query time for all three profiles. -json includes the GeoJSON geometry and snap details.

Every iteration computes a fresh route. Graph construction is timed separately; these tiny-network timings include snapping and are an execution demonstration, not evidence of regional or country-scale throughput.

To try the same data over HTTP:

go run ./cmd/tinyroute -osm cmd/routingdemo/network.osm
# In a second terminal:
curl 'http://127.0.0.1:8081/route?from=10.9995,48.00001&to=11.0005,48.00001&profile=car&max_snap_meters=10'
curl 'http://127.0.0.1:8081/route?from=10.9995,48.00001&to=11.0005,48.00001&profile=bicycle&max_snap_meters=10'

See OSM routing for API details and supported rules.

Documentation

Overview

routingdemo demonstrates fresh OSM routes without downloads or a running server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL