コード例 #1
0
 public void TestUnion()
 {
     var bb = new BoundingBox();
     var bb1 = new BoundingBox(-10, 10, 10, 10);
     var union = bb1.Union(bb);
     Assert.That(union.Equals(bb));
 }
コード例 #2
0
ファイル: Polygon.cs プロジェクト: knji/mvvmcross.plugins
        public override BoundingBox GetBoundingBox()
        {
            var bb = new BoundingBox();
            foreach (var ring in Rings)
            {
                bb.Union(ring.GetBoundingBox());
            }

            return bb;
        }
コード例 #3
0
        public void TestBufferBy()
        {
            var features = new[]
                {
                    new Feature(new Point(-15, -25)), 
                    new Feature(new Point(-15, 10)), 
                    new Feature(new Point(20, 10)), 
                    new Feature(new Point(20, -25))
                };

            var bb = new BoundingBox(features.Select(f => f.Geometry).ToArray()).BufferBy(2);
            Assert.That(bb.Equals(new BoundingBox(-17, -27, 22, 12)));
        }
コード例 #4
0
 public void TestCreationByFeatures()
 {
     var features = new []
         {
             new Feature(new Point(-15, -25)), 
             new Feature(new Point(-15, 10)), 
             new Feature(new Point(20, 10)), 
             new Feature(new Point(20, -25))
         };
     
     var bb = new BoundingBox(features.Select( f => f.Geometry).ToArray());
     Console.WriteLine(bb.ToString());
     Assert.That(bb.Equals(new BoundingBox(-15, -25, 20, 10)));
 }
コード例 #5
0
ファイル: BoundingBox.cs プロジェクト: knji/mvvmcross.plugins
        public BoundingBox Union(BoundingBox other)
        {
            var bbox = other.GetBoundingBox();

            SouthWest.X = Math.Min(SouthWest.X, bbox.SouthWest.X);
            SouthWest.Y = Math.Min(SouthWest.Y, bbox.SouthWest.Y);
            NorthEast.X= Math.Max(NorthEast.X, bbox.NorthEast.X);
            NorthEast.Y = Math.Max(NorthEast.Y, bbox.NorthEast.Y);
            return this;
        }
コード例 #6
0
ファイル: BoundingBox.cs プロジェクト: knji/mvvmcross.plugins
 public bool Equals(BoundingBox other)
 {
     if (other == null) return false;
     return other.SouthWest.Equals(SouthWest) && other.NorthEast.Equals(NorthEast);
 }
コード例 #7
0
ファイル: BoundingBox.cs プロジェクト: knji/mvvmcross.plugins
 public BoundingBox(BoundingBox bbox)
 {
     SouthWest = bbox.SouthWest;
     NorthEast = bbox.NorthEast;
 }
コード例 #8
0
 public GeographicCoordinateSystem(string name, string authority, int authorityCode)
     : base(name, authority, authorityCode)
 {
     DefaultBounds = new BoundingBox(-180, -90, 180, 90);
 }
コード例 #9
0
 public static MapQuest.Android.Maps.BoundingBox ConvertBoundingBox(BoundingBox bbox)
 {
     return(new MapQuest.Android.Maps.BoundingBox(new GeoPoint(bbox.NorthEast.Y, bbox.SouthWest.X), new GeoPoint(bbox.SouthWest.Y, bbox.NorthEast.X)));
 }
コード例 #10
0
 public override BoundingBox GetBoundingBox()
 {
     return(BoundingBox.GetBounds(Vertices.ToArray()));
 }
コード例 #11
0
 public static MapQuest.Android.Maps.BoundingBox ConvertBoundingBox(BoundingBox bbox)
 {
     return new MapQuest.Android.Maps.BoundingBox(new GeoPoint(bbox.NorthEast.Y, bbox.SouthWest.X), new GeoPoint(bbox.SouthWest.Y, bbox.NorthEast.X));
 }