示例#1
0
        public void DuplicateRoadFilterCheckColinearNoNeighborsTest1()
        {
            var pathsData = PointUtils.CreateFromPoints(
                new List <GpsCoordinate>()
            {
                new GpsCoordinate()
                {
                    x = -1
                },
            }, 2);

            var onlyOnePointInPathPoints = new List <PathPoint> {
                PathPoint.CreateFromPathData(pathsData[0])
            };

            var checkedPoints = new List <GpsCoordinate>()
            {
                new GpsCoordinate()
                {
                    x = -1
                },
            };

            Assert.IsFalse(DuplicateRoadFilter.AtLeastOneNeighborIsColinear(null, checkedPoints, 0));
            Assert.IsFalse(DuplicateRoadFilter.AtLeastOneNeighborIsColinear(onlyOnePointInPathPoints, checkedPoints, 0));
            Assert.IsFalse(DuplicateRoadFilter.AtLeastOneNeighborIsColinear(onlyOnePointInPathPoints, checkedPoints, 1));
        }
示例#2
0
        public void DuplicateRoadFilterCheckColinearReversedNeighborsTest1()
        {
            var pathsData = PointUtils.CreateFromPoints(
                new List <GpsCoordinate>()
            {
                new GpsCoordinate()
                {
                    x = -1
                },
                new GpsCoordinate()
                {
                    x = 0
                },
                new GpsCoordinate()
                {
                    x = 1
                },

                new GpsCoordinate()
                {
                    x = 1, y = 3
                },
                new GpsCoordinate()
                {
                    x = 0, y = 3
                },
                new GpsCoordinate()
                {
                    x = -1, y = 3
                },
            }, 2);

            var pathPoints = new List <PathPoint> {
                PathPoint.CreateFromPathData(pathsData[0]), PathPoint.CreateFromPathData(pathsData[1])
            };

            var checkedPoints = new List <GpsCoordinate>()
            {
                new GpsCoordinate()
                {
                    x = 1
                },
                new GpsCoordinate()
                {
                    x = 0
                },
                new GpsCoordinate()
                {
                    x = -1
                },
            };

            Assert.IsTrue(DuplicateRoadFilter.AtLeastOneNeighborIsColinear(pathPoints, checkedPoints, 0));
        }