Skip to main content

Fast Map Matching - High-performance map matching library

Project description

fastmm

fastmm is a fast (C++) map-matching library for python with no dependencies, and the ability to interpolate time on the match, not just position.

It's based on a desire to map match a lot of vehicle trace data quickly, without the infrastructure to spin up OSRM / Valhalla. (And this is probably faster as there's no IPC ... ?)

It is based on https://github.com/cyang-kth/fmm but updated to:

  • Remove GDAL/OGR dependencies - networks are created programmatically from Python
  • Include Python helper classes for automatic trajectory splitting and time interpolation
  • Be buildable on Windows/Linux/Mac with modern tooling
  • Focus on Python packaging with distributable wheels
  • Remove STMatch - we'll focus on FMM for now

Status:

  • Tested ... = )
  • MapMatcher helper class with auto-splitting and time interpolation
  • FASTMM algorithm working
  • Python API for network creation and matching
  • Windows, linux, and macOS wheel builds

Installation

pip install fastmm

TODO

  • Bring in extra python code.
  • Get test working in python.
  • If not found in UBODT, instead of bailing, do a normal djikstra lookup.
  • Need to check reverse tolerance - on our edges, they're all directed, so we probably shouldn't allow reversing. This causes errors when we're parsing - if you reverse on the same edge, the geometry gets flipped (I think - line = ALGORITHM::cutoffseg_unique(e0.geom, start_offset, end_offset); goes backward?), which then messes with our python post-processing of associating time as the segment start/stop are now the edge stop/start, not the other way round. We could add a reversed flag to the edge? That would help. For now, just don't have a reverse tolerance.
  • Could move the journey splitting (e.g. when unmatched candidate or points too far apart) into the C++ code here. Would be more optimal as a) C++, and b) don't need to repeat candidate lookup etc.
  • Improve serialization of UBODT to be cross-platform.
  • Specify versions for build libs (e.g. cibuildwheel).

Custom costs

To implement, just update the NetworkGraph construction, and set g[e].length = edge.cost (where you read edge in from the read_ogr_file etc.). The change transition probability to

// double tp = TransitionGraph::calculate_transition_probability(shortest_path_distance, euclidean_distance);
double tp = exp(-0.01 * shortest_path_distance); //

Seems to work:

  • set cost to 1 and it minimizes the number of edges
  • set cost to edge length, and gives similar result (as both the methods minimise distance - only differences is the previous method is using euclidean distance between candidates maybe, not matched points? would only matter with dense points).
  • can prevent some edges being used by manually bumping up their cost (tested on one road by cost *= 100 for those edges - worked, it avoided those edges).
  • Untested:
    • time based: if we have speed on all edges, set cost = distance / speed.
    • use road hierachy or similar - prioritise main highways. More useful for addinsight.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fastmm-0.1.1-cp312-cp312-win_amd64.whl (709.2 kB view details)

Uploaded CPython 3.12Windows x86-64

fastmm-0.1.1-cp312-cp312-manylinux_2_28_x86_64.whl (653.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

fastmm-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (657.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fastmm-0.1.1-cp311-cp311-win_amd64.whl (708.5 kB view details)

Uploaded CPython 3.11Windows x86-64

fastmm-0.1.1-cp311-cp311-manylinux_2_28_x86_64.whl (654.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

fastmm-0.1.1-cp311-cp311-macosx_11_0_arm64.whl (657.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

fastmm-0.1.1-cp310-cp310-win_amd64.whl (707.8 kB view details)

Uploaded CPython 3.10Windows x86-64

fastmm-0.1.1-cp310-cp310-manylinux_2_28_x86_64.whl (652.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

fastmm-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (656.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

fastmm-0.1.1-cp39-cp39-win_amd64.whl (708.1 kB view details)

Uploaded CPython 3.9Windows x86-64

fastmm-0.1.1-cp39-cp39-manylinux_2_28_x86_64.whl (654.3 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

fastmm-0.1.1-cp39-cp39-macosx_11_0_arm64.whl (656.1 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

fastmm-0.1.1-cp38-cp38-win_amd64.whl (718.1 kB view details)

Uploaded CPython 3.8Windows x86-64

fastmm-0.1.1-cp38-cp38-manylinux_2_28_x86_64.whl (653.8 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

fastmm-0.1.1-cp38-cp38-macosx_11_0_arm64.whl (655.9 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

Details for the file fastmm-0.1.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: fastmm-0.1.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 709.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fastmm-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 32db900f733f5cfbd1a952bddc02f7842017b17fefb8bcf488a7514e51890574
MD5 2100cfc15177d1d835adbbe606e2fca1
BLAKE2b-256 556543e6a4344f27bce28f209c53da674c227e5095e331984b5874658060ca80

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastmm-0.1.1-cp312-cp312-win_amd64.whl:

Publisher: build-wheels.yml on kodonnell/fastmm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastmm-0.1.1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fastmm-0.1.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8e9bbf742d5c983c04956e0ce12c21e027c054b8d818fb9ac83519e182d288e2
MD5 269dfdb1a61bddd85ab8ea932f3b6d00
BLAKE2b-256 640295971f99c4c7a11d56fba2c4b72df6e32a14f3fe2895a1b2bb0ba7851284

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastmm-0.1.1-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on kodonnell/fastmm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastmm-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastmm-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9e1ac8a1fb326fee8727c803609a62d6f41611f1ded8cc3c54249c4946304332
MD5 d47de1138ece477a3cea497992d84035
BLAKE2b-256 2a92b3221625e992a305f51925287a66aa5461d0400ff50ac6ac745dae904285

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastmm-0.1.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build-wheels.yml on kodonnell/fastmm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastmm-0.1.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: fastmm-0.1.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 708.5 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fastmm-0.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1c93881733530f5da9973556a0f644e94ad1b6509db71aa4b9c0827977e45c6a
MD5 1ff0c1ab110b2876278595c17b6a72fc
BLAKE2b-256 8929b8e6b28b33042c74469f5bc532f33cbff9759354999780936ee603157c1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastmm-0.1.1-cp311-cp311-win_amd64.whl:

Publisher: build-wheels.yml on kodonnell/fastmm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastmm-0.1.1-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fastmm-0.1.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 43dc2f17de4c32171bc4c444b98ac48fe7d1780c65318ee93457ef8edd4deb8a
MD5 95e2883f503cd80e8e43b3399418b9d5
BLAKE2b-256 1dd7a37b59eb1205dddb63b380ff84e160a7c80dcff2d6ebc5048eb1e58f6335

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastmm-0.1.1-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on kodonnell/fastmm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastmm-0.1.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastmm-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4400102fd5a5ab39793a42ab7f25d1ce6080701a5ba1654f8425cec5ec591514
MD5 f4e419411f6a32b3fc4c93c019a11b57
BLAKE2b-256 df68a0310736d357b5c518c04162fecfe09e4f50e57886e7d93970ff8ed1ff05

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastmm-0.1.1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build-wheels.yml on kodonnell/fastmm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastmm-0.1.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: fastmm-0.1.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 707.8 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fastmm-0.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 15fcb7150d20ab9d1319e65238a08d9bcd8fabe31b785d661ad57db3e1da546f
MD5 a835f43f15a03d34e17c2fe53988dd94
BLAKE2b-256 b828c0aab47976a10f5cea15708eb7b54f827c44b7228006a49f82252ae2aa6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastmm-0.1.1-cp310-cp310-win_amd64.whl:

Publisher: build-wheels.yml on kodonnell/fastmm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastmm-0.1.1-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fastmm-0.1.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ae3c53f0563cd606f5a6ddf9e1da041474b5c4ebfa0294663b64f59bc795df51
MD5 1bcb093bae0373551f575100c781182e
BLAKE2b-256 9ec97ad60d01273807a5a3216ac2038489f1004faccc447f91daaf42f9d5de6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastmm-0.1.1-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on kodonnell/fastmm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastmm-0.1.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastmm-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5243e7ee08060635e0c779dee1efcfc8ab8da7a1cb2fc621b4d5ac1524157303
MD5 8c522e893ba5274ed39cb317ea1a8fcd
BLAKE2b-256 52735038a90bbc2d7ab1a64e115b3932e530878c9cc8dc5c881568c62b9d3586

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastmm-0.1.1-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: build-wheels.yml on kodonnell/fastmm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastmm-0.1.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: fastmm-0.1.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 708.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fastmm-0.1.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 23fa30d385045d4012ba4a9f0c8435d0a9b8d71f6890da74e7ab644cef249ec7
MD5 a86e951f06f27770942548e7b694708c
BLAKE2b-256 0d17c88588b39e432c98c2fe86c1153365f23ed30b69dc453051b1b96aea1461

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastmm-0.1.1-cp39-cp39-win_amd64.whl:

Publisher: build-wheels.yml on kodonnell/fastmm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastmm-0.1.1-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fastmm-0.1.1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bd5ade725fdbbaee7cf5a0ffab9acc4696e874d9c296632fc9d075d8ab1d5c88
MD5 9877e69488603c5f8ea13f058affa327
BLAKE2b-256 2d5f5cb5bd14bfde9ac493d611ba7125ab2bf2e03287045031c0c63964bb2ba3

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastmm-0.1.1-cp39-cp39-manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on kodonnell/fastmm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastmm-0.1.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastmm-0.1.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9515626cff25e8e3b95fe5a896d288d85a74596619a105892d7cb1f24af87935
MD5 2d6b95f003a1ccbe454ed81146fb1697
BLAKE2b-256 4ea47dfc9e1a2d2fbad9daea9050e77d51bd929c5f331b81aa2f3da48aac4c39

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastmm-0.1.1-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: build-wheels.yml on kodonnell/fastmm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastmm-0.1.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: fastmm-0.1.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 718.1 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fastmm-0.1.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e7d950a2627e96824694d0035820d8ef42563ad44ea487ca1d4c74601eca24f8
MD5 a6247cd2564ee3282a33276202403a81
BLAKE2b-256 de2d313972253dffcfc0c7e4144fbd167872f797e361a174668d60d9579e36cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastmm-0.1.1-cp38-cp38-win_amd64.whl:

Publisher: build-wheels.yml on kodonnell/fastmm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastmm-0.1.1-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fastmm-0.1.1-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9696000badeb9d714ab635464cafedc193ee2b2a74cbd8831c82132573de134e
MD5 91ebb1e863627a98d172a0304853cd78
BLAKE2b-256 20ec4a2c5f6b39a5cb8c5e4cb884b94ec5a9e518836962f520653488bfdd1525

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastmm-0.1.1-cp38-cp38-manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on kodonnell/fastmm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastmm-0.1.1-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastmm-0.1.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c2d792b4eaca4177a8aa57c2436406f3fa6d51bba7e879107e42a2024ee7ae10
MD5 dc6ecfd856feb3d6c91c8657ee675b56
BLAKE2b-256 42d4b0d18b31813113c624027c2daf1536124510d7f8be7e406d3a0dc93484cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastmm-0.1.1-cp38-cp38-macosx_11_0_arm64.whl:

Publisher: build-wheels.yml on kodonnell/fastmm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page