# Module: ol/source/GeoTIFF

This documentation is for OpenLayers v10.9.0. The latest is v.

## ol/source/GeoTIFF

### Classes

GeoTIFFSource

### Type Definitions

#### GDALMetadata{Object}

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `STATISTICS_MINIMUM` | string | The minimum value (as a string).
  `STATISTICS_MAXIMUM` | string | The maximum value (as a string).

#### GeoKeys{Object}

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `GTModelTypeGeoKey` | number | Model type.
  `GTRasterTypeGeoKey` | number | Raster type.
  `GeogAngularUnitsGeoKey` | number | Angular units.
  `GeogInvFlatteningGeoKey` | number | Inverse flattening.
  `GeogSemiMajorAxisGeoKey` | number | Semi-major axis.
  `GeographicTypeGeoKey` | number | Geographic coordinate system code.
  `ProjLinearUnitsGeoKey` | number | Projected linear unit code.
  `ProjectedCSTypeGeoKey` | number | Projected coordinate system code.

#### GeoTIFFSourceOptions{Object}

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `forceXHR` | boolean (defaults to false) | Whether to force the usage of the browsers XMLHttpRequest API.
  `headers` | Object.<string, string> | undefined | additional key-value pairs of headers to be passed with each request. Key is the header name, value the header value.
  `credentials` | string | undefined | How credentials shall be handled. See https://developer.mozilla.org/en-US/docs/Web/API/fetch for reference and possible values
  `maxRanges` | number | undefined | The maximum amount of ranges to request in a single multi-range request. By default only a single range is used.
  `allowFullFile` | boolean (defaults to false) | Whether or not a full file is accepted when only a portion is requested. Only use this when you know the source image to be small enough to fit in memory.
  `blockSize` | number (defaults to 65536) | The block size to use.
  `cacheSize` | number (defaults to 100) | The number of blocks that shall be held in a LRU cache.

#### Options{Object}

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `attributions` | AttributionLike | undefined | Attributions.
  `sources` | Array<SourceInfo> | List of information about GeoTIFF sources. Multiple sources can be combined when their resolution sets are equal after applying a scale. The list of sources defines a mapping between input bands as they are read from each GeoTIFF and the output bands that are provided by data tiles. To control which bands to read from each GeoTIFF, use the `bands` property. If, for example, you specify two sources, one with 3 bands and `nodata` configured, and another with 1 band, the resulting data tiles will have 5 bands: 3 from the first source, 1 alpha band from the first source, and 1 band from the second source.
  `sourceOptions` | GeoTIFFSourceOptions | undefined | Additional options to be passed to geotiff.js's `fromUrl` or `fromUrls` methods.
  `convertToRGB` | true | false | 'auto' (defaults to false) | By default, bands from the sources are read as-is. When reading GeoTIFFs with the purpose of displaying them as RGB images, setting this to `true` will convert other color spaces (YCbCr, CMYK) to RGB. Setting the option to `'auto'` will make it so CMYK, YCbCr, CIELab, and ICCLab images will automatically be converted to RGB.
  `normalize` | boolean (defaults to true) | By default, the source data is normalized to values between 0 and 1 with scaling factors based on the raster statistics or `min` and `max` properties of each source. If instead you want to work with the raw values in a style expression, set this to `false`. Setting this option to `false` will make it so any `min` and `max` properties on sources are ignored.
  `projection` | ProjectionLike | undefined | Source projection. If not provided, the GeoTIFF metadata will be read for projection information.
  `loadMissingProjection` | boolean (defaults to false) | Whether to attempt to load missing projection definitions. Uses the pre-configured projection lookup function, which can be customized with `setProjectionCodeLookup`.
  `transition` | number (defaults to 250) | Duration of the opacity transition for rendering. To disable the opacity transition, pass `transition: 0`.
  `wrapX` | boolean (defaults to false) | Render tiles beyond the tile grid extent.
  `interpolate` | boolean (defaults to true) | Use interpolated values when resampling. By default, the linear interpolation is used to resample the data. If false, nearest neighbor is used.

#### SourceInfo{Object}

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `url` | string | undefined | URL for the source GeoTIFF.
  `loader` | function | undefined | Custom loader function for URL based sources. Called with the URL, request headers, and an abort signal. Expected to resolve with a `Response`.
  `overviews` | Array.<string> | undefined | List of any overview URLs, only applies if the url parameter is given and no loader is specified.
  `blob` | Blob | undefined | Blob containing the source GeoTIFF. `blob` and `url` are mutually exclusive.
  `min` | number | Array.<(number|undefined)> (defaults to 0) | The minimum source data value. Rendered values are scaled from 0 to 1 based on the configured min and max. If not provided and raster statistics are available, those will be used instead. If neither are available, the minimum for the data type will be used. To disable this behavior, set the `normalize` option to `false` in the constructor. If an array is provided, values correspond to the bands in the file (not the `bands` option). Array values can be left `undefined` to trigger the default behavior.
  `max` | number | Array.<(number|undefined)> | undefined | The maximum source data value. Rendered values are scaled from 0 to 1 based on the configured min and max. If not provided and raster statistics are available, those will be used instead. If neither are available, the maximum for the data type will be used. To disable this behavior, set the `normalize` option to `false` in the constructor. If an array is provided, values correspond to the bands in the file (not the `bands` option). Array values can be left `undefined` to to trigger the default behavior.
  `nodata` | number | Array.<(number|undefined)> | undefined | Values to discard (overriding any nodata values in the metadata). When provided, an additional alpha band will be added to the data. Often the GeoTIFF metadata will include information about nodata values, so you should only need to set this property if you find that it is not already extracted from the metadata. If an array is provided, values correspond to the bands in the file (not the `bands` option). Array values can be left `undefined` to trigger the default behavior.
  `bands` | Array.<number> | undefined | Band numbers to be read from (where the first band is `1`). If not provided, all bands will be read. For example, if a GeoTIFF has blue (1), green (2), red (3), and near-infrared (4) bands, and you only need the near-infrared band, configure `bands: [4]`.