Skip to content

Commit c374c69

Browse files
committed
update README
1 parent 7ff1ed9 commit c374c69

File tree

12 files changed

+571
-87
lines changed

12 files changed

+571
-87
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ project.lock.json
3030
.testPublish/
3131
.dotnetcli
3232
*.qgs~
33+
*.output.csv

Diff for: README.md

+79-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Overview
1+
# Sandwych.MapMatchingKit
22

33
[![NuGet Stats](https://img.shields.io/nuget/v/Sandwych.MapMatchingKit.svg)](https://www.nuget.org/packages/Sandwych.MapMatchingKit)
44
[![Build status](https://ci.appveyor.com/api/projects/status/oh77641k0s78g4b2/branch/master?svg=true)](https://ci.appveyor.com/project/oldrev/mapmatchingkit/branch/master)
@@ -8,27 +8,97 @@ Sandwych.MapMatchingKit is a GPS map-matching solution for .NET platform.
88

99
This solution is porting from the [Barefoot](https://github.com/bmwcarit/barefoot) project which developed in Java.
1010

11-
## Sandwych.MapMatchingKit
11+
<p align="center">
12+
<img src="doc/images/screenshots/qgis.png">
13+
</p>
1214

13-
The map-matching library.
15+
## What Is Map-Matching?
1416

15-
## Sandwych.Hmm
17+
From [Wikipedia](https://en.wikipedia.org/wiki/Map_matching):
1618

17-
A general purpose utility library implements Hidden Markov Models (HMM) for time-inhomogeneous Markov processes for .NET.
19+
```
20+
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. 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. Matching observations to a logical model in this way has applications in satellite navigation, GPS tracking of freight, and transportation engineering.
21+
```
22+
23+
## Additional Utilities:
24+
25+
* Sandwych.Hmm: A general purpose utility library implements Hidden Markov Models (HMM) for time-inhomogeneous Markov processes for .NET.
1826

1927
# Roadmap and Current Status
2028

2129
**Alpha** - Basic functions works.
2230

2331
The API can and will change frequently, do not use it for production.
2432

25-
# Requirements
33+
# Getting Started
2634

27-
* Microsoft Visual Studio 15.5 With C# 7.2
28-
* .NET Standard 1.6
29-
* .NET Framework 4.6.1
35+
## Prerequisites
36+
37+
* Microsoft Visual Studio 2017: This project is written in C# 7.2 using Microsoft Visual Studio 2017 Community Edition Version 15.5.
3038
* DocFX to generate API documents (Optional)
3139

40+
## Supported Platform
41+
42+
* .NET Standard 1.6
43+
* .NET Framework 4.5
44+
45+
## Installation
46+
47+
Sandwych.MapMatchingKit can be installed from [NuGet](https://www.nuget.org/packages/Sandwych.MapMatchingKit).
48+
49+
# Demo & Usage:
50+
51+
See directory `example/Sandwych.MapMatchingKit.Examples.HelloWorldApp` for a fully executable map-matching example.
52+
53+
## Offline Map-Matching
54+
55+
```csharp
56+
var spatial = new GeographySpatialOperation();
57+
var mapBuilder = new RoadMapBuilder(spatial);
58+
var roads = //load your road map
59+
var map = mapBuilder.AddRoads(roads).Build();
60+
var matcher = new Matcher(map, new DijkstraRouter<Road, RoadPoint>(), Costs.TimePriorityCost, spatial);
61+
var kstate = new MatcherKState();
62+
foreach (var sample in samples)
63+
{
64+
var vector = matcher.Execute(kstate.Vector(), kstate.Sample, sample);
65+
kstate.Update(vector, sample);
66+
}
67+
//Fetching map-matching results and accessing them
68+
var candidatesSequence = kstate.Sequence();
69+
foreach (var cand in candidatesSequence)
70+
{
71+
var roadId = cand.Point.Edge.RoadInfo.Id; // original road id
72+
var heading = cand.Point.Edge.Headeing; // heading
73+
var coord = cand.Point.Coordinate; // GPS position (on the road)
74+
if (cand.HasTransition)
75+
{
76+
var geom = cand.Transition.Route.ToGeometry(); // path geometry(LineString) from last matching candidate
77+
var edges = cand.Transition.Route.Edges // Road segments between two GPS position
78+
}
79+
}
80+
```
81+
82+
## Online Map-Matching
83+
84+
```csharp
85+
// Create initial (empty) state memory
86+
var kstate = new MatcherKState();
87+
88+
// Iterate over sequence (stream) of samples
89+
foreach (var sample in samples)
90+
{
91+
// Execute matcher with single sample and update state memory
92+
var vector = kstate.Vector();
93+
vector = matcher.Execute(vector, kstate.Sample, sample);
94+
kstate.Update(vector, sample);
95+
96+
// Access map matching result: estimate for most recent sample
97+
var estimated = kstate.Estimate();
98+
Console.WriteLine("RoadID={0}", estimated.Point.Edge.RoadInfo.Id); // The id of the road in your map
99+
}
100+
```
101+
32102
# License
33103

34104
* Copyright 2015-2017 BMW Car IT GmbH

Diff for: Sandwych.MapMatchingKit.sln

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ EndProject
1818
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sandwych.MapMatchingKit.Examples.HelloWorldApp", "examples\Sandwych.MapMatchingKit.Examples.HelloWorldApp\Sandwych.MapMatchingKit.Examples.HelloWorldApp.csproj", "{2CCF3F1B-FFF3-4153-952D-4564BEB4C11A}"
1919
EndProject
2020
Global
21-
GlobalSection(Performance) = preSolution
22-
HasPerformanceSessions = true
23-
EndGlobalSection
2421
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2522
Debug|Any CPU = Debug|Any CPU
2623
Release|Any CPU = Release|Any CPU
@@ -64,4 +61,7 @@ Global
6461
GlobalSection(Performance) = preSolution
6562
HasPerformanceSessions = true
6663
EndGlobalSection
64+
GlobalSection(Performance) = preSolution
65+
HasPerformanceSessions = true
66+
EndGlobalSection
6767
EndGlobal

0 commit comments

Comments
 (0)