Valhalla
Main entry point for the Valhalla routing engine on Android.
This class provides a Kotlin interface to the native Valhalla C++ routing engine. It handles configuration management, JSON serialization, and routing requests.
One instance holds one native actor, including the mmapped tile extract, for its whole lifetime. Building it is expensive and happens during construction, so reuse a single instance across many requests. Call close when done — ideally through Kotlin's use { } — since nothing else releases the native actor.
There are two ways in, matching iOS's Valhalla(_:) and Valhalla(configPath:): hand it a ValhallaConfig to write out and use, or point it at a config file already on disk.
See also
Constructors
Writes config to the device, then builds the engine from it.
Builds the engine from a config file already on disk.
Functions
Fetch a route from Valhalla.
Map-match a GPS trace onto the road network and return the attributes of every edge along the matched path.
Run a trace_attributes request supplied as JSON and return the raw response.
Map-match a GPS trace onto the road network and return a route along the matched path.
Run a trace_route request supplied as JSON and return the raw response.