Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }