Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A GPS map-matching algorithm library for .NET

License

NotificationsYou must be signed in to change notification settings

oldrev/mapmatchingkit

Repository files navigation

NuGet StatsBuild statusBuild Status

Sandwych.MapMatchingKit is a GPS map-matching solution for .NET platform.

This library is ported from theBarefoot project which developed in Java.

What Is Map-Matching?

FromWikipedia:

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.

Additional Utilities:

  • Sandwych.Hmm: A general purpose utility library implements Hidden Markov Models (HMM) for time-inhomogeneous Markov processes for .NET.

Roadmap and Current Status

Alpha - Basic functions works.

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

Getting Started

Prerequisites

  • Microsoft Visual Studio 2017: This project is written in C# 7.2 using Microsoft Visual Studio 2017 Community Edition Version 15.5.
  • DocFX to generate API documents (Optional)

Supported Platform

  • .NET Standard 1.6
  • .NET Framework 4.5

Installation

Sandwych.MapMatchingKit can be installed fromNuGet.

Prepare Your Data

Road Map

FieldTypeDescription
IdlongThe unique ID of road line
SourcelongStarting vertex ID of the road line
TargetlongEnding vertex ID of the road line
OnewayboolIndicates the road is a one way road or not
OnewayboolIndicates the road is a one way road or not
TypeshortIndicates the type of the road (Optional)
PriorityfloatRoad priority factor, which is greater or equal than one (default is 1.0)
MaxForwardSpeedfloatMaximum speed limit for passing this road from source to target (default is 120.0km/h)
MaxBackwardSpeedfloatMaximum speed limit for passing this road from target to source (default is 120.0km/h)
LengthfloatLength of road geometry in meters, can be computed if not provided
GeometryILineStringAn object of ILineString to represents the road.

GPS Samples

FieldTypeDescription
IdlongThe unique ID of the GPS point
TimeDateTimeOffsetThe timestamp of the GPS point
CoordinateCoordinate2DLongtitude and latitude of the GPS point

Demo & Usage:

See the directoryexample/Sandwych.MapMatchingKit.Examples.HelloWorldApp for a fully executable map-matching example.

Offline Map-Matching

varspatial=newGeographySpatialOperation();varmapBuilder=newRoadMapBuilder(spatial);varroads=//load your road mapvar map=mapBuilder.AddRoads(roads).Build();varrouter=newDijkstraRouter<Road,RoadPoint>();varmatcher=newMatcher(map,router,Costs.TimePriorityCost,spatial);varkstate=newMatcherKState();//Do the map-matching iterationforeach(varsampleinsamples){varvector=matcher.Execute(kstate.Vector(),kstate.Sample,sample);kstate.Update(vector,sample);}//Fetching map-matching results and accessing themvarcandidatesSequence=kstate.Sequence();foreach(varcandincandidatesSequence){varroadId=cand.Point.Edge.RoadInfo.Id;// original road idvarheading=cand.Point.Edge.Headeing;// headingvarcoord=cand.Point.Coordinate;// GPS position (on the road)if(cand.HasTransition){vargeom=cand.Transition.Route.ToGeometry();// path geometry(LineString) from last matching candidatevaredges=cand.Transition.Route.Edges// Road segments between two GPS position}}

Online Map-Matching

// Create initial (empty) state memoryvarkstate=newMatcherKState();// Iterate over sequence (stream) of samplesforeach(varsampleinsamples){// Execute matcher with single sample and update state memoryvarvector=kstate.Vector();vector=matcher.Execute(vector,kstate.Sample,sample);kstate.Update(vector,sample);// Access map matching result: estimate for most recent samplevarestimated=kstate.Estimate();Console.WriteLine("RoadID={0}",estimated.Point.Edge.RoadInfo.Id);// The id of the road in your map}

License

  • Copyright 2015-2017 BMW Car IT GmbH
  • Copyright 2017-2018 Wei "oldrev" Li and Contributors

This library is licensed under theApache 2.0 license.

Contribute

Contributions are always welcome! For bug reports, please create an issue.

For code contributions (e.g. new features or bugfixes), please create a pull request.

Credits

All honors belongs to the original Barefoot developed by BMW Car IT GmbH:https://github.com/bmwcarit/barefoot

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp