public void SnapTest() { var gpxFolderPath = HelpfulThings.AssemblyDirectory + "\\TestData\\GpxTracks"; DirectoryInfo d = new DirectoryInfo(gpxFolderPath); FileInfo[] files = d.GetFiles("*.gpx"); OsmSnapper snapper = new OsmSnapper(Enums.OverpassApi.DeloreanGray); foreach (var file in files) { string fileString = new StreamReader(file.FullName).ReadToEnd(); GPXData gpx = GPXLoader.LoadGPXFile(fileString); var track = gpx.TrackPoints.Select(x => new Coord(x.Latitude, x.Longitude)); var snapped = snapper.SnapDat(track.ToList()); // Assert the map matcher did not break when snapping this track, i.e. did not return a "disconnected" geometry Assert.Equal(1, snapped.Count); } }
static void Main(string[] args) { Console.WriteLine("Hello World!"); var feed = new GTFS.GTFSFeed(); feed.Agencies.Add(new Agency()); Console.WriteLine(feed.Agencies.Count); var coords = new List <Coord>() { new Coord(-33.9078, 18.401886), new Coord(-33.907749, 18.404173) }; var snapper = new OsmSnapper(Snappy.Enums.OverpassApi.KumiSystems); var snappedSections = snapper.SnapDat(coords); Console.WriteLine("Snapped Sections: " + snappedSections.Count); Console.ReadLine(); }