BoundingBox Class |
Namespace: Telogis.GeoBase
The BoundingBox type exposes the following members.
Name | Description | |
---|---|---|
BoundingBox |
Create a BoundingBox with no boundaries set.
| |
BoundingBox(BoundingBox) |
Create a BoundingBox that contains the given BoundingBox.
| |
BoundingBox(LatLon) |
Constructs a new BoundingBox around the specified points.
|
Name | Description | |
---|---|---|
AllowCrossAntimeridian |
Whether the BoundingBox is allowed to straddle the antimeridian (the meridian at +/-
180 degrees). The default is true.
| |
BorderWidth |
Gets or sets the width of the BoundingBox border.
| |
BottomLeft |
The bottom-left corner of the BoundingBox.
| |
BottomRight |
The bottom-right corner of the BoundingBox.
| |
Center |
Gets a LatLon representing the center of the BoundingBox.
| |
Color |
Gets or sets the color of the bounding box if it were to be rendered on the map.
| |
Height |
Gets the height of the BoundingBox in degrees.
| |
InnerColor |
Gets or sets the inner color of the BoundingBox. Default is transparent.
| |
IsValid |
Returns true only if this BoundingBox's corner points have been assigned valid values.
| |
Rectangle | ||
RequiredRendermodes |
Gets the RenderMode required by this BoundingBox.
| |
TopLeft |
The top-left corner of the BoundingBox.
| |
TopRight |
The top-right corner of the BoundingBox.
| |
Width |
Gets the width of the BoundingBox in degrees.
| |
WKT |
A string that describes the BoundingBox in WKT (Well-Known Text) format.
| |
WorldBounds |
Returns a BoundingBox that covers the whole world.
|
Name | Description | |
---|---|---|
Add(BoundingBox) |
Inflate the BoundingBox to include this box.
| |
Add(LatLon) |
Inflate the BoundingBox to contain the given point.
| |
Clone |
Makes a clone of the BoundingBox.
| |
Contains(BoundingBox) |
Tests to see if this BoundingBox fully contains another bounding box.
| |
Contains(LatLon) |
Test if a given point lies within this BoundingBox. Points on the edge
of the BoundingBox are considered to be outside.
| |
Equals(BoundingBox) |
Compares this object to the parameter BoundingBox.
| |
Equals(Object) |
Compares this object to the parameter object.
(Overrides ObjectEquals(Object).) | |
GetHashCode |
Returns a unique integer for this object.
(Overrides ObjectGetHashCode.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Inflate(Double) |
Make each side of the BoundingBox bigger or smaller by the given number of degrees.
| |
Inflate(Double, Double) |
Makes each side of the BoundingBox bigger or smaller by the given number of degrees.
| |
InflateBy |
Multiply the BoundingBox dimensions by the given amount.
| |
Intersection |
Gets the intersection of two BoundingBoxes. There can be anywhere between zero and two
intersection areas.
| |
Intersects |
Test whether this BoundingBox intersects with the specified
BoundingBox.
| |
Normalize | ||
Render |
Renders the BoundingBox on a given graphics output with a given context.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
P1 |
Represents the Min point (bottom-left corner).
| |
P2 |
Represents the Max point (top-right corner).
|
A general purpose object used to represent a rectangular area. It has methods to allow resizing and to determine whether a given point lies within the box area. Some of the uses for BoundingBoxes are: zooming, or hit-testing a given area.
If adjusting points manually, please refer to remarks on P1 for important usage information.
Related articles: Data Query Concept, Avoiding a Given Area.
BoundingBox bb = new BoundingBox(); // using the Add method is a safe and easy way of // setting up the BoundingBox. These are arbitrary points // in Los Angeles, USA. bb.Add(new LatLon(33.94, -118.34)); bb.Add(new LatLon(33.78, -117.95)); // we can calculate the center of the BoundingBox: LatLon ll = bb.Center; // and we can check if the center of the BoundingBox // is *in* the BoundingBox... Console.WriteLine("Center is in BB? " + bb.Contains(ll)); // ... this will, of course, be true... // we can also dump the box in WKT format: Console.WriteLine(bb.WKT); // if we have a Map object, we can zoom the Map to our BoundingBox. We need to set a buffer, which is the // number of pixels between the edge of the box and the edge of the visible map area. int edgeBuffer = 10; myMap.ZoomToBoundingBox(bb, edgeBuffer);