GeoRect

class GeoRect

Represents a geographical 2D rectangular area defined by two opposite corners such as :

min.x = MIN(p1.x, p2.x); min.y = MIN(p1.y, p2.y); max.x = MAX(p1.x, p2.x); max.y = MAX(p1.y, p2.y);

Constructors

Link copied to clipboard
constructor(minLon: Double, minLat: Double, maxLon: Double, maxLat: Double)
Defines a 2D rectangle by two points (min and max).
constructor(min: GeoPoint, max: GeoPoint)
Defines a 2D rectangle by two GeoPoint (min and max).

Functions

Link copied to clipboard
open fun contains(pt: GeoPoint): Boolean
Checks whether this 2D-rectangle contains the given point.
Link copied to clipboard
open fun intersects(rect: GeoRect): GeoRect
Computes the intersection of this 2D-rectangle with another.
Link copied to clipboard
open fun intersectsWith(rect: GeoRect): Boolean
Checks whether this 2D-rectangle intersects with another.
Link copied to clipboard
open fun makeUnion(rect: GeoRect)
Makes the union of this 2D-rectangle with another.
Link copied to clipboard
open fun maxX(): Double
Returns the max x-coordinate of the rectangle.
Link copied to clipboard
open fun maxY(): Double
Returns the max y-coordinate of the rectangle.
Link copied to clipboard
open fun minX(): Double
Returns the min x-coordinate of the rectangle.
Link copied to clipboard
open fun minY(): Double
Returns the min y-coordinate of the rectangle.
Link copied to clipboard
open fun setMax(max: GeoPoint)
open fun setMax(x: Int, y: Int)
Sets the max point of the rectangle
Link copied to clipboard
open fun setMin(min: GeoPoint)
open fun setMin(x: Int, y: Int)
Sets the min point of the rectangle
Link copied to clipboard
Link copied to clipboard
open fun toString(): String