Class: ElevationModel

ElevationModel(coverageSector, levelZeroDelta, numLevels, retrievalImageFormat, cachePath, tileWidth, tileHeight)

Represents the elevations for an area, often but not necessarily the whole globe.

While this class can be used as-is, it is intended to be a base class for more concrete elevation models, such as EarthElevationModel.

Constructor

new ElevationModel(coverageSector, levelZeroDelta, numLevels, retrievalImageFormat, cachePath, tileWidth, tileHeight)

Constructs an elevation model.
Parameters:
Name Type Description
coverageSector Sector The sector this elevation model spans.
levelZeroDelta Location The size of top-level tiles, in degrees.
numLevels Number The number of levels used to represent this elevation model's resolution pyramid.
retrievalImageFormat String The mime type of the elevation data retrieved by this elevation model.
cachePath String A string unique to this elevation model relative to other elevation models used by the application.
tileWidth Number The number of intervals (cells) in the longitudinal direction of this elevation model's elevation tiles.
tileHeight Number The number of intervals (cells) in the latitudinal direction of this elevation model's elevation tiles.
Source:
Throws:
If any argument is null or undefined, if the number of levels specified is less than one, or if either the tile width or tile height are less than one.
Type
ArgumentError

Members

(readonly) cachePath :String

A unique string identifying this elevation model relative to other elevation models in use.
Type:
  • String
Source:

(readonly) coverageSector :Sector

The sector this elevation model spans.
Type:
Source:

displayName :String

Indicates this elevation model's display name.
Type:
  • String
Default Value:
  • "Elevations"
Source:

(readonly) levels :LevelSet

The LevelSet created during construction of this elevation model.
Type:
  • LevelSet
Source:

maxElevation :Number

This elevation model's maximum elevation in meters.
Type:
  • Number
Source:

minElevation :Number

This elevation model's minimum elevation in meters.
Type:
  • Number
Default Value:
  • 0
Source:

pixelIsPoint :Boolean

Indicates whether the data associated with this elevation model is point data. A value of false indicates that the data is area data (pixel is area).
Type:
  • Boolean
Default Value:
  • true
Source:

(readonly) retrievalImageFormat :String

The mime type to use when retrieving elevations.
Type:
  • String
Source:

(readonly) timestamp :Number

Indicates the last time this elevation model changed, in milliseconds since midnight Jan 1, 1970.
Type:
  • Number
Default Value:
  • Date.now() at construction
Source:

Methods

elevationAtLocation(latitude, longitude) → {Number}

Returns the elevation at a specified location.
Parameters:
Name Type Description
latitude Number The location's latitude in degrees.
longitude Number The location's longitude in degrees.
Source:
Returns:
The elevation at the specified location, in meters. Returns zero if the location is outside the coverage area of this elevation model.
Type
Number

elevationsForGrid(sector, numLat, numLon, targetResolution, result) → {Number}

Returns the elevations at locations within a specified sector.
Parameters:
Name Type Description
sector Sector The sector for which to determine the elevations.
numLat Number The number of latitudinal sample locations within the sector.
numLon Number The number of longitudinal sample locations within the sector.
targetResolution Number The desired elevation resolution, in radians. (To compute radians from meters, divide the number of meters by the globe's radius.)
result Array.<Number> An array in which to return the requested elevations.
Source:
Throws:
If the specified sector or result array is null or undefined, or if either of the specified numLat or numLon values is less than one.
Type
ArgumentError
Returns:
The resolution actually achieved, which may be greater than that requested if the elevation data for the requested resolution is not currently available.
Type
Number

minAndMaxElevationsForSector(sector) → {Array.<Number>}

Returns the minimum and maximum elevations within a specified sector.
Parameters:
Name Type Description
sector Sector The sector for which to determine extreme elevations.
Source:
Throws:
If the specified sector is null or undefined.
Type
ArgumentError
Returns:
An array containing the minimum and maximum elevations within the specified sector, or null if the specified sector is outside this elevation model's coverage area.
Type
Array.<Number>