Example #1
0
        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);
        }
Example #2
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);
        }
Example #3
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);
        }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
 public void MergeCalls(GeographyLoggingPipeline target, bool keepAllSetCrsCalls = false)
 {
     this.pipeline.Merge(target.pipeline, keepAllSetCrsCalls);
 }
Example #7
0
 public void MergeCalls(GeographyLoggingPipeline target, bool keepAllSetCrsCalls = false)
 {
     this.pipeline.Merge(target.pipeline, keepAllSetCrsCalls);
 }
        private static ICommonLoggingPipeline GetExpectedPipeline(SpatialType spatialType, CoordinateSystem coordinateSystem, bool isGeography, Action<ICommonLoggingPipeline> writeShape)
        {
            ICommonLoggingPipeline expectedPipeline;
            if (isGeography)
            {
                expectedPipeline = new GeographyLoggingPipeline();
            }
            else
            {
                expectedPipeline = new GeometryLoggingPipeline();
            }

            expectedPipeline.SetCoordinateSystem(coordinateSystem);
            expectedPipeline.BeginShape(spatialType);
            writeShape(expectedPipeline);
            expectedPipeline.EndShape();
            return expectedPipeline;
        }