{"id":21317200,"url":"https://github.com/oldrev/mapmatchingkit","last_synced_at":"2025-07-12T02:32:39.253Z","repository":{"id":141075720,"uuid":"110362738","full_name":"oldrev/mapmatchingkit","owner":"oldrev","description":"A GPS map-matching algorithm library for .NET","archived":false,"fork":false,"pushed_at":"2019-05-14T03:26:14.000Z","size":1156,"stargazers_count":68,"open_issues_count":4,"forks_count":21,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-20T04:43:27.397Z","etag":null,"topics":["dotnet-core","hidden-markov-model","hmm","map-matching","spatial-analysis"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oldrev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-11T16:51:58.000Z","updated_at":"2024-10-26T01:41:00.000Z","dependencies_parsed_at":"2023-07-08T20:01:31.195Z","dependency_job_id":null,"html_url":"https://github.com/oldrev/mapmatchingkit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldrev%2Fmapmatchingkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldrev%2Fmapmatchingkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldrev%2Fmapmatchingkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldrev%2Fmapmatchingkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oldrev","download_url":"https://codeload.github.com/oldrev/mapmatchingkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225787156,"owners_count":17524104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet-core","hidden-markov-model","hmm","map-matching","spatial-analysis"],"created_at":"2024-11-21T18:42:22.749Z","updated_at":"2024-11-21T18:42:23.375Z","avatar_url":"https://github.com/oldrev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sandwych.MapMatchingKit\n\n[![NuGet Stats](https://img.shields.io/nuget/v/Sandwych.MapMatchingKit.svg)](https://www.nuget.org/packages/Sandwych.MapMatchingKit) \n[![Build status](https://ci.appveyor.com/api/projects/status/oh77641k0s78g4b2/branch/master?svg=true)](https://ci.appveyor.com/project/oldrev/mapmatchingkit/branch/master)\n[![Build Status](https://travis-ci.org/oldrev/mapmatchingkit.svg?branch=master)](https://travis-ci.org/oldrev/mapmatchingkit)\n\nSandwych.MapMatchingKit is a GPS map-matching solution for .NET platform.\n\nThis library is ported from the [Barefoot](https://github.com/bmwcarit/barefoot) project which developed in Java.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"doc/images/screenshots/qgis.png\"\u003e\n\u003c/p\u003e\n\n## What Is Map-Matching?\n\nFrom [Wikipedia](https://en.wikipedia.org/wiki/Map_matching):\n\n\u003e Map matching is the problem of how to match recorded geographic coordinates to a logical model of the real world, typically using some form of Geographic Information System. \n\u003e The most common approach is to take recorded, serial location points (e.g. from GPS) and relate them to edges in an existing street graph (network), usually in a sorted list representing the travel of a user or vehicle.\n\u003e Matching observations to a logical model in this way has applications in satellite navigation, GPS tracking of freight, and transportation engineering.\n\n## Additional Utilities:\n\n* Sandwych.Hmm: A general purpose utility library implements Hidden Markov Models (HMM) for time-inhomogeneous Markov processes for .NET.\n\n# Roadmap and Current Status\n\n**Alpha** - Basic functions works. \n\nThe API can and will change frequently, do not use it for production.\n\n# Getting Started\n\n## Prerequisites\n\n* Microsoft Visual Studio 2017: This project is written in C# 7.2 using Microsoft Visual Studio 2017 Community Edition Version 15.5.\n* DocFX to generate API documents (Optional)\n\n## Supported Platform\n\n* .NET Standard 1.6\n* .NET Framework 4.5\n\n## Installation\n\nSandwych.MapMatchingKit can be installed from [NuGet](https://www.nuget.org/packages/Sandwych.MapMatchingKit).\n\n## Prepare Your Data\n\n### Road Map\n\nField | Type | Description \n----- | ---- | -----------\nId | long | The unique ID of road line\nSource | long | Starting vertex ID of the road line\nTarget | long | Ending vertex ID of the road line\nOneway | bool | Indicates the road is a one way road or not\nOneway | bool | Indicates the road is a one way road or not\nType | short | Indicates the type of the road (Optional)\nPriority | float | Road priority factor, which is greater or equal than one (default is 1.0)\nMaxForwardSpeed | float | Maximum speed limit for passing this road from source to target (default is 120.0km/h)\nMaxBackwardSpeed | float | Maximum speed limit for passing this road from target to source (default is 120.0km/h)\nLength | float | Length of road geometry in meters, can be computed if not provided\nGeometry | ILineString | An object of ILineString to represents the road.\n\n\n### GPS Samples\n\nField | Type | Description \n----- | ---- | -----------\nId | long | The unique ID of the GPS point\nTime | DateTimeOffset | The timestamp of the GPS point\nCoordinate | Coordinate2D | Longtitude and latitude of the GPS point\n\n\n# Demo \u0026 Usage:\n\nSee the directory `example/Sandwych.MapMatchingKit.Examples.HelloWorldApp` for a fully executable map-matching example. \n\n## Offline Map-Matching\n\n```csharp\nvar spatial = new GeographySpatialOperation();\nvar mapBuilder = new RoadMapBuilder(spatial);\nvar roads = //load your road map\nvar map = mapBuilder.AddRoads(roads).Build();\nvar router = new DijkstraRouter\u003cRoad, RoadPoint\u003e();\nvar matcher = new Matcher(map, router, Costs.TimePriorityCost, spatial);\nvar kstate = new MatcherKState();\n//Do the map-matching iteration\nforeach (var sample in samples)\n{\n    var vector = matcher.Execute(kstate.Vector(), kstate.Sample, sample);\n    kstate.Update(vector, sample);\n}\n//Fetching map-matching results and accessing them\nvar candidatesSequence = kstate.Sequence();\nforeach (var cand in candidatesSequence)\n{\n    var roadId = cand.Point.Edge.RoadInfo.Id; // original road id\n    var heading = cand.Point.Edge.Headeing; // heading\n    var coord = cand.Point.Coordinate; // GPS position (on the road)\n    if (cand.HasTransition)\n    {\n        var geom = cand.Transition.Route.ToGeometry(); // path geometry(LineString) from last matching candidate\n        var edges = cand.Transition.Route.Edges // Road segments between two GPS position\n    }\n}\n```\n\n## Online Map-Matching\n\n```csharp\n// Create initial (empty) state memory\nvar kstate = new MatcherKState();\n\n// Iterate over sequence (stream) of samples\nforeach (var sample in samples)\n{\n    // Execute matcher with single sample and update state memory\n    var vector = kstate.Vector();\n    vector = matcher.Execute(vector, kstate.Sample, sample);\n    kstate.Update(vector, sample);\n\n    // Access map matching result: estimate for most recent sample\n    var estimated = kstate.Estimate();\n    Console.WriteLine(\"RoadID={0}\", estimated.Point.Edge.RoadInfo.Id); // The id of the road in your map\n}\n```\n\n# License\n\n* Copyright 2015-2017 BMW Car IT GmbH\n* Copyright 2017-2018 Wei \"oldrev\" Li and Contributors\n\nThis library is licensed under the [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html).\n\n# Contribute\n\nContributions are always welcome! For bug reports, please create an issue. \n\nFor code contributions (e.g. new features or bugfixes), please create a pull request.\n\n# Credits\n\nAll honors belongs to the original Barefoot developed by BMW Car IT GmbH: [https://github.com/bmwcarit/barefoot](https://github.com/bmwcarit/barefoot)\n\n* \"hmm-lib\" from BMW Car IT GmbH: [https://github.com/bmwcarit/hmm-lib](https://github.com/bmwcarit/hmm-lib)\n* \"GeographicLib\" from Charles Karney: [https://github.com/oldrev/GeographicLib](https://github.com/oldrev/GeographicLib)\n* \"Nito.Collections.Deque\" from Stephen Cleary: [https://github.com/StephenCleary/Deque](https://github.com/StephenCleary/Deque)\n* \"NetTopologySuite \u0026 ProjNET4GeoAPI\" from NetTopologySuite Project: [https://github.com/NetTopologySuite](https://github.com/NetTopologySuite)\n* PriorityQueue class from Rx.NET Project: [https://github.com/Reactive-Extensions/Rx.NET](https://github.com/Reactive-Extensions/Rx.NET)\n* The UBODT(upper-bounded origin destination table) algroithm from Can Yang: [https://github.com/cyang-kth/fmm](https://github.com/cyang-kth/fmm)\n* RBush - The R-Tree spatial index implementation from viceroypenguin: [https://github.com/viceroypenguin/RBush](https://github.com/viceroypenguin/RBush)\n* QuickGraph from Peli: [https://github.com/oldrev/Sandwych.QuickGraph](https://github.com/oldrev/Sandwych.QuickGraph)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foldrev%2Fmapmatchingkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foldrev%2Fmapmatchingkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foldrev%2Fmapmatchingkit/lists"}