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)); }
public override BoundingBox GetBoundingBox() { var bb = new BoundingBox(); foreach (var ring in Rings) { bb.Union(ring.GetBoundingBox()); } return bb; }
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))); }
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))); }
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; }
public bool Equals(BoundingBox other) { if (other == null) return false; return other.SouthWest.Equals(SouthWest) && other.NorthEast.Equals(NorthEast); }
public BoundingBox(BoundingBox bbox) { SouthWest = bbox.SouthWest; NorthEast = bbox.NorthEast; }
public GeographicCoordinateSystem(string name, string authority, int authorityCode) : base(name, authority, authorityCode) { DefaultBounds = new BoundingBox(-180, -90, 180, 90); }
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))); }
public override BoundingBox GetBoundingBox() { return(BoundingBox.GetBounds(Vertices.ToArray())); }
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)); }