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 void ReadPointTest(PositionData data, CoordinateSystem coordinateSystem) { var target = new CallSequenceLoggingPipeline(); new GmlReader(target).ReadGeography(ExpectedPointGml(data, coordinateSystem)); PointPipelineBaseline(coordinateSystem, data).VerifyPipeline(target); }
public void ReadEmptyGeography_MultiPolygon() { var target = new CallSequenceLoggingPipeline(); new GmlReader(target).ReadGeography(ExpectedEmptyGml(SpatialType.MultiPolygon, CoordinateSystem.DefaultGeography)); MultiPolygonPipelineBaseline(CoordinateSystem.DefaultGeography, null).VerifyPipeline(target); }
private static void ReadMultiPolygonTest(CoordinateSystem coordinateSystem, params PositionData[][][] data) { var baseline = MultiPolygonPipelineBaseline(coordinateSystem, data); var target = new CallSequenceLoggingPipeline(); new GmlReader(target).ReadGeography(ExpectedMultiPolygonGml(data, coordinateSystem, true)); baseline.VerifyPipeline(target); target = new CallSequenceLoggingPipeline(); new GmlReader(target).ReadGeography(ExpectedMultiPolygonGml(data, coordinateSystem, false)); baseline.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 void ReadPolygonTest(CoordinateSystem coordinateSystem, params PositionData[][] data) { var baseline = PolygonPipelineBaseline(coordinateSystem, data); var target = new CallSequenceLoggingPipeline(); // <LineString><posList>x1 y1 x2 y2 ...</posList></LineString> new GmlReader(target).ReadGeography(ExpectedPolygonGml(data, coordinateSystem, BuildPosList)); baseline.VerifyPipeline(target); target = new CallSequenceLoggingPipeline(); // <LineString><pos>x1 y1</pos><pos>x2 y2 ...</pos></LineString> new GmlReader(target).ReadGeography(ExpectedPolygonGml(data, coordinateSystem, BuildPosArray)); baseline.VerifyPipeline(target); target = new CallSequenceLoggingPipeline(); // <LineString><pointProperty><pos>x1 y1</pos></pointProperty><pointProperty><pos>x2 y2 ...</pos></pointProperty></LineString> new GmlReader(target).ReadGeography(ExpectedPolygonGml(data, coordinateSystem, BuildPointMembers)); baseline.VerifyPipeline(target); }