Ejemplo n.º 1
0
        public override bool Equals(Geometry other)
        {
            var line = other as LineString;
            if (line == null) return false;
            if (line.Vertices == null || line.Vertices.Count == 0)
                return false;

            return !Vertices.Where((t, i) => !t.Equals(line.Vertices[i])).Any();
        }
Ejemplo n.º 2
0
        public override bool Equals(Geometry other)
        {
            var p1 = other as Point;
            if (p1 == null)
                return false;

            return DistanceByHaversineInKm(X, Y, p1.X, p1.Y)*1000 < 2;
            //return X.CompareTo(p1.X) == 0 && Y.CompareTo(p1.Y) == 0 && Z.CompareTo(p1.Z) == 0;
        }
        public static object Convert(Geometry geometry)
        {
            if (geometry.GeometryType == GeometryType.Point)
                return ConvertPoint((Point) geometry);
            if (geometry.GeometryType == GeometryType.LineString)
                return ConvertLine((LineString) geometry);
            if (geometry.GeometryType == GeometryType.LinearRing)
                return ConvertLine((LinearRing) geometry);
            if (geometry.GeometryType == GeometryType.Polygon)
                return ConvertPolygon((Polygon) geometry);

            throw new ArgumentException(string.Format("{0} geometry type not supported.", geometry.GeometryType));
        }
        public static object Convert(Geometry geometry)
        {
            if (geometry.GeometryType == GeometryType.Point)
            {
                return(ConvertPoint((Point)geometry));
            }
            if (geometry.GeometryType == GeometryType.LineString)
            {
                return(ConvertLine((LineString)geometry));
            }
            if (geometry.GeometryType == GeometryType.LinearRing)
            {
                return(ConvertLine((LinearRing)geometry));
            }
            if (geometry.GeometryType == GeometryType.Polygon)
            {
                return(ConvertPolygon((Polygon)geometry));
            }

            throw new ArgumentException(string.Format("{0} geometry type not supported.", geometry.GeometryType));
        }
 public CompassOrientationFeature(Geometry geometry)
     : base(geometry, new Dictionary<string, string>())
 {
     Attributes.Add("type", typeof(CompassOrientationFeature).Name);
 }
Ejemplo n.º 6
0
 public UserLocationFeature(Geometry geometry) : base(geometry, new Dictionary<string, string>())
 {
     Attributes.Add("type", typeof(UserLocationFeature).Name);
 }
Ejemplo n.º 7
0
 public Feature(Geometry geometry, IDictionary<string, string> attributes = null )
 {
     Geometry = geometry;
     Attributes = attributes ?? new Dictionary<string, string>();
     TimeStamp = DateTime.UtcNow;
 }
Ejemplo n.º 8
0
 public override bool Equals(Geometry other)
 {
     throw new System.NotImplementedException();
 }