Pure python package for map-matching.
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
Check out the LCSS Example for a more detailed example of working with the LCSSMatcher.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mappymatch-0.7.1.tar.gz.
File metadata
- Download URL: mappymatch-0.7.1.tar.gz
- Upload date:
- Size: 86.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00fdbd24bfb3e37e31983b0933bd7021c0ec69d0f9e2b059d87644baadeb1acf
|
|
| MD5 |
064b95415e74db7a65f12bea350eee6b
|
|
| BLAKE2b-256 |
5d29489810a24e57dcab3f54645ca88b850d1093070e4de04113c80a5d494964
|
Provenance
The following attestation bundles were made for mappymatch-0.7.1.tar.gz:
Publisher:
release.yaml on NREL/mappymatch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mappymatch-0.7.1.tar.gz -
Subject digest:
00fdbd24bfb3e37e31983b0933bd7021c0ec69d0f9e2b059d87644baadeb1acf - Sigstore transparency entry: 773035406
- Sigstore integration time:
-
Permalink:
NREL/mappymatch@cf08b531329957c48085ce75a159f842c76ddc11 -
Branch / Tag:
refs/tags/v0.7.1 - Owner: https://github.com/NREL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@cf08b531329957c48085ce75a159f842c76ddc11 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mappymatch-0.7.1-py3-none-any.whl.
File metadata
- Download URL: mappymatch-0.7.1-py3-none-any.whl
- Upload date:
- Size: 58.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f3ca2f88c9eadee41225fc31fba28c1c481018b9266fe1d0b856fecc5be7fdf
|
|
| MD5 |
e8657b428e67c8a3357822bcc5f62720
|
|
| BLAKE2b-256 |
2aaa7cb7a8e641730a4f003ee93df07821e49ec7c792c3351f3d359515358b22
|
Provenance
The following attestation bundles were made for mappymatch-0.7.1-py3-none-any.whl:
Publisher:
release.yaml on NREL/mappymatch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mappymatch-0.7.1-py3-none-any.whl -
Subject digest:
9f3ca2f88c9eadee41225fc31fba28c1c481018b9266fe1d0b856fecc5be7fdf - Sigstore transparency entry: 773035454
- Sigstore integration time:
-
Permalink:
NREL/mappymatch@cf08b531329957c48085ce75a159f842c76ddc11 -
Branch / Tag:
refs/tags/v0.7.1 - Owner: https://github.com/NREL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@cf08b531329957c48085ce75a159f842c76ddc11 -
Trigger Event:
release
-
Statement type: