StaticfromConstructs new MartiniTerrainProvider with preconstructed CogResources
An array of CogResources.
The type is a little confusing on TypeDoc; It's an array of constructed CogResources
or Promises to them, which can be put inside Promise.all if desired
Since the resources are constructed individually,
outside of the provider, these options are not shared with the resources.
However, each resource.tileSize must match for the Martini algorithm to work.
Promise of new MariniTerrainProvider with resources
If for any reason you'd like to pre-construct the CogResource(s), you can use this
constructor to then create the MartiniTerrainProvider from those resources.
import { CogResource, MartiniTerrainProvider } from '@landrush/martini-terrain-provider'
const tileSize = 257 // must be shared amonst Provider & all resources
const resources = [
'https://server/cog-0-0.tif',
'https://server/cog-0-1.tif',
'https://server/cog-1-0.tif',
'https://server/cog-1-1.tif'
].map(url => CogResource.fromSource(url, { ...resourceOptions, tileSize }))
const terrainProvider = MartiniTerrainProvider.fromResources(resources, { ...providerOptions, tileSize })
StaticfromConstructs new MartiniTerrainProvider with CogResources created
from the GeoTIFF sources. The sources can be URLs, but also allows
local/prefetched COG resources, such as from a File or ArrayBuffer
GeoTIFF object (from geotiff.js) or a compatible source
Customizable MartiniTerrainProvider settings.
tileSize & ellipsoid are also passed to the newly created CogResources
Promise of new MariniTerrainProvider with resources created
from the given sources
If you have Cloud-Optimized GeoTIFF data (either a URL or prefetched, like a File or ArrayBuffer),
you can pass it directly to this constructor and have the Provider create the necessary CogResource(s)
import { MartiniTerrainProvider } from '@landrush/martini-terrain-provider'
const terrainProvider = new MartiniTerrainProvider.fromSources([
'https://server/cog-0-0.tif',
'https://server/cog-0-1.tif'
], { ...options })
ReadonlyavailabilityGets an object that can be used to determine availability of terrain from this provider, such as at points and in rectangles. This property may be undefined if availability information is not available.
ReadonlycreditGets the credit to display when this terrain provider is active. Typically this is used to credit the source of the terrain.
ReadonlyerrorGets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing to the event, you will be notified of the error and can potentially recover from it. Event listeners are passed an instance of TileProviderError.
ReadonlyhasGets a value indicating whether or not the requested tiles include vertex normals.
ReadonlyhasGets a value indicating whether or not the provider includes a water mask. The water mask indicates which areas of the globe are water rather than land, so they can be rendered as a reflective surface with animated waves.
Tile size for MARTINI algorithm. Also resamples all GeoTIFFImage.readRasters() results in CogResource to this.tileSize
ReadonlytilingGets the tiling scheme used by the provider.
Checks a tile (from x, y, z coordinates) for resources existing within
the tile bounds, otherwise calls this._backupTerrainProvider.getTileDataAvailable(x,y,z)
X coordinate for tile requesting geometry
Y coordinate for tile requesting geometry
Level of tile requesting geometry
boolean indicating availability, or undefined if loading
— The X coordinate of the tile for which to request geometry.
The Y coordinate of the tile for which to request geometry.
The level of the tile for which to request geometry.
Undefined if nothing need to be loaded (if no backupTerrainProvider),
or a Promise that resolves when all required tiles are loaded
Requests the geometry for a given tile.
X coordinate for tile requesting geometry
Y coordinate for tile requesting geometry
Level of tile requesting geometry
Optionalreq: RequestRequest object. Intended for internal use only
Promise for requested geometry, or undefined (indicating too many pending requests)
The class meant for use within the CesiumJS digital globe. Manages Resources and transforming their raster DEMs into
QuantizedMeshTerrainDatafor rendering, utilizing the MARTINI algorithm.See
Cesium.TerrainProvider