Пример #1
0
        private static void WritePoint(XmlWriter writer, Point point, string label)
        {
            writer.WriteStartElement("PNT");
            writer.WriteXmlAttribute("A", "2");
            writer.WriteXmlAttribute("B", label);
            writer.WriteXmlAttribute("C", point.Y.ToString(CultureInfo.InvariantCulture)); // Latitude
            writer.WriteXmlAttribute("D", point.X.ToString(CultureInfo.InvariantCulture)); // Longitude

            writer.WriteEndElement();
        }
Пример #2
0
 public static Position MapPoint(AgGateway.ADAPT.ApplicationDataModel.Shapes.Point point, AffineTransformation affineTransformation = null)
 {
     if (affineTransformation != null)
     {
         var movedPoint = AnonymizeUtils.MovePoint(point, affineTransformation);
         return(new Position(movedPoint.Y, movedPoint.X, point.Z));
     }
     else
     {
         return(new Position(point.Y, point.X, point.Z));
     }
 }
Пример #3
0
        public static GeoJSON.Net.Geometry.Point MapPoint2Point(AgGateway.ADAPT.ApplicationDataModel.Shapes.Point point, AffineTransformation affineTransformation = null)
        {
            Position position = null;

            if (affineTransformation != null)
            {
                var movedPoint = AnonymizeUtils.MovePoint(point, affineTransformation);
                position = new Position(movedPoint.Y, movedPoint.X, point.Z);
            }
            else
            {
                position = new Position(point.Y, point.X, point.Z);
            }
            return(new GeoJSON.Net.Geometry.Point(position));
        }
Пример #4
0
 public static void AreEqual(XmlNode pointNode, Point point)
 {
     Assert.AreEqual(double.Parse(pointNode.GetXmlAttribute("C")), point.Y);
     Assert.AreEqual(double.Parse(pointNode.GetXmlAttribute("D")), point.X);
 }
Пример #5
0
        public void GivenPointWhenCreatedThenTypeShouldBePoint()
        {
            var shape = new Point();

            Assert.AreEqual(ShapeTypeEnum.Point, shape.Type);
        }