Constructor
new ElevationImage(sector, imageWidth, imageHeight)
Constructs an elevation image.
Parameters:
Name | Type | Description |
---|---|---|
sector |
Sector | The sector spanned by this elevation image. |
imageWidth |
Number | The number of longitudinal sample points in this elevation image. |
imageHeight |
Number | The number of latitudinal sample points in this elevation image. |
- Source:
Throws:
-
If the sector is null or undefined
- Type
- ArgumentError
Members
(readonly) imageHeight :Number
The number of latitudinal sample points in this elevation image.
Type:
- Number
- Source:
(readonly) imageWidth :Number
The number of longitudinal sample points in this elevation image.
Type:
- Number
- Source:
(readonly) sector :Sector
The sector spanned by this elevation image.
Type:
- Source:
(readonly) size :number
The size in bytes of this elevation image.
Type:
- number
- Source:
Methods
elevationAtLocation(latitude, longitude) → {Number}
Returns the elevation at a specified geographic location.
Parameters:
Name | Type | Description |
---|---|---|
latitude |
Number | The location's latitude. |
longitude |
Number | The location's longitude. |
- Source:
Returns:
The elevation at the specified location.
- Type
- Number
elevationsForGrid(sector, numLat, numLon, result)
Returns elevations for a specified sector.
Parameters:
Name | Type | Description |
---|---|---|
sector |
Sector | The sector for which to return the elevations. |
numLat |
Number | The number of sample points in the longitudinal direction. |
numLon |
Number | The number of sample points in the latitudinal direction. |
result |
Array.<Number> | An array in which to return the computed elevations. |
- Source:
Throws:
-
If either the specified sector or result argument is null or undefined, or if the specified number of sample points in either direction is less than 1.
- Type
- ArgumentError
findMinAndMaxElevation()
Determines the minimum and maximum elevations within this elevation image and stores those values within
this object. See minAndMaxElevationsForSector
- Source:
minAndMaxElevationsForSector(sector) → {Array.<Number>}
Returns the minimum and maximum elevations within a specified sector.
Parameters:
Name | Type | Description |
---|---|---|
sector |
Sector | The sector of interest. If null or undefined, the minimum and maximum elevations for the sector associated with this tile are returned. |
- Source:
Returns:
An array containing the minimum and maximum elevations within the specified sector,
or null if the specified sector does not include this elevation image's coverage sector or the image is filled with
NO_DATA values.
- Type
- Array.<Number>
pixel(x, y) → {Number}
Returns the pixel value at a specified coordinate in this elevation image. The coordinate origin is the
image's lower left corner, so (0, 0) indicates the lower left pixel and (imageWidth-1, imageHeight-1)
indicates the upper right pixel. This returns 0 if the coordinate indicates a pixel outside of this elevation
image.
Parameters:
Name | Type | Description |
---|---|---|
x |
The pixel's X coordinate. | |
y |
The pixel's Y coordinate. |
- Source:
Returns:
The pixel value at the specified coordinate in this elevation image.
Returns 0 if the coordinate indicates a pixel outside of this elevation image.
- Type
- Number