private static void ReadPointTest(PositionData data, CoordinateSystem coordinateSystem) { var target = new CallSequenceLoggingPipeline(); new GmlReader(target).ReadGeography(ExpectedPointGml(data, coordinateSystem)); PointPipelineBaseline(coordinateSystem, data).VerifyPipeline(target); }
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); }
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); } }
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); } }
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(); }
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")); }
internal static void DrawPoint(TypeWashedPipeline pipeline, PositionData point) { pipeline.BeginFigure(point.X, point.Y, point.Z, point.M); pipeline.EndFigure(); }
public static void DrawPoint(GeometryPipeline pipeline, PositionData point) { pipeline.BeginFigure(new GeometryPosition(point.X, point.Y, point.Z, point.M)); pipeline.EndFigure(); }
internal static void DrawPoint(TypeWashedPipeline pipeline, PositionData point) { pipeline.BeginFigure(point.X, point.Y, point.Z, point.M); pipeline.EndFigure(); }
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(); }
public static void VerifyAsPoint(this Geography data, PositionData expected) { VerifyTypedInstance <GeographyPoint>(data, expected == null, (actual) => VerifyPosition(expected, actual)); }
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(); }
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); } }
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(); }
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); }