Class: Sector

Sector(minLatitude, maxLatitude, minLongitude, maxLongitude)

Represents a rectangular region in geographic coordinates in degrees.

Constructor

new Sector(minLatitude, maxLatitude, minLongitude, maxLongitude)

Constructs a Sector from specified minimum and maximum latitudes and longitudes in degrees.
Parameters:
Name Type Description
minLatitude Number The sector's minimum latitude in degrees.
maxLatitude Number The sector's maximum latitude in degrees.
minLongitude Number The sector's minimum longitude in degrees.
maxLongitude Number The sector's maximum longitude in degrees.
Source:

Members

(static, constant) FULL_SPHERE :Sector

A sector that encompasses the full range of latitude ([-90, 90]) and longitude ([-180, 180]).
Type:
Source:

(static, constant) ZERO :Sector

A sector with minimum and maximum latitudes and minimum and maximum longitudes all zero.
Type:
Source:

maxLatitude :Number

This sector's maximum latitude in degrees.
Type:
  • Number
Source:

maxLongitude :Number

This sector's maximum longitude in degrees.
Type:
  • Number
Source:

minLatitude :Number

This sector's minimum latitude in degrees.
Type:
  • Number
Source:

minLongitude :Number

This sector's minimum longitude in degrees.
Type:
  • Number
Source:

Methods

(static) splitBoundingSectors(locations) → {Array.<Sector>}

Computes bounding sectors from a list of locations that span the dateline.
Parameters:
Name Type Description
locations Array.<Location> The locations to bound.
Source:
Throws:
If the specified array is null, undefined or empty or the number of locations is less than 2.
Type
ArgumentError
Returns:
Two sectors, one in the eastern hemisphere and one in the western hemisphere. Returns null if the computed bounding sector has zero width or height.
Type
Array.<Sector>

centroid(result) → {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.
Parameters:
Name Type Description
result Location A pre-allocated Location in which to return the computed centroid.
Source:
Throws:
If the result argument is null or undefined.
Type
ArgumentError
Returns:
The specified result argument containing the computed centroid.
Type
Location

centroidLatitude() → {Number}

Returns the angle midway between this sector's minimum and maximum latitudes.
Source:
Returns:
The mid-angle of this sector's minimum and maximum latitudes, in degrees.
Type
Number

centroidLongitude() → {Number}

Returns the angle midway between this sector's minimum and maximum longitudes.
Source:
Returns:
The mid-angle of this sector's minimum and maximum longitudes, in degrees.
Type
Number

computeBoundingPoints(globe, verticalExaggeration) → {Vec3}

Returns an array of Vec3 that bounds the specified sector on the surface of the specified Globe. The returned points enclose the globe's surface terrain in the sector, according to the specified vertical exaggeration, minimum elevation, and maximum elevation. If the minimum and maximum elevation are equal, this assumes a maximum elevation of 10 + the minimum.
Parameters:
Name Type Description
globe Globe the globe the extent relates to.
verticalExaggeration Number the globe's vertical surface exaggeration.
Source:
Throws:
if the globe is null.
Type
ArgumentError
Returns:
a set of points that enclose the globe's surface on the specified sector. Can be turned into a BoundingBox with the setToVec3Points method.
Type
Vec3

contains(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. The sectors are assumed to have normalized angles (angles within the range [-90, 90] latitude and [-180, 180] longitude).
Parameters:
Name Type Description
sector Sector The sector to test containment with. May be null or undefined, in which case this function returns false.
Source:
Returns:
true if the specified sector contains this sector, otherwise false.
Type
Boolean

containsLocation(latitude, longitude) → {Boolean}

Indicates whether this sector contains a specified geographic location.
Parameters:
Name Type Description
latitude Number The location's latitude in degrees.
longitude Number The location's longitude in degrees.
Source:
Returns:
true if this sector contains the location, otherwise false.
Type
Boolean

copy(sector) → {Sector}

Sets this sector's latitudes and longitudes to those of a specified sector.
Parameters:
Name Type Description
sector Sector The sector to copy.
Source:
Throws:
If the specified sector is null or undefined.
Type
ArgumentError
Returns:
This sector, set to the values of the specified sector.
Type
Sector

deltaLatitude() → {Number}

Returns the angle between this sector's minimum and maximum latitudes, in degrees.
Source:
Returns:
The difference between this sector's minimum and maximum latitudes, in degrees.
Type
Number

deltaLongitude() → {Number}

Returns the angle between this sector's minimum and maximum longitudes, in degrees.
Source:
Returns:
The difference between this sector's minimum and maximum longitudes, in degrees.
Type
Number

getCorners() → {Array}

Returns a list of the Lat/Lon coordinates of a Sector's corners.
Source:
Returns:
an array of the four corner locations, in the order SW, SE, NE, NW
Type
Array

intersection(sector) → {Sector}

Sets this sector to the intersection of itself and a specified sector.
Parameters:
Name Type Description
sector Sector The sector to intersect with this one.
Source:
Throws:
If the specified sector is null or undefined.
Type
ArgumentError
Returns:
This sector, set to its intersection with the specified sector.
Type
Sector

intersects(sector) → {Boolean}

Indicates whether this sector intersects a specified sector. This sector intersects the specified sector when each sector's boundaries either overlap with the specified sector or are adjacent to the specified sector. The sectors are assumed to have normalized angles (angles within the range [-90, 90] latitude and [-180, 180] longitude).
Parameters:
Name Type Description
sector Sector The sector to test intersection with. May be null or undefined, in which case this function returns false.
Source:
Returns:
true if the specifies sector intersections this sector, otherwise false.
Type
Boolean

isEmpty() → {Boolean}

Indicates whether this sector has width or height.
Source:
Returns:
true if this sector's minimum and maximum latitudes or minimum and maximum longitudes do not differ, otherwise false.
Type
Boolean

maxLatitudeRadians() → {Number}

Returns this sector's maximum latitude in radians.
Source:
Returns:
This sector's maximum latitude in radians.
Type
Number

maxLongitudeRadians() → {Number}

Returns this sector's maximum longitude in radians.
Source:
Returns:
This sector's maximum longitude in radians.
Type
Number

minLatitudeRadians() → {Number}

Returns this sector's minimum latitude in radians.
Source:
Returns:
This sector's minimum latitude in radians.
Type
Number

minLongitudeRadians() → {Number}

Returns this sector's minimum longitude in radians.
Source:
Returns:
This sector's minimum longitude in radians.
Type
Number

overlaps(sector) → {Boolean}

Indicates whether this sector intersects a specified sector exclusive of the sector boundaries. This sector overlaps the specified sector when the union of the two sectors defines a non-empty sector. The sectors are assumed to have normalized angles (angles within the range [-90, 90] latitude and [-180, 180] longitude).
Parameters:
Name Type Description
sector Sector The sector to test overlap with. May be null or undefined, in which case this function returns false.
Source:
Returns:
true if the specified sector overlaps this sector, otherwise false.
Type
Boolean

setToBoundingSector(locations) → {Sector}

Modifies this sector to encompass an array of specified locations.
Parameters:
Name Type Description
locations Array.<Location> An array of locations. The array may be sparse.
Source:
Throws:
If the specified array is null, undefined or empty or has fewer than two locations.
Type
ArgumentError
Returns:
This sector, modified to encompass all locations in the specified array.
Type
Sector

union(sector) → {Sector}

Sets this sector to the union of itself and a specified sector.
Parameters:
Name Type Description
sector Sector The sector to union with this one.
Source:
Throws:
if the specified sector is null or undefined.
Type
ArgumentError
Returns:
This sector, set to its union with the specified sector.
Type
Sector