UNPKG

s2-tools

Version:

A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.

63 lines 2.42 kB
import { GeoTIFFHeaderReader } from './header'; import { GeoTIFFImage } from './image'; import type { GeoTIFFMetadata } from './image'; import type { ProjectionTransformDefinition } from '../../proj4'; import type { FeatureIterator, RGBA, Reader, ReaderInputs } from '..'; import type { Properties, VectorFeature, VectorMultiPointGeometry } from '../../geometry'; export * from './color'; export * from './constants'; export * from './decoder'; export * from './header'; export * from './image'; export * from './imageUtil'; export * from './predictor'; /** A grid reader object */ export interface GridReader { key: string; reader: Reader; } /** * # GeoTIFF Reader * * ## Description * This class reads a GeoTIFF file and returns a list of GeoTIFF images. * Implements the {@link FeatureIterator} interface. * * ## Usage * ```ts * import { ALL_DEFINITIONS, EPSG_CODES, GeoTIFFReader } from 's2-tools'; * import { FileReader } from 's2-tools/file'; * * const fileReader = new FileReader(`${__dirname}/fixtures/utm.tif`); * const geotiffReader = new GeoTIFFReader(fileReader, ALL_DEFINITIONS, EPSG_CODES); * ``` */ export declare class GeoTIFFReader extends GeoTIFFHeaderReader implements FeatureIterator<GeoTIFFMetadata> { private definitions; private epsgCodes; gridStore: GridReader[]; /** * @param input - the geotiff input to parse data from * @param definitions - an array of projection definitions for the transformer if needed * @param epsgCodes - a record of EPSG codes to use for the transformer if needed */ constructor(input: ReaderInputs, definitions?: ProjectionTransformDefinition[], epsgCodes?: Record<string, string>); /** * Add a grid reader * @param key - the key or name of the grid * @param input - the input data to parse */ addGridReader(key: string, input: ReaderInputs): void; /** * Get the n-th internal subfile of an image. By default, the first is returned. * @param index - the index of the image to get [Default=0] * @returns - the image at the given index */ getImage(index?: number): GeoTIFFImage; /** * Iterate through each image and return a vector feature * @yields {VectorFeature} */ [Symbol.asyncIterator](): AsyncGenerator<VectorFeature<GeoTIFFMetadata, RGBA, Properties, VectorMultiPointGeometry>>; } //# sourceMappingURL=index.d.ts.map