Example #1
0
        private static void ReadPointTest(PositionData data, CoordinateSystem coordinateSystem)
        {
            var target = new CallSequenceLoggingPipeline();

            new GmlReader(target).ReadGeography(ExpectedPointGml(data, coordinateSystem));
            PointPipelineBaseline(coordinateSystem, data).VerifyPipeline(target);
        }
Example #2
0
 private static void VerifyPosition(PositionData expected, GeographyPoint actual)
 {
     Assert.Equal(expected.Latitude, actual.Latitude);
     Assert.Equal(expected.Longitude, actual.Longitude);
     Assert.Equal(expected.Z, actual.Z);
     Assert.Equal(expected.M, actual.M);
 }
Example #3
0
        private static XmlReader ExpectedPointGml(PositionData point, CoordinateSystem coordinateSystem)
        {
            StringBuilder payloadBuilder = new StringBuilder();

            BuildPointGml(point, payloadBuilder, coordinateSystem);

            XElement xel = XElement.Parse(payloadBuilder.ToString());

            return(xel.CreateReader());
        }
        private static void ReadPointTest(SpatialFormatter<TextReader, TextWriter> formatter, TextReader input, PositionData expected, CoordinateSystem expectedCoordinateSystem = null)
        {
            var p = formatter.Read<Geography>(input);
            Assert.NotNull(p);
            p.VerifyAsPoint(expected);

            if (expectedCoordinateSystem != null)
            {
                Assert.Equal(p.CoordinateSystem, expectedCoordinateSystem);
            }
        }
Example #5
0
 private static void AddPointToPipeline(ICommonLoggingPipeline pipeline, PositionData point, bool firstPoint)
 {
     if (firstPoint)
     {
         pipeline.BeginFigure(point.Latitude, point.Longitude, point.Z, point.M);
     }
     else
     {
         pipeline.AddLineTo(point.Latitude, point.Longitude, point.Z, point.M);
     }
 }
Example #6
0
        public static void DrawLine(GeometryPipeline pipeline, PositionData[] line)
        {
            for (int i = 0; i < line.Length; ++i)
            {
                PositionData currentLine = line[i];
                if (i == 0)
                {
                    pipeline.BeginFigure(new GeometryPosition(currentLine.X, currentLine.Y, currentLine.Z, currentLine.M));
                }
                else
                {
                    pipeline.LineTo(new GeometryPosition(currentLine.X, currentLine.Y, currentLine.Z, currentLine.M));
                }
            }

            pipeline.EndFigure();
        }
Example #7
0
        private static void BuildPointGml(PositionData point, StringBuilder builder, CoordinateSystem coordinateSystem = null)
        {
            if (coordinateSystem != null)
            {
                builder.Append(GmlShapeElement("Point", coordinateSystem.EpsgId));
            }
            else
            {
                builder.Append(GmlElement("Point"));
            }

            builder.Append(GmlElement("pos"));
            if (point != null)
            {
                builder.Append(GmlPostionText(point.Latitude, point.Longitude, point.Z, point.M));
            }
            builder.Append(GmlEndElement("pos"));
            builder.Append(GmlEndElement("Point"));
        }
Example #8
0
 internal static void DrawPoint(TypeWashedPipeline pipeline, PositionData point)
 {
     pipeline.BeginFigure(point.X, point.Y, point.Z, point.M);
     pipeline.EndFigure();
 }
Example #9
0
 public static void DrawPoint(GeometryPipeline pipeline, PositionData point)
 {
     pipeline.BeginFigure(new GeometryPosition(point.X, point.Y, point.Z, point.M));
     pipeline.EndFigure();
 }
Example #10
0
 internal static void DrawPoint(TypeWashedPipeline pipeline, PositionData point)
 {
     pipeline.BeginFigure(point.X, point.Y, point.Z, point.M);
     pipeline.EndFigure();
 }
Example #11
0
        internal static void DrawLine(TypeWashedPipeline pipeline, PositionData[] line)
        {
            for (int i = 0; i < line.Length; ++i)
            {
                if (i == 0)
                {
                    pipeline.BeginFigure(line[i].X, line[i].Y, line[i].Z, line[i].M);
                }
                else
                {
                    pipeline.LineTo(line[i].X, line[i].Y, line[i].Z, line[i].M);
                }
            }

            pipeline.EndFigure();
        }
Example #12
0
 public static void VerifyAsPoint(this Geography data, PositionData expected)
 {
     VerifyTypedInstance <GeographyPoint>(data, expected == null, (actual) => VerifyPosition(expected, actual));
 }
Example #13
0
        public static void DrawLine(GeographyPipeline pipeline, PositionData[] line)
        {
            for (int i = 0; i < line.Length; ++i)
            {
                if (i == 0)
                {
                    pipeline.BeginFigure(new GeographyPosition(line[i].X, line[i].Y, line[i].Z, line[i].M));
                }
                else
                {
                    pipeline.LineTo(new GeographyPosition(line[i].X, line[i].Y, line[i].Z, line[i].M));
                }
            }

            pipeline.EndFigure();
        }
Example #14
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);
        }
 private void ReadPointTest(string input, PositionData expected, CoordinateSystem expectedCoordinateSystem = null)
 {
     ReadPointTest(this.d4Formatter, new StringReader(input), expected, expectedCoordinateSystem);
 }
        private static void ReadPointTest(SpatialFormatter <TextReader, TextWriter> formatter, TextReader input, PositionData expected, CoordinateSystem expectedCoordinateSystem = null)
        {
            var p = formatter.Read <Geography>(input);

            Assert.NotNull(p);
            p.VerifyAsPoint(expected);

            if (expectedCoordinateSystem != null)
            {
                Assert.Equal(p.CoordinateSystem, expectedCoordinateSystem);
            }
        }
Example #17
0
        public static void DrawLine(GeometryPipeline pipeline, PositionData[] line)
        {
            for (int i = 0; i < line.Length; ++i)
            {
                PositionData currentLine = line[i];
                if (i == 0)
                {
                    pipeline.BeginFigure(new GeometryPosition(currentLine.X, currentLine.Y, currentLine.Z, currentLine.M));
                }
                else
                {
                    pipeline.LineTo(new GeometryPosition(currentLine.X, currentLine.Y, currentLine.Z, currentLine.M));
                }
            }

            pipeline.EndFigure();
        }
Example #18
0
 public static void DrawPoint(GeometryPipeline pipeline, PositionData point)
 {
     pipeline.BeginFigure(new GeometryPosition(point.X, point.Y, point.Z, point.M));
     pipeline.EndFigure();
 }
 private void ReadPointTest(string input, PositionData expected, CoordinateSystem expectedCoordinateSystem = null)
 {
     ReadPointTest(this.d4Formatter, new StringReader(input), expected, expectedCoordinateSystem);
 }