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); }
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); }