private static ICommonLoggingPipeline MultiPolygonPipelineBaseline(CoordinateSystem coordinateSystem, PositionData[][][] points) { ICommonLoggingPipeline expected = new GeographyLoggingPipeline(false); expected.SetCoordinateSystem(coordinateSystem); expected.BeginShape(SpatialType.MultiPolygon); if (points != null) { for (int i = 0; i < points.Length; ++i) { expected.BeginShape(SpatialType.Polygon); for (int j = 0; j < points[i].Length; ++j) { for (int k = 0; k < points[i][j].Length; ++k) { AddPointToPipeline(expected, points[i][j][k], k == 0); } if (points[i][j].Length > 0) { expected.EndFigure(); } } expected.EndShape(); } } expected.EndShape(); return(expected); }
private static void ReadCollectionTest(bool buildAsList) { var coordinateSystem = CoordinateSystem.Geography(0); PositionData[] data = { new PositionData(10, 10), new PositionData(20, 20) }; var payloadBuilder = new StringBuilder(); payloadBuilder.Append(GmlShapeElement("MultiGeometry", coordinateSystem.EpsgId)); BuildMultiGml(buildAsList ? "geometryMembers" : "geometryMember", buildAsList, payloadBuilder, data, (o, b) => BuildPointGml(o, b, null)); payloadBuilder.Append(GmlEndElement("MultiGeometry")); var xel = XElement.Parse(payloadBuilder.ToString()); var reader = xel.CreateReader(); ICommonLoggingPipeline expected = new GeographyLoggingPipeline(false); expected.SetCoordinateSystem(coordinateSystem); expected.BeginShape(SpatialType.Collection); expected.BeginShape(SpatialType.Point); expected.BeginFigure(10, 10, null, null); expected.EndFigure(); expected.EndShape(); expected.BeginShape(SpatialType.Point); expected.BeginFigure(20, 20, null, null); expected.EndFigure(); expected.EndShape(); expected.EndShape(); var target = new CallSequenceLoggingPipeline(); new GmlReader(target).ReadGeography(reader); expected.VerifyPipeline(target); }
public void ReadFullGlobe() { var target = new CallSequenceLoggingPipeline(); new GmlReader(target).ReadGeography(ExpectedFullGlobeGml(CoordinateSystem.DefaultGeography)); ICommonLoggingPipeline expected = new GeographyLoggingPipeline(false); expected.SetCoordinateSystem(CoordinateSystem.DefaultGeography); expected.BeginShape(SpatialType.FullGlobe); expected.EndShape(); expected.VerifyPipeline(target); }
private static ICommonLoggingPipeline PointPipelineBaseline(CoordinateSystem coordinateSystem, PositionData point) { ICommonLoggingPipeline expected = new GeographyLoggingPipeline(false); expected.SetCoordinateSystem(coordinateSystem); expected.BeginShape(SpatialType.Point); if (point != null) { expected.BeginFigure(point.Latitude, point.Longitude, point.Z, point.M); expected.EndFigure(); } expected.EndShape(); return(expected); }
private static ICommonLoggingPipeline MultiPointPipelineBaseline(CoordinateSystem coordinateSystem, PositionData[] points) { ICommonLoggingPipeline expected = new GeographyLoggingPipeline(false); expected.SetCoordinateSystem(coordinateSystem); expected.BeginShape(SpatialType.MultiPoint); if (points != null) { for (int i = 0; i < points.Length; ++i) { expected.BeginShape(SpatialType.Point); AddPointToPipeline(expected, points[i], true); expected.EndFigure(); expected.EndShape(); } } expected.EndShape(); return(expected); }