Пример #1
0
        private static void Table4x(OsrmClient osrm)
        {
            var locations = new Location[] {
                new Location(52.554070, 13.160621),
                new Location(52.431272, 13.720654),
                new Location(52.554070, 13.720654),
                new Location(52.554070, 13.160621),
            };

            var result = osrm.Table(locations);

            var src = new Location[] {
                new Location(52.554070, 13.160621),
            };

            var dst = new Location[] {
                new Location(52.431272, 13.720654),
                new Location(52.554070, 13.720654),
                new Location(52.554070, 13.160621),
            };

            var result2 = osrm.Table(new TableRequest()
            {
                SourceLocations      = src,
                DestinationLocations = dst
            });
        }
Пример #2
0
        public void Table_Response()
        {
            var locations = new Location[] {
                new Location(52.554070, 13.160621),
                new Location(52.431272, 13.720654),
                new Location(52.554070, 13.720654),
                new Location(52.554070, 13.160621),
            };

            var result = osrm.Table(locations);

            CheckStatus200(result);
            Assert.AreEqual <int>(4, result.DistanceTable.Length);
            Assert.AreEqual <int>(4, result.DistanceTable[0].Length);
            Assert.AreEqual <int>(4, result.DistanceTable[1].Length);
            Assert.AreEqual <int>(4, result.DistanceTable[2].Length);
            Assert.AreEqual <int>(4, result.DistanceTable[3].Length);

            var src = new Location[] {
                new Location(52.554070, 13.160621),
            };

            var dst = new Location[] {
                new Location(52.431272, 13.720654),
                new Location(52.554070, 13.720654),
                new Location(52.554070, 13.160621),
            };

            var result2 = osrm.Table(new TableRequest()
            {
                SourceLocations      = src,
                DestinationLocations = dst
            });

            CheckStatus200(result2);
            Assert.AreEqual <int>(1, result2.DistanceTable.Length);
            Assert.AreEqual <int>(3, result2.DistanceTable[0].Length);
        }