bmm: Bayesian Map-Matching
Map-matching using particle smoothing methods.
Docs and methodology.
Install
pip install bmm
Load graph and convert to UTM
UTM (Universal Transverse Mercator) is a commonly used projection of spherical longitude-latitude coordinates into square x-y coordinates.
import numpy as np
import pandas as pd
import osmnx as ox
import json
import bmm
graph = ox.graph_from_place('Porto, Portugal')
graph = ox.project_graph(graph)
Load polyline and convert to UTM
data_path = 'simulations/porto/test_route.csv'
polyline_longlat = json.loads(pd.read_csv(data_path)['POLYLINE'][0])
polyline_utm = bmm.long_lat_to_utm(polyline_longlat, graph)
or generate fake data
fake_route, fake_polyline_utm = bmm.sample_route(graph, timestamps=15, num_obs=25)
Offline map-matching
matched_particles = bmm.offline_map_match(graph, polyline=polyline_utm, n_samps=100, timestamps=15)
Online map-matching
# Initiate with first observation
matched_particles = bmm.initiate_particles(graph, first_observation=polyline_utm[0], n_samps=100)
# Update when new observation comes in
matched_particles = bmm.update_particles(graph, matched_particles, new_observation=polyline_utm[1], time_interval=15)
Plot
bmm.plot(graph, particles=matched_particles, polyline=polyline_utm)
Metadata
Release files for bmm 1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bmm-1.3.tar.gz | 40.9 kB | Without provenance | Details for bmm-1.3.tar.gz |
Release files / bmm-1.3.tar.gz
| Download URL | bmm-1.3.tar.gz |
|---|---|
| Size | 40.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aaff14170079bcbb1c336bef28103f970f10d4dc9d1be9a5cf3283949cf60d34
|
|
BLAKE2b-256 checksum How to use checksums |
1ad05ae1a7bbc289dc0ed3be3bc7b7c594227597cbf12f8a5a610a68b85f0626
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.1
|
Security for bmm 1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.