GeoTiffTerrain

Extends: ProceduralTerrain

Source: GeoTiffTerrain.ts:41

Terrain with the heights of a GeoTIFF or COG elevation band.


Constructor

new GeoTiffTerrain( name?: string, options: IGeoTiffTerrainParams, ): GeoTiffTerrain

Parameters

  • name (string, optional, default: "\"GeoTiffTerrain\"") — Terrain provider name.
  • options (IGeoTiffTerrainParams) — Provider options:
    • options.src (string | Blob | File | ArrayBuffer, optional) — GeoTIFF url or binary.
    • options.sources (Array.<IGeoTIFFSourceItem>, optional) — GeoTIFF sources of one mosaic instead of src. Where they overlap the heights of the first one are taken, so the more detailed ones go first.
    • options.sampleSize (number, optional, default: 256) — Pixels by the segment side read from the GeoTIFF, power of two, not less than plainGridSize. The GeoTIFF overview is taken by them.
    • options.band (number, optional, default: 1) — Elevation band.
    • options.attribution (string, optional, default: "\"\"") — Elevation source attribution shown in the attribution area.
    • options.plainGridSize (number, optional, default: 128) — Elevation grid size.
    • options.maxZoom (number, optional, default: 21) — Last zoom of the segment heights, the last zoom of the default grid sizes.
    • options.maxNativeZoom (number, optional) — Last zoom of the GeoTIFF reads, by default, the first zoom which sampleSize pixels are not larger than the GeoTIFF ones, of the most detailed source in a mosaic. The tile size is the one of the planet quad tree strategy. Deeper segments are its subdivision levels.
    • options.geoidSrc (string, optional, default: "\"https://openglobus.org/geoid/egm84-30.pgm\"") — Geoid of the heights.
    • options.noDataValues (Array.<number>, optional, default: "[-10000]") — Heights of no data, GeoTIFF nodata pixels become the first one.
    • options.nodata (number | null, optional) — GeoTIFF nodata value, from the GeoTIFF by default.
    • options.crs (number | string, optional) — GeoTIFF CRS code, when the GeoTIFF has another one or none.

Instance Methods

flyExtent()

Overrides: ProceduralTerrain#flyExtent

Flies over the highest point of the GeoTIFF: the heights of the extent center may be not loaded or no data.

getHeightAsync()

Inherited from ProceduralTerrain#getHeightAsync

Overrides: ProceduralTerrain#getHeightAsync

Returns the height under the point from the zoom tile heights, they are made for the request if there are none. Calls back right away and returns true when the heights are ready.

_getSegmentHeights()

Inherited from ProceduralTerrain#_getSegmentHeights

Overrides: ProceduralTerrain#_getSegmentHeights

Returns the segment heights, or the promise of them while they are made. Every tile heights are requested once, failed requests are made again next time.

_getLevelHeights()

Inherited from ProceduralTerrain#_getLevelHeights

Overrides: ProceduralTerrain#_getLevelHeights

Returns the subdivision level heights of the maxNativeZoom segment, made of its pixels when they are needed. Levels end at the vertex grid, deeper segments have no heights and take the terrain of the level above.

_getNativeSegment()

Inherited from ProceduralTerrain#_getNativeSegment

Overrides: ProceduralTerrain#_getNativeSegment

Returns the maxNativeZoom segment of the deeper segment, out of the quad tree for the height requests.

_toGridHeights()

Inherited from ProceduralTerrain#_toGridHeights

Overrides: ProceduralTerrain#_toGridHeights

Returns the grid heights of the segment, or the promise of them the worker makes. The maxNativeZoom segment with subdivision levels keeps its pixels to make them.

setUrlRewriteCallback(ur: UrlRewriteFunc)

Inherited from EmptyTerrain#setUrlRewriteCallback

Overrides: ProceduralTerrain#setUrlRewriteCallback

Sets url rewrite callback, used for custom url rewriting for every tile loading.

Parameters

  • ur (UrlRewriteFunc) — The callback that returns tile custom created url.

setAttribution(html: string)

Inherited from EmptyTerrain#setAttribution

Overrides: ProceduralTerrain#setAttribution

Sets terrain provider attribution text.

Parameters

  • html (string) — HTML string that represents terrain provider attribution.

getAttribution(): string

Inherited from EmptyTerrain#getAttribution

Overrides: ProceduralTerrain#getAttribution

Gets terrain provider attribution.

Returns

  • string — Terrain provider attribution.

handleSegmentTerrain(segment: Segment)

Inherited from EmptyTerrain#handleSegmentTerrain

Overrides: ProceduralTerrain#handleSegmentTerrain

Loads or creates segment elevation data.

Parameters

  • segment (Segment) — Segment to create elevation data.

getExtent(): Extent

Inherited from EmptyTerrain#getExtent

Overrides: ProceduralTerrain#getExtent

Returns the terrain extent, the whole globe by default.

Returns

getMaxHeight(): number

Inherited from EmptyTerrain#getMaxHeight

Overrides: ProceduralTerrain#getMaxHeight

Returns the highest terrain point over the ellipsoid with the terrain height factor, in meters.

Returns

  • number

getCacheInfo(): ITerrainCacheInfo | null

Inherited from EmptyTerrain#getCacheInfo

Overrides: ProceduralTerrain#getCacheInfo

Returns the cache state, null when the terrain has no cache.

Returns

  • ITerrainCacheInfo | null

Instance Fields

iconSrc

Inherited from EmptyTerrain#iconSrc

Overrides: ProceduralTerrain#iconSrc

Gets terrain provider icon.

Returns

  • string | null — Icon source.