| | | 1 | | using Itinero.MapMatching.Model; |
| | | 2 | | using Itinero.Profiles; |
| | | 3 | | |
| | | 4 | | namespace Itinero.MapMatching; |
| | | 5 | | |
| | | 6 | | /// <summary> |
| | | 7 | | /// The map matcher settings. |
| | | 8 | | /// </summary> |
| | | 9 | | public class MapMatcherSettings |
| | | 10 | | { |
| | | 11 | | /// <summary> |
| | | 12 | | /// Gets or sets the profile. |
| | | 13 | | /// </summary> |
| | | 14 | | // ReSharper disable once PropertyCanBeMadeInitOnly.Global |
| | 114 | 15 | | public Profile? Profile { get; set; } |
| | | 16 | | |
| | | 17 | | /// <summary> |
| | | 18 | | /// GPS noise standard deviation in meters. Controls the emission probability (Gaussian). |
| | | 19 | | /// Lower values make the matcher prefer candidates closer to the GPS point. |
| | | 20 | | /// </summary> |
| | 45 | 21 | | public double SigmaZ { get; set; } = 10.0; |
| | | 22 | | |
| | | 23 | | /// <summary> |
| | | 24 | | /// Transition probability parameter in meters. Controls the exponential distribution |
| | | 25 | | /// over the absolute difference between great-circle distance and route distance. |
| | | 26 | | /// Higher values are more tolerant of indirect routes. |
| | | 27 | | /// </summary> |
| | 44 | 28 | | public double Beta { get; set; } = 5.0; |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// The search radius in meters for finding snap point candidates. |
| | | 32 | | /// </summary> |
| | 47 | 33 | | public double SearchRadius { get; set; } = 50; |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// Minimum distance in meters between consecutive track points. |
| | | 37 | | /// Points closer than this are skipped to avoid noise-induced issues. |
| | | 38 | | /// </summary> |
| | 44 | 39 | | public double MinPointDistance { get; set; } = 10; |
| | | 40 | | |
| | | 41 | | /// <summary> |
| | | 42 | | /// Maximum number of consecutive unmatched track points to skip before breaking the model. |
| | | 43 | | /// </summary> |
| | 44 | 44 | | public int MaxPointSkip { get; set; } = 3; |
| | | 45 | | |
| | | 46 | | /// <summary> |
| | | 47 | | /// Maximum great-circle distance in meters between consecutive track points |
| | | 48 | | /// before the trace is split into separate models. |
| | | 49 | | /// </summary> |
| | 44 | 50 | | public double BreakageDistance { get; set; } = 2000; |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// Maximum factor applied to the great-circle distance between consecutive points |
| | | 54 | | /// to limit routing search distance. |
| | | 55 | | /// </summary> |
| | 44 | 56 | | public double MaxRouteDistanceFactor { get; set; } = 5.0; |
| | | 57 | | |
| | | 58 | | internal ModelBuilderSettings ModelBuilderSettings |
| | | 59 | | { |
| | | 60 | | get |
| | 22 | 61 | | { |
| | 22 | 62 | | return new ModelBuilderSettings() |
| | 22 | 63 | | { |
| | 22 | 64 | | SigmaZ = this.SigmaZ, |
| | 22 | 65 | | Beta = this.Beta, |
| | 22 | 66 | | SearchRadius = this.SearchRadius, |
| | 22 | 67 | | MinPointDistance = this.MinPointDistance, |
| | 22 | 68 | | MaxPointSkip = this.MaxPointSkip, |
| | 22 | 69 | | BreakageDistance = this.BreakageDistance, |
| | 22 | 70 | | MaxRouteDistanceFactor = this.MaxRouteDistanceFactor |
| | 22 | 71 | | }; |
| | 22 | 72 | | } |
| | | 73 | | } |
| | | 74 | | } |