Package for mapmatching.
Project description
mappymatch
Mappymatch is a pure-python package developed and open sourced by the National Renewable Energy Laboratory. It contains a collection of "Matchers" that enable matching a GPS trace (series of GPS coordinates) to a map.
The current and planned Matchers are:
LCSSMatcher
: A matcher that implements the LCSS algorithm described in this paper. Works best with high resolution GPS traces.OsrmMatcher
: A light matcher that pings an OSRM server to request map matching results. See the official documentation for more info.ValhallaMatcher
: A matcher to ping a Valhalla server for map matching results.
Currently supported map formats are:
- Open Street Maps
Installation
Check out the docs for install instructions.
Example Usage
The current primary workflow is to use osmnx to download a road network and match it using the LCSSMatcher
.
The LCSSMatcher
implements the map matching algorithm described in this paper:
usage:
from mappymatch import package_root
from mappymatch.constructs.geofence import Geofence
from mappymatch.constructs.trace import Trace
from mappymatch.maps.nx.nx_map import NxMap
from mappymatch.matchers.lcss.lcss import LCSSMatcher
trace = Trace.from_csv(root() / "resources/traces/sample_trace_1.csv")
# generate a geofence polygon that surrounds the trace; units are in meters;
# this is used to query OSM for a small map that we can match to
geofence = Geofence.from_trace(trace, padding=1e3)
# uses osmnx to pull a networkx map from the OSM database
nx_map = NxMap.from_geofence(geofence)
matcher = LCSSMatcher(nx_map)
matches = matcher.match_trace(trace)
Example Notebooks
Example JupyterLab notebooks making use of mappymatch can be found in the mappymatch examples repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mappymatch-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 491c192e1faa33817fbcc43f396fad92cc8a41a433373240e76d0af35e4c5604 |
|
MD5 | 508d3e4e9f5da30813627832d5024d79 |
|
BLAKE2b-256 | c1783314f9d8b184da165bf4b62a651ed1d7845f8a87740c43290178c5814ac0 |