Sector

open class Sector(var minLatitude: Angle, var maxLatitude: Angle, var minLongitude: Angle, var maxLongitude: Angle)

Geographic rectangular region.

Inheritors

Constructors

Link copied to clipboard
constructor(minLatitude: Angle, maxLatitude: Angle, minLongitude: Angle, maxLongitude: Angle)
constructor()

Constructs an empty sector with minimum and maximum latitudes and longitudes all 0.

constructor(sector: Sector)

Constructs a sector with the minimum and maximum latitudes and longitudes of a specified sector.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Returns the angle midway between this sector's minimum and maximum latitudes.

Link copied to clipboard

Returns the angle midway between this sector's minimum and maximum longitudes.

Link copied to clipboard

Returns the angle between this sector's minimum and maximum latitudes.

Link copied to clipboard

Returns the angle between this sector's minimum and maximum longitudes.

Link copied to clipboard

Indicates whether this sector has no dimensions.

Link copied to clipboard

Indicates whether this sector contains the full range of latitude 90 to +90 and longitude -180 to +180.

Link copied to clipboard

The sector's maximum latitude.

Link copied to clipboard

The sector's maximum longitude.

Link copied to clipboard

The sector's minimum latitude.

Link copied to clipboard

The sector's minimum longitude.

Functions

Link copied to clipboard
fun centroid(result: Location): Location

Computes the location of the angular center of this sector, which is the mid-angle of each of this sector's latitude and longitude dimensions.

Link copied to clipboard
open fun computeColumn(tileDelta: Angle, longitude: Angle): Int

Computes a column number for a tile within a level given the tile's longitude.

Link copied to clipboard
open fun computeLastColumn(tileDelta: Angle, longitude: Angle): Int

Computes the last column number for a tile within a level given the tile's maximum longitude.

Link copied to clipboard
open fun computeLastRow(tileDelta: Angle, latitude: Angle): Int

Computes the last row number for a tile within a level given the tile's maximum latitude.

Link copied to clipboard
open fun computeRow(tileDelta: Angle, latitude: Angle): Int

Computes a row number for a tile within a level given the tile's latitude.

Link copied to clipboard
fun contains(location: Location): Boolean

Indicates whether this sector contains a specified geographic location. An empty sector never contains a location.

fun contains(sector: Sector): Boolean

Indicates whether this sector fully contains a specified sector. This sector contains the specified sector when the specified sector's boundaries are completely contained within this sector's boundaries, or are equal to this sector's boundaries. An empty sector never contains another sector.
The sectors are assumed to have normalized angles (angles within the range -90, +90 latitude and -180, +180 longitude).

fun contains(latitude: Angle, longitude: Angle): Boolean

Indicates whether this sector contains a specified geographic location. An empty sector never contains a location. Assumes normalized angles: -90, +90, -180, +180

Link copied to clipboard
fun copy(sector: Sector): Sector

Sets this sector to the minimum and maximum latitudes and longitudes of a specified sector.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
fun equals(other: Sector, tolerance: Double): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun intersect(sector: Sector): Boolean

Computes the intersection of this sector and a specified sector, storing the result in this sector and returning whether or not the sectors intersect. Two sectors intersect when both the latitude boundaries and the longitude boundaries overlap by a non-zero amount. An empty sector never intersects another sector. When there is no intersection, this returns false and leaves this sector unchanged.
The sectors are assumed to have normalized angles (angles within the range -90, +90 latitude and -180, +180 longitude).

Link copied to clipboard
fun intersects(sector: Sector): Boolean

Indicates whether this sector intersects a specified sector. Two sectors intersect when both the latitude boundaries and the longitude boundaries overlap by a non-zero amount. An empty sector never intersects another sector.
The sectors are assumed to have normalized angles (angles within the range -90, +90 latitude and -180, +180 longitude).

Link copied to clipboard

Indicates if this sector is next to, or intersects, a specified sector. Two sectors intersect when the conditions of the Sector.intersects methods have been met, and if the boundary or corner is shared with the specified sector. This is a temporary implementation and will be deprecated in future releases.
The sectors are assumed to have normalized angles (angles within the range -90, +90 latitude and -180, +180 longitude).

Link copied to clipboard
fun minLevelNumber(maxLevelNumber: Int): Int

Determines minimal level number relevant for sector of the specified size

Link copied to clipboard
fun set(minLatitude: Angle, minLongitude: Angle, deltaLatitude: Angle, deltaLongitude: Angle): Sector

Sets this sector to the specified latitude, longitude and dimension.

Link copied to clipboard
fun setDegrees(minLatitude: Double, minLongitude: Double, deltaLatitude: Double, deltaLongitude: Double): Sector

Sets this sector to the specified latitude, longitude and dimension in degrees.

Link copied to clipboard

Sets this sector to an empty sector.

Link copied to clipboard

Sets this sector to the full range of latitude 90 to +90 and longitude -180 to +180.

Link copied to clipboard
fun setRadians(minLatitude: Double, minLongitude: Double, deltaLatitude: Double, deltaLongitude: Double): Sector

Sets this sector to the specified latitude, longitude and dimension in radians.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun translate(deltaLatitudeDegrees: Double, deltaLongitudeDegrees: Double): Sector

Translates this sector by a specified geographic increment.
The translated sector is assumed to have normalized angles (angles within the range -90, +90 latitude and -180, +180 longitude).

Link copied to clipboard
fun union(location: Location): Sector

Sets this sector to the union of itself and a specified location.

fun union(sector: Sector): Sector

Sets this sector to the union of itself and a specified sector. This has no effect if the specified sector is empty. If this sector is empty, it is set to the specified sector. Assumes normalized angles: -90, +90, -180, +180

fun union(latitude: Angle, longitude: Angle): Sector

Sets this sector to the union of itself and a specified location. Assumes normalized angles: -90, +90, -180, +180

fun union(array: FloatArray, count: Int, stride: Int): Sector

Sets this sector to the union of itself and an array of specified locations. If this sector is empty, it bounds the specified locations. The array is understood to contain location of at least two coordinates organized as (longitude, latitude, ...), where stride indicates the number of coordinates between longitude values.