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 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
pip install mappymatch
If you have trouble with that, check out the docs for more detailed 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(package_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)
# convert the matches to a dataframe
df = matches.matches_to_dataframe()
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
File details
Details for the file mappymatch-0.4.5.tar.gz
.
File metadata
- Download URL: mappymatch-0.4.5.tar.gz
- Upload date:
- Size: 53.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f943f48e70802a52773a1cc3ea8b32e6010d2432e1e8699d7833ac97e8e559d3 |
|
MD5 | bb392f4e3ad8ecad9acfd2c3eb339b22 |
|
BLAKE2b-256 | 6be86334cfbde0713bc215a98ab6b929c9735cdac2fbcc2836d6905cf66ab5b6 |
File details
Details for the file mappymatch-0.4.5-py3-none-any.whl
.
File metadata
- Download URL: mappymatch-0.4.5-py3-none-any.whl
- Upload date:
- Size: 53.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bce4dfa14ecaaeeef83411e9a7385616119a4f0e00b110440613f36764eadb2 |
|
MD5 | 27ed8b2d3c6a0350017c367c82651604 |
|
BLAKE2b-256 | 3b1c9480d51a27bc49ecc3744f312d747609381656aa59d8d569d4dbd58678a2 |