MapMatching4GMNS
Please send your comments to xzhou74@asu.edu if you have any suggestions and questions.
Based on input network and given GPS trajectory data, the map-matching program of Matching2Route aims to find most likely route in terms of node sequence in the underlying network, with the following data flow chart.
The 2D grid system aims to speed up the indexing of GSP points to the network. For example, a 10x10 grid for a network of 100 K nodes could lead to 1K nodes in each cell. We first identify all cells traveled by a GPS trace, so only a small subset of the network will be loaded in the resulting shortest path algorithm.
The link cost estimation step calculates a generalized weight/cost for each link in the cell, that is, the distance from nearly GPS points to a link inside the cell. The likely path finding algorithm selects the least cost path with the smallest generalized cumulative cost from the beginning to the end of the GPS trace.
- Data flow
| Input files | Output files |
|---|---|
| node.csv | agent.csv |
| link.csv | |
| input_agent.csv |
-
Input file description
File node.csv gives essential node information of the underlying (subarea) network in GMNS format, including node_id, x_coord and y_coord.
File link.csv provides essential link information of the underlying (subarea) network, including link_id, from_node_id and to_node_id.
Input trace file as input_agent.csv. The geometry field describes longitude and latitude of each GPS point along the trace of each agent. In the following example there are exactly 2 GPS points as the origin and destination locations, while other examples can include more than 2 GPS points along the trace. The geometry field follows the WKT format.
https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry
-
Output file description
File agent.csv describes the most-likely path for each agent based on input trajectories.
- Installation Path4GMNS has been published on PyPI, and can be installed using
$ pip install MapMatching4GMNS
If you need a specific version of Path4GMNS, say, 0.21, If you want to test the latest features of Path4GMNS, you can build the package from sources and install it offline, where Python 3.x is required.
$ pip install MapMatching4GMNS==0.2
from the root directory of PATH4GMNS
$ python setup.py sdist bdist_wheel $ cd dist $ python -m pip install MapMatching4GMNS-version.tar.gz
The shared libraries of [MapMatching4GMNS](https://github.com/asu-trans-ai-lab/MapMatching4GMNS/engine) for Path4GMNS can be built with a C++ compiler supporting C++11 and higher, where we use CMake to define the building process. Take MapMatching4GMNS_engine for example,
# from the root directory of engine
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .
You can replace the last command with $ make if your target system has Make installed.
### Caveat
As **CMAKE_BUILD_TYPE** will be **IGNORED** for IDE (Integrated Development Environment) generators, e.g., Visual Studio and Xcode, you will need to manually update the build type from debug to release in your IDE and build your target from there.
5. **Getting Started**
$ #To avoid complex data folder settings, please always first put the input data on the current directory $ !pip install MapMatching4GMNS --upgrade $ import time $ start = time.time() $ """Once the package is imported, agent.csv can be generated""" $ import MapMatching4GMNS as mmg $ end = time.time() $ print('time cost: %.6f'%(end-start))
6. **Features:**
1: The grid size is dynamically calculated based on the number of nodes per cell.
2: To avoid complex data folder settings, please always first assume work on the current directory.
7. **Challenges:**
1: The boundary identification might still have issues.
2: Outputing matched time and delay information is needed for traffic performance evaluation.
**Reference:**
This code is implemented based on a published paper in Journal of Transportation
Research Part C:
Estimating the most likely space–time paths, dwell times and path uncertainties
from vehicle trajectory data: A time geographic method
https://www.sciencedirect.com/science/article/pii/S0968090X15003150
Metadata
Release files for mapmatching4gmns 0.2.1
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 | |
|---|---|---|---|---|
| MapMatching4GMNS-0.2.1.tar.gz | 136.5 kB | Without provenance | Details |
Release files / MapMatching4GMNS-0.2.1.tar.gz
| Download URL | MapMatching4GMNS-0.2.1.tar.gz |
|---|---|
| Size | 136.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
50894c4c5fac88819338e5b825b6f0092843e2ff63884639f9db5f5c5ce8d612
|
|
BLAKE2b-256 checksum How to use checksums |
d56429701dd92ce4b6589a28d05c23dfe963bdb7c1af4e07c109366df1dbcdb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
|
Security for mapmatching4gmns 0.2.1
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.