A Rect represents a rectangular geographic area defined by the geographic coordinates of its top-left and bottom-right corners.
| Name | Type | Description |
|---|---|---|
top |
H.geo.Latitude |
A value indicating the northern-most latitude |
left |
H.geo.Longitude |
A value indicating the left-most longitude |
bottom |
H.geo.Latitude |
A value indicating the southern-most latitude |
right |
H.geo.Longitude |
A value indicating the right-most latitude |
Extends
Methods
-
H.geo.Rect.coverLatLngAlts (latLngAltArray, opt_skipValidation)H.geo.Rect | undefined static
-
This method creates the minimum rectangular area covering all of the coordinates in the array provided by the caller.
Name Type Description latLngAltArrayArray.<number> An array of coordinates to cover
opt_skipValidationboolean optional A Boolean indicating whether to check validity of the arguments (
true)Returns:
Type Description H.geo.Rect | undefined The smallest rectangle covering the supplied coordinates -
H.geo.Rect.coverPoints (pointArray, opt_skipValidation)H.geo.Rect static
-
This method creates the minimum rectangular area covering all of the points in the array provided by the caller.
Name Type Description pointArrayArray.<!H.geo.IPoint> An array of points to cover
opt_skipValidationboolean optional A Boolean indicating whether to check validity of the arguments (
true)Returns:
Type Description H.geo.Rect The minimum rectangle covering the points provided by the caller or nullif the supplied point array was empty -
H.geo.Rect.coverRects (rectList, opt_skipValidation)H.geo.Rect | undefined static
-
This method creates the smallest rectangular area covering all of the rectangular areas in the array provided by the caller.
Name Type Description rectListArray.<!H.geo.Rect> A list of rectangle objects to cover
opt_skipValidationboolean optional A Boolean indicating whether to check validity of the arguments (
true)Returns:
Type Description H.geo.Rect | undefined The smallest rectangle covering the all rectangles in the list provided by the caller -
H.geo.Rect.fromPoints (topLeft, bottomRight, opt_skipValidation)H.geo.Rect static
-
This method creates a rectangular area from a top-left and bottom-right points provided by the caller.
Name Type Description topLeftH.geo.IPoint An object representing the top-left corner of the area
bottomRightH.geo.IPoint An object representing the bottom-right corner of the area
opt_skipValidationboolean optional A Boolean flag indicating whether to check validity of the arguments (
true)Returns:
Type Description H.geo.Rect An object representing the rectangular area defined by the top-left and bottom-right corners provided by the caller -
H.geo.Rect.merge (topA, leftA, bottomA, rightA, topB, leftB, bottomB, rightB, opt_out)H.geo.Rect static
-
This method merges two rectangle objects defines by their coordinates. The result of the merge is a rectangle that covers the both provided rectangles.
Name Type Description topAH.geo.Latitude A value representing the northern-most latitude
leftAH.geo.Longitude A value representing the left-most longitude of operand A
bottomAH.geo.Latitude A value representing the southern-most latitude of operand A
rightAH.geo.Longitude A value representing the right-most latitude of operand A
topBH.geo.Latitude A value representing the northern-most latitude of operand B
leftBH.geo.Longitude A value representing the left-most longitude of operand B
bottomBH.geo.Latitude A value representing the southern-most latitude of operand B
rightBH.geo.Longitude A value representing the right-most latitude of operand B
opt_outH.geo.Rect optional An optional rectangle object to store the results
Returns:
Type Description H.geo.Rect Either the rectangle provide by opt_outor a new rectangle -
clone ()H.geo.Rect
-
This method clones the given rectangle.
Returns:
Type Description H.geo.Rect An object representing a clone of the given rectangle -
This method checks if the latitude and longitude supplied by the caller lie within the area of the given rectangular area.
Name Type Description latH.geo.Latitude A value representing the latitude
lngH.geo.Longitude A value representing the longitude
opt_skipValidationboolean optional A Boolean indicating whether to check the validity of the arguments (
true)Returns:
Type Description boolean trueif the latitude and longitude are contained in this area, otherwisefalse -
This method checks if the point supplied by the caller lies within the area of the given rectangular area.
Name Type Description geoPointH.geo.IPoint An object representing the point to check
opt_skipValidationboolean optional A Boolean indicating whether to check validity of the arguments (
true)Returns:
Type Description boolean trueif the point is contained in this area, otherwisefalse -
This method checks if the rectangular area supplied by the caller is completely contained within the given rectangular area.
Name Type Description geoRectH.geo.Rect An object representing the rectangular area to check
opt_skipValidationboolean optional A Boolean indicating whether to check validity of the arguments (
true)Returns:
Type Description boolean trueif the rectangular area is contained in the given area, otherwisefalse -
Checks whether the geometry is equal to the geometry supplied by the caller. Two geometries are considered as equal if they represent the same geometry type and have equal coordinate values.
Name Type Description other* The geometry to check against
Returns:
Type Description boolean trueif the two geometries are equal, otherwisefalse -
getBottom ()H.geo.Latitude
-
This method retrieves the southern-most latitude of the given rectangular area.
Returns:
Type Description H.geo.Latitude A value representing the southern-most latitude of the area -
getBottomRight ()H.geo.Point
-
This method retrieves the bottom-right corner of the given rectangular area.
Returns:
Type Description H.geo.Point An object containing the geographic coordinates of the given rectangle -
getBoundingBox ()H.geo.Rect inherited overrides
-
Returns the bounding rectangle of the geometry.
Returns:
Type Description H.geo.Rect the bounding rectangle of the geometry or nullif the bounding rectangle can't be computed (e.g. for a geometry without coordinates) -
getCenter ()H.geo.Point
-
This method retrieves the center point of the given rectangular area.
Returns:
Type Description H.geo.Point An object representing the center point of the area -
This method retrieves the height of the given rectangular area in decimal degrees.
Returns:
Type Description number A value representing the height of this area -
getLeft ()H.geo.Longitude
-
This method retrieves the left-most longitude of the given rectangular area.
Returns:
Type Description H.geo.Longitude A value representing the left-most longitude of the area -
getRight ()H.geo.Longitude
-
This method retrieves the right-most longitude of the given rectangular area.
Returns:
Type Description H.geo.Longitude A value representing the right-most longitude of the area -
getTop ()H.geo.Latitude
-
This method retrieves the north-most latitude of the given rectangular area.
Returns:
Type Description H.geo.Latitude A value representing the northern-most latitude of the rectangle -
getTopLeft ()H.geo.Point
-
This method retrieves the top-left corner of the given rectangular area.
Returns:
Type Description H.geo.Point An object containing the geographic coordinates of the the top-left corner of the given rectangle -
This method retrieves the width of the given rectangular area in decimal degrees.
Returns:
Type Description number A value representing the width of this area -
This method checks if the intersection of two bounding boxes is non-empty.
Name Type Description geoRectH.geo.Rect An object representing a rectangle object to test for intersection with the given rectangle
opt_skipValidationboolean optional A Boolean indicating whether to check validity of the arguments (
true)Returns:
Type Description boolean A Boolean value indicating if the two bounding boxes intersect ( true) or not (false) -
This method checks if the given rectangular area spans the date border.
Returns:
Type Description boolean trueif the area spans the date border, otherwisefalse -
The method checks if the area enclosed by the given bounding box is 0.
Returns:
Type Description boolean trueif the dimensions of the area are 0, otherwisefalse -
mergeLatLng (lat, lng, opt_skipValidation, opt_out)H.geo.Rect
-
This method retrieves the smallest bounding box that covers the given rectangular area and the latitude and longitude supplied by the caller.
Name Type Description latH.geo.Latitude A value representing the latitude to check
lngH.geo.Longitude A value representing the longitude to check
opt_skipValidationboolean optional A Boolean indicating whether to check validity of the arguments (
true)opt_outH.geo.Rect optional An optional rectangle object to store the result
Returns:
Type Description H.geo.Rect Either the rectangle object provided as the out parameter or a new rectangle object -
mergePoint (geoPoint, opt_skipValidation, opt_out)H.geo.Rect
-
This method retrieves the smallest bounding box that covers the given rectangular area and the point supplied by the caller.
Name Type Description geoPointH.geo.IPoint An object representing the point to include
opt_skipValidationboolean optional A Boolean indicating whether to check validity of the arguments (
true)opt_outH.geo.Rect optional An optional rectangle object to store the result
Returns:
Type Description H.geo.Rect Either the rectangle received as the out parameter or a new rectangle object -
mergeRect (geoRect, opt_skipValidation, opt_out)H.geo.Rect
-
This method retrieves the smallest bounding box that covers the given rectangle area and the rectangle supplied by the caller.
Name Type Description geoRectH.geo.Rect An object representing the rectangle to include
opt_skipValidationboolean optional A Boolean flag indicating whether to check validity of the arguments (
true)opt_outH.geo.Rect optional an optional rectangle object to store the result
Returns:
Type Description H.geo.Rect Either the rectangular area received as the out parameter or a new rectangle object -
mergeTopLeftBottomRight (top, left, bottom, right, opt_skipValidation, opt_out)H.geo.Rect
-
This method retrieves the smallest bounding box that covers the given rectangle area and the rectangle supplied by the caller as a set of coordinates.
Name Type Description topH.geo.Latitude A value indicating the top latitude of the rectangle to include
leftH.geo.Longitude A value indicating the left longitude of the rectangle to include
bottomH.geo.Latitude A value indicating the bottom latitude of the rectangle to include
rightH.geo.Longitude A value indicating the right longitude of the rectangle to include
opt_skipValidationboolean optional A Boolean flag indicating whether to check validity of the arguments (
true)opt_outH.geo.Rect optional An optional rectangle object to store the result
Returns:
Type Description H.geo.Rect Either the rectangle received as the out parameter or a new rectangle object -
resizeToCenter (center, opt_out)H.geo.Rect
-
This method clones the given bounding rectangle and resizes the clone if necessary until the location supplied by the caller is at its center.
Name Type Description centerH.geo.IPoint A point object which is to be the center of the resized rectangular area
opt_outH.geo.Rect optional An optional rectangle object to store the result
Returns:
Type Description H.geo.Rect An object representing the resulting rectangle -
toGeoJSON ()Object inherited
-
To obtain a GeoJSON representation of the given geometry.
Returns:
Type Description Object A GeoJSON Geometry object representing the given geometry. -
toString () inherited
-
To obtain a Well-Known-Text (WKT) representation of the geometry.