Skip to main content

GeoTIFF loader

GeoTIFFLoader

GeoTIFFLoader is the entry point for TIFF imagery whose tags describe scale, bounds, and coordinate reference. Use the source APIs when a cloud query needs selective ranges or windows.

Loader or source?

Load a complete image, or query a remote raster.

The loader is the simple complete-file path. GeoTIFFLoader adds metadata discovery, range reads, windows, overview selection, and cancellation for cloud-native access.

Loader

Complete TIFF image and metadata

Source

Bounded windows and HTTP ranges

Output

Typed image data with dimensions

Metadata

Tags, transform, bounds, and CRS

From-v1.0Status: Work-In-Progress

Detailed guide

GeoTIFF loader details

The reference below covers complete-file loading, the returned raster shape, metadata, and the boundary between GeoTIFFLoader and GeoTIFFLoader.

GeoTIFFLoader parses a complete GeoTIFF from an ArrayBuffer and reads the first image in the file. It is the straightforward path for local files or applications that already have the complete file in memory. For remote windows, overviews, or band-selective reads, use GeoTIFFLoader.

PropertyValue
Data sourceGeoTIFFRasterSource

Usage​

import {load} from '@loaders.gl/core';
import {GeoTIFFLoader} from '@loaders.gl/raster/geotiff';

const image = await load('example.tif', GeoTIFFLoader);

console.log(image.width, image.height);
console.log(image.bounds, image.crs);

Returned data​

The loader returns an object containing:

FieldDescription
dataAn RGBA or RGB Uint8ClampedArray containing decoded pixel values.
width, heightDimensions of the first image in pixels.
boundsThe image bounding box from GeoTIFF georeferencing metadata.
crsThe projected EPSG identifier when it is present in the GeoKeys.
metadataThe raw GeoTIFF GeoKeys returned by the parser.

Options​

OptionTypeDefaultDescription
geotiff.enableAlphabooleantrueInclude an alpha channel when the source image supports it.

GeoTIFFLoader currently reads only the first image and uses readRGB(). It does not provide windowed reads, overview selection, or reprojection. Those operations belong to the source API.

For original numeric samples, nodata, and per-band scale/offset metadata, use GeoTIFFRasterLoader.