public void GetIntersectionCoordinatesEmptyGridProfileTest() { var vertices = new List <ICoordinate> { new Coordinate(0, 0), new Coordinate(0, 0) }; ILineString gridProfile = new LineString(vertices.ToArray()); var stepSize = gridProfile.Length / 100; IEnumerable <ICoordinate> intersection = CoverageProfile.GetGridProfileCoordinates(gridProfile, stepSize); var stepCount = (gridProfile.Length / stepSize) + 1; Assert.AreEqual(stepCount, intersection.Count()); }
public void GetIntersectionCoordinatesTest() { var vertices = new List <Coordinate> { new Coordinate(0, 0), new Coordinate(1000, 0) }; ILineString gridProfile = new LineString(vertices.ToArray()); var stepSize = gridProfile.Length / 100; IEnumerable <Coordinate> intersection = CoverageProfile.GetGridProfileCoordinates(gridProfile, stepSize); var stepCount = (gridProfile.Length / stepSize) + 1; Assert.AreEqual(stepCount, intersection.Count()); IList <Coordinate> coordinates = intersection.ToArray(); Assert.AreEqual(coordinates[0].X, 0, 1e-6); Assert.AreEqual(coordinates[0].Y, 0, 1e-6); Assert.AreEqual(coordinates[coordinates.Count - 1].X, 1000, 1e-6); Assert.AreEqual(coordinates[coordinates.Count - 1].Y, 0, 1e-6); }