| | | 1 | | using System; |
| | | 2 | | using Itinero.Network; |
| | | 3 | | using Itinero.Profiles; |
| | | 4 | | |
| | | 5 | | namespace Itinero.MapMatching; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// Contains extension method for the router class. |
| | | 9 | | /// </summary> |
| | | 10 | | public static class RoutingNetworkExtensions |
| | | 11 | | { |
| | | 12 | | /// <summary> |
| | | 13 | | /// Creates a configured map matcher. |
| | | 14 | | /// </summary> |
| | | 15 | | /// <param name="routingNetwork">The router db.</param> |
| | | 16 | | /// <param name="profile">The profile.</param> |
| | | 17 | | /// <returns>Map matcher results.</returns> |
| | | 18 | | public static MapMatcher Matcher(this RoutingNetwork routingNetwork, Profile? profile = null) |
| | 0 | 19 | | { |
| | 0 | 20 | | return new MapMatcher(routingNetwork, new MapMatcherSettings() |
| | 0 | 21 | | { |
| | 0 | 22 | | Profile = profile |
| | 0 | 23 | | }); |
| | 0 | 24 | | } |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// Creates a configured map matcher. |
| | | 28 | | /// </summary> |
| | | 29 | | /// <param name="routingNetwork">The router db.</param> |
| | | 30 | | /// <param name="setup">A callback to setup.</param> |
| | | 31 | | /// <returns>Map matcher results.</returns> |
| | | 32 | | public static MapMatcher Matcher(this RoutingNetwork routingNetwork, Action<MapMatcherSettings>? setup = null) |
| | 22 | 33 | | { |
| | 22 | 34 | | var settings = new MapMatcherSettings(); |
| | 22 | 35 | | setup?.Invoke(settings); |
| | | 36 | | |
| | 22 | 37 | | return new MapMatcher(routingNetwork, settings); |
| | 22 | 38 | | } |
| | | 39 | | } |