Skip to main content

Class: Overview

Defined in: packages/geotiff/src/overview.ts:24

A single resolution level of a GeoTIFF — either the full-resolution image or a reduced-resolution overview. Pairs the data IFD with its corresponding mask IFD (if any).

Constructors​

Constructor​

new Overview(geotiff, gkd, image, maskImage, cachedPrimaryImageTags, cachedSubImageTags, cachedMaskImageTags, dataSource): Overview

Defined in: packages/geotiff/src/overview.ts:52

Parameters​

geotiff​

GeoTIFF

gkd​

GeoKeyDirectory

image​

TiffImage

maskImage​

TiffImage | null

cachedPrimaryImageTags​

CachedPrimaryImageTags

cachedSubImageTags​

CachedSubImageTags

cachedMaskImageTags​

CachedSubImageTags | null

dataSource​

Pick<Source, "fetch">

Returns​

Overview

Properties​

cachedMaskImageTags​

readonly cachedMaskImageTags: CachedSubImageTags | null

Defined in: packages/geotiff/src/overview.ts:35

Cached TIFF tags of maskImage, or null if there's no mask.


cachedPrimaryImageTags​

readonly cachedPrimaryImageTags: CachedPrimaryImageTags

Defined in: packages/geotiff/src/overview.ts:29

Cached TIFF tags of the primary image, which apply to this overview too, except for its own cachedSubImageTags.


cachedSubImageTags​

readonly cachedSubImageTags: CachedSubImageTags

Defined in: packages/geotiff/src/overview.ts:32

Cached TIFF tags of this overview's image.


dataSource​

readonly dataSource: Pick<Source, "fetch">

Defined in: packages/geotiff/src/overview.ts:38

The data source used for fetching tile data.


geotiff​

readonly geotiff: GeoTIFF

Defined in: packages/geotiff/src/overview.ts:41

A reference to the parent GeoTIFF object.


gkd​

readonly gkd: GeoKeyDirectory

Defined in: packages/geotiff/src/overview.ts:44

The GeoKeyDirectory of the primary IFD.


image​

readonly image: TiffImage

Defined in: packages/geotiff/src/overview.ts:47

The data IFD for this resolution level.


maskImage​

readonly maskImage: TiffImage | null = null

Defined in: packages/geotiff/src/overview.ts:50

The IFD for the mask associated with this overview level, if any.

Accessors​

_debug​

Get Signature​

get _debug(): boolean

Defined in: packages/geotiff/src/overview.ts:95

Inherits the GeoTIFF._debug flag from the parent.

Returns​

boolean


crs​

Get Signature​

get crs(): string | number | ProjJson

Defined in: packages/geotiff/src/overview.ts:80

Coordinate reference system information.

  • If crs is a number, it is an EPSG code.
  • If crs is an object, it is a PROJJSON object.
  • If crs is a string, it is an ESRI WKT (this is rare).

The result is cached after the first access.

Returns​

string | number | ProjJson


height​

Get Signature​

get height(): number

Defined in: packages/geotiff/src/overview.ts:85

Image height in pixels.

Returns​

number


nodata​

Get Signature​

get nodata(): number | null

Defined in: packages/geotiff/src/overview.ts:90

The no data value, or null if not set.

Returns​

number | null


tileCount​

Get Signature​

get tileCount(): TiffImageTileCount

Defined in: packages/geotiff/src/overview.ts:100

The number of tiles in the x and y directions

Returns​

TiffImageTileCount


tileHeight​

Get Signature​

get tileHeight(): number

Defined in: packages/geotiff/src/overview.ts:105

Tile height in pixels.

Returns​

number


tileWidth​

Get Signature​

get tileWidth(): number

Defined in: packages/geotiff/src/overview.ts:110

Tile width in pixels.

Returns​

number


transform​

Get Signature​

get transform(): Affine

Defined in: packages/geotiff/src/overview.ts:117

Return the dataset's georeferencing transformation matrix.

Returns​

Affine


width​

Get Signature​

get width(): number

Defined in: packages/geotiff/src/overview.ts:125

Image width in pixels.

Returns​

number

Methods​

fetchTile()​

fetchTile(x, y, options?): Promise<Tile>

Defined in: packages/geotiff/src/overview.ts:138

Fetch a single tile from this overview.

Parameters​

x​

number

The tile column index (0-based).

y​

number

The tile row index (0-based).

options?​

Optional parameters for fetching the tile.

boundless?​

boolean

Whether to clip tiles that are partially outside the image bounds. When true, no clipping is applied and edge tiles are returned at the full nominal tile size. Defaults to true.

pool?​

DecoderPool

An optional DecoderPool for decoding the tile data off the main thread, such as the one defaultDecoderPool returns. If not provided, the tile is decoded on the main thread.

signal?​

AbortSignal

An optional AbortSignal to cancel the fetch request.

Returns​

Promise<Tile>


fetchTiles()​

fetchTiles(xy, options?): Promise<Tile[]>

Defined in: packages/geotiff/src/overview.ts:166

Fetch multiple tiles in parallel.

A future implementation may coalesce contiguous byte ranges to reduce the number of HTTP requests.

Parameters​

xy​

[number, number][]

Array of [x, y] tile coordinates.

options?​

Optional parameters (same as fetchTile).

boundless?​

boolean

pool?​

DecoderPool

signal?​

AbortSignal

Returns​

Promise<Tile[]>

Array of Tile objects in the same order as xy.

See​

fetchTile for single-tile fetching.


index()​

index(x, y, op?): [number, number]

Defined in: packages/geotiff/src/overview.ts:213

Get the (row, col) pixel index containing the geographic coordinate (x, y).

Parameters​

x​

number

x coordinate in the CRS.

y​

number

y coordinate in the CRS.

op?​

(n) => number

Rounding function applied to fractional pixel indices. Defaults to Math.floor.

Returns​

[number, number]

[row, col] pixel indices.


read()​

read(options?): Promise<RasterArray>

Defined in: packages/geotiff/src/overview.ts:194

Read the pixels of a window of this overview.

Fetches every tile that the window touches, stitches them together, and keeps only the pixels inside the window.

Parameters​

options?​

Optional parameters for reading.

pool?​

DecoderPool

An optional DecoderPool for decoding the tiles off the main thread, such as the one defaultDecoderPool returns. If not provided, the tiles are decoded on the main thread.

signal?​

AbortSignal

An optional AbortSignal to cancel the fetch requests.

window?​

Window

The Window of pixels to read, in this overview's pixels. Defaults to the whole overview.

Returns​

Promise<RasterArray>

A RasterArray of the window's pixels, with a mask if the overview has a mask IFD.

Throws​

A WindowError if the window is invalid or extends outside the overview.


xy()​

xy(row, col, offset?): [number, number]

Defined in: packages/geotiff/src/overview.ts:229

Get the geographic (x, y) coordinate of the pixel at (row, col).

Parameters​

row​

number

Pixel row.

col​

number

Pixel column.

offset?​

"center" | "ul" | "ur" | "ll" | "lr" = "center"

Which part of the pixel to return. Defaults to "center".

Returns​

[number, number]

[x, y] in the CRS.