Drivers Creation

Driver built-in by default

This driver is built-in by default

Drivers Creation

Download Media Creation Tool - Create a setup package to deploy Windows 10 either from an ISO file you can burn to disc, or through a bootable USB flash drive with this powerful app. Note: Drivers for Surface devices may be found on the Download drivers and firmware for Surface page. Using the installation media you created (click to show more or less information) Before you install Windows 10, it’s a good idea to save any work and back up your PC before you start.

Most forms of TIFF and GeoTIFF files are supported by GDAL for reading,and somewhat less varieties can be written.

GDAL also supports reading and writing BigTIFF files (evolution of the TIFF formatto support files larger than 4 GB).

Creation

Currently band types of Byte, UInt16, Int16, UInt32, Int32, Float32,Float64, CInt16, CInt32, CFloat32 and CFloat64 are supported for readingand writing. Paletted images will return palette information associatedwith the band. The compression formats listed below should be supportedfor reading as well.

As well, one bit files, and some other unusual formulations of GeoTIFFfile, such as YCbCr color model files, are automatically translated intoRGBA (red, green, blue, alpha) form, and treated as four eight bitbands.

Driver capabilities¶

Supports CreateCopy()

This driver supports the GDALDriver::CreateCopy() operation

Supports Create()

This driver supports the GDALDriver::Create() operation

Supports Georeferencing

This driver supports georeferencing

Supports VirtualIO

This driver supports virtual I/O operations (/vsimem/, etc.)

Georeferencing¶

Most GeoTIFF projections should be supported, with the caveat that inorder to translate uncommon Projected, and Geographic coordinate systemsinto OGC WKT it is necessary to have the PROJ proj.db databaseavailable. It must be found at the location pointed to by the PROJ_LIBenvironment variable, or at one of the locations set programmaticallyvia OSRSetPROJSearchPaths().

Georeferencing from GeoTIFF is supported in the form of one tiepoint andpixel size, a transformation matrix, or a list of GCPs.

If no georeferencing information is available in the TIFF file itself,GDAL will also check for, and use an ESRI worldfile with the extension .tfw, .tifw/.tiffw or.wld, as well as a MapInfo .tab file.

By default, information is fetched in following order (first listed isthe most prioritary): PAM (Persistent Auxiliary metadata) .aux.xmlsidecar file, INTERNAL (GeoTIFF keys and tags), TABFILE (.tab),WORLDFILE (.tfw, .tifw/.tiffw or .wld).

Starting with GDAL 2.2, the allowed sources and their priority order canbe changed with the GDAL_GEOREF_SOURCES configuration option (orGEOREF_SOURCES open option) whose value is a comma-separated list of thefollowing keywords : PAM, INTERNAL, TABFILE, WORLDFILE, NONE. Firstmentioned sources are the most prioritary over the next ones. A nonmentioned source will be ignored.

For example setting it to “WORLDFILE,PAM,INTERNAL” will make ageotransformation matrix from a potential worldfile prioritary over PAMor GeoTIFF.

GDAL can read and write the RPCCoefficientTag as described in theRPCs in GeoTIFF proposedextension. The tag is written only for files created with the defaultprofile GDALGeoTIFF. For other profiles, a .RPB file is created. In GDALdata model, the RPC coefficients are stored into the RPC metadatadomain. For more details, see the RFC 22: RPC Georeferencing. If .RPB or _RPC.TXTfiles are found, they will be used to read the RPCs, even if theRPCCoefficientTag tag is set.

Internal nodata masks¶

Drivers of value creation

TIFF files can contain internal transparency masks. The GeoTIFF driverrecognizes an internal directory as being a transparency mask when theFILETYPE_MASK bit value is set on the TIFFTAG_SUBFILETYPE tag. Accordingto the TIFF specification, such internal transparency masks contain 1sample of 1-bit data. Although the TIFF specification allows for higherresolutions for the internal transparency mask, the GeoTIFF driver onlysupports internal transparency masks of the same dimensions as the mainimage. Transparency masks of internal overviews are also supported.

When the GDAL_TIFF_INTERNAL_MASK configuration option is set to YES andthe GeoTIFF file is opened in update mode, the CreateMaskBand() methodon a TIFF dataset or rasterband will create an internal transparencymask. Otherwise, the default behavior of nodata mask creation will beused, that is to say the creation of a .msk file, as per RFC 15: Band Masks.

1-bit internal mask band are deflate compressed. When reading them back,to make conversion between mask band and alpha band easier, mask bandsare exposed to the user as being promoted to full 8 bits (i.e. the valuefor unmasked pixels is 255) unless the GDAL_TIFF_INTERNAL_MASK_TO_8BITconfiguration option is set to NO. This does not affect the way the maskband is written (it is always 1-bit).

Overviews¶

The GeoTIFF driver supports reading, creation and update of internaloverviews. Internal overviews can be created on GeoTIFF files opened inupdate mode (with gdaladdo for instance). If the GeoTIFF file is openedas read only, the creation of overviews will be done in an external .ovrfile. Overview are only updated on request with the BuildOverviews()method.

The block size (tile width and height) used for overviews (internal orexternal) can be specified by setting the GDAL_TIFF_OVR_BLOCKSIZEenvironment variable to a power-of-two value between 64 and 4096. Thedefault is 128, or starting with GDAL 3.1 to use the same block sizeas the full-resolution dataset if possible (i.e. block height and widthare equal, a power-of-two, and between 64 and 4096).

Overviews and nodata masks¶

The following configurations can be encountered depending if overviewsand nodata masks are internal or not.

There are two well supported configurations:

  • Internal overviews, internal nodata mask: If a GeoTIFF file has ainternal transparency mask (and the GDAL_TIFF_INTERNAL_MASKenvironment variable is not set to NO) and the GeoTIFF file is openedin update mode, BuildOverviews() will automatically create overviewsfor the internal transparency mask.

  • External overviews, external nodata mask: When opened in read-onlymode, BuildOverviews() will automatically create overviews for theexternal transparency mask (in a .msk.ovr file)

For the two other mixed configurations, behavior is less obvious:

  • Internal overviews, external nodata mask: when runningBuildOverviews() in update mode on the .tif file, only the overviewsof the main bands will be generated. Overviews of the external .mskfile must be explicitly generated by running BuildOverviews() on the.msk.

  • External overviews, internal nodata mask: when runningBuildOverviews() in read-only mode on the .tif file, only theoverviews of the main bands will be generated. Generating theoverviews of the internal nodata mask is not currently supported bythe driver.

Practical note: for a command line point of view, BuildOverview() inupdate mode means “gdaladdo the.tiff” (without -ro). WhereasBuildOverviews() in read-only mode means “gdaladdo -ro the.tiff”.

Metadata¶

GDAL can deal with the following baseline TIFF tags as dataset-levelmetadata :

  • TIFFTAG_DOCUMENTNAME

  • TIFFTAG_IMAGEDESCRIPTION

  • TIFFTAG_SOFTWARE

  • TIFFTAG_DATETIME

  • TIFFTAG_ARTIST

  • TIFFTAG_HOSTCOMPUTER

  • TIFFTAG_COPYRIGHT

  • TIFFTAG_XRESOLUTION

  • TIFFTAG_YRESOLUTION

  • TIFFTAG_RESOLUTIONUNIT

  • TIFFTAG_MINSAMPLEVALUE (read only)

  • TIFFTAG_MAXSAMPLEVALUE (read only)

  • GEO_METADATA:This tag may be used for embedding XML-encoded instance documentsprepared using 19139-based schema (GeoTIFF DGIWG) (GDAL >= 2.3)

  • TIFF_RSID:This tag specifies a File Universal Unique Identifier, or RSID,according to DMF definition (GeoTIFF DGIWG) (GDAL >= 2.3)

The name of the metadata item to use is one of the above names(“TIFFTAG_DOCUMENTNAME”, …). On creation, those tags can for examplebe set with

Other non standard metadata items can be stored in a TIFF file createdwith the profile GDALGeoTIFF (the default, see below in the Creationissues section). Those metadata items are grouped together into a XMLstring stored in the non standard TIFFTAG_GDAL_METADATA ASCII tag (code42112). When BASELINE or GeoTIFF profile are used, those non standardmetadata items are stored into a PAM .aux.xml file.

The value of GDALMD_AREA_OR_POINT (“AREA_OR_POINT”) metadata item isstored in the GeoTIFF key RasterPixelIsPoint for GDALGeoTIFF or GeoTIFFprofiles.

XMP metadata can be extracted from the file,and will be reported as XML raw content in the xml:XMP metadata domain.

EXIF metadata can be extracted from the file,and will be reported in the EXIF metadata domain.

Color Profile Metadata¶

GDAL can deal with the following color profilemetadata in the COLOR_PROFILE domain:

  • SOURCE_ICC_PROFILE (Base64 encoded ICC profile embedded in file. Ifavailable, other tags are ignored.)

  • SOURCE_PRIMARIES_RED (xyY in “x,y,1” format for red primary.)

  • SOURCE_PRIMARIES_GREEN (xyY in “x,y,1” format for green primary)

  • SOURCE_PRIMARIES_BLUE (xyY in “x,y,1” format for blue primary)

  • SOURCE_WHITEPOINT (xyY in “x,y,1” format for whitepoint)

  • TIFFTAG_TRANSFERFUNCTION_RED (Red table of TIFFTAG_TRANSFERFUNCTION)

  • TIFFTAG_TRANSFERFUNCTION_GREEN (Green table ofTIFFTAG_TRANSFERFUNCTION)

  • TIFFTAG_TRANSFERFUNCTION_BLUE (Blue table ofTIFFTAG_TRANSFERFUNCTION)

  • TIFFTAG_TRANSFERRANGE_BLACK (Min range of TIFFTAG_TRANSFERRANGE)

  • TIFFTAG_TRANSFERRANGE_WHITE (Max range of TIFFTAG_TRANSFERRANGE)

Note that these metadata properties can only be used on the original rawpixel data. If automatic conversion to RGB has been done, the colorprofile information cannot be used.

All these metadata tags can be overridden and/or used as creationoptions.

Nodata value¶

Drivers For Creation Pcut Ct630

GDAL stores band nodata value in the non standard TIFFTAG_GDAL_NODATAASCII tag (code 42113) for files created with the default profileGDALGeoTIFF. Note that all bands must use the same nodata value. WhenBASELINE or GeoTIFF profile are used, the nodata value is stored into aPAM .aux.xml file.

Sparse files¶

GDAL makes a special interpretation of a TIFF tile or strip whose offsetand byte count are set to 0, that is to say a tile or strip that has nocorresponding allocated physical storage. On reading, such tiles orstrips are considered to be implicitly set to 0 or to the nodata valuewhen it is defined. On writing, it is possible to enable generating suchfiles through the Create() interface by setting the SPARSE_OK creationoption to YES. Then, blocks that are never written through theIWriteBlock()/IRasterIO() interfaces will have their offset and bytecount set to 0. This is particularly useful to save disk space and timewhen the file must be initialized empty before being passed to a furtherprocessing stage that will fill it. To avoid ambiguities with anotersparse mechanism discussed in the next paragraphs, we will call suchfiles with implicit tiles/strips “TIFF sparse files”. They will belikely not interoperable with TIFF readers that are not GDAL basedand would consider such files with implicit tiles/strips as defective.

Starting with GDAL 2.2, this mechanism is extended to the CreateCopy()and Open() interfaces (for update mode) as well. If the SPARSE_OKcreation option (or the SPARSE_OK open option for Open()) is set to YES,even an attempt to write a all 0/nodata block will be detected so thatthe tile/strip is not allocated (if it was already allocated, then itscontent will be replaced by the 0/nodata content).

Starting with GDAL 2.2, in the case where SPARSE_OK is not defined(or set to its default value FALSE), for uncompressed files whose nodatavalue is not set, or set to 0, in Create() and CreateCopy() mode, thedriver will delay the allocation of 0-blocks until file closing, so asto be able to write them at the very end of the file, and in a waycompatible of the filesystem sparse file mechanisms (to be distinguishedfrom the TIFF sparse file extension discussed earlier). That is that allthe empty blocks will be seen as properly allocated from the TIFF pointof view (corresponding strips/tiles will have valid offsets and bytecounts), but will have no corresponding physical storage. Provided thatthe filesystem supports such sparse files, which is the case for mostLinux popular filesystems (ext2/3/4, xfs, btfs, …) or NTFS on Windows.If the file system does not support sparse files, physical storage willbe allocated and filled with zeros.

Raw mode¶

For some TIFF formulations that have “odd” photometric color spaces,on-the-fly decoding as RGBA is done. This might not be desirable in someuse cases. This behavior can be disabled by prefixing the filename withGTIFF_RAW:

For example to translate a CMYK file to another one :

Open options¶

  • NUM_THREADS=number_of_threads/ALL_CPUS: (From GDAL 2.1) Enablemulti-threaded compression by specifying the number of workerthreads. Worth it for slow compression algorithms such as DEFLATE orLZMA. Default is compression in the main thread.

  • GEOREF_SOURCES=string: (GDAL > 2.2) Define which georeferencingsources are allowed and their priority order. SeeGeoreferencing paragraph.

  • SPARSE_OK=TRUE/FALSE ((GDAL > 2.2): Should empty blocks beomitted on disk? When this option is set, any attempt of writing ablock whose all pixels are 0 or the nodata value will cause it not tobe written at all (unless there is a corresponding block alreadyallocated in the file). Sparse files have 0 tile/strip offsets forblocks never written and save space; however, most non-GDAL packagescannot read such files. The default is FALSE.

Creation Issues¶

GeoTIFF files can be created with any GDAL defined band type, includingthe complex types. Created files may have any number of bands. Files oftype Byte with exactly 3 bands will be given a photometricinterpretation of RGB, files of type Byte with exactly four bands willhave a photometric interpretation of RGBA, while all other combinationswill have a photometric interpretation of MIN_IS_BLACK. Starting withGDAL 2.2, non-standard (regarding to the intrinsics TIFF capabilities)band color interpretation, such as BGR ordering, will be handled increation and reading, by storing them in the GDAL internal metadata TIFFtag.

The TIFF format only supports R,G,B components for palettes / colortables. Thus on writing the alpha information will be silentlydiscarded.

You may want to read hints to generate and read cloud optimized GeoTIFFfiles

Creation Options¶

  • TFW=YES: Force the generation of an associated ESRI world file(.tfw).See the World Files page for details.

  • RPB=YES: Force the generation of an associated .RPB file todescribe RPC (Rational Polynomial Coefficients), if RPC informationis available. If not specified, this file is automatically generatedif there’s RPC information and that the PROFILE is not the defaultGDALGeoTIFF.

  • RPCTXT=YES: Force the generation of an associated_RPC.TXT file to describe RPC (Rational Polynomial Coefficients), ifRPC information is available.

  • INTERLEAVE=[BAND,PIXEL]: By default TIFF files with pixelinterleaving (PLANARCONFIG_CONTIG in TIFF terminology) are created.These are slightly less efficient than BAND interleaving for somepurposes, but some applications only support pixel interleaved TIFFfiles.

  • TILED=YES: By default striped TIFF files are created. Thisoption can be used to force creation of tiled TIFF files.

  • BLOCKXSIZE=n: Sets tile width, defaults to 256.

  • BLOCKYSIZE=n: Set tile or strip height. Tile height defaults to256, strip height defaults to a value such that one strip is 8K orless.

  • NBITS=n: Create a file with less than 8 bits per sample bypassing a value from 1 to 7. The apparent pixel type should be Byte.Values of n=9…15 (UInt16 type) and n=17…31(UInt32 type) are also accepted. From GDAL 2.2, n=16 is accepted forFloat32 type to generate half-precision floating point values.

  • COMPRESS=[JPEG/LZW/PACKBITS/DEFLATE/CCITTRLE/CCITTFAX3/CCITTFAX4/LZMA/ZSTD/LERC/LERC_DEFLATE/LERC_ZSTD/WEBP/NONE]:Set the compression to use.

    • JPEG should generally only be used withByte data (8 bit per channel). But if GDAL is built with internal libtiff andlibjpeg, it is possible to read and write TIFF files with 12bit JPEG compressed TIFFfiles (seen as UInt16 bands with NBITS=12). See the “8 and 12 bitJPEG in TIFF” wikipage for more details.Better compression for RGB images can be obtained by using the PHOTOMETRIC=YCBCRcolorspace with a 4:2:2 subsampling of the Y,Cb,Cr components.

    • CCITTFAX3, CCITTFAX4 or CCITRLE compression should only be used with 1bit (NBITS=1) data

    • LZW, DEFLATE and ZSTD compressions can be used with the PREDICTOR creation option.

    • ZSTD is available since GDAL 2.3 when using internal libtiff and if GDALbuilt against libzstd >=1.0, or if built against external libtiff with zstd support.

    • LERC and LERC_DEFLATE are available only when using internal libtiff.

    • LERC_ZSTD is available when LERC and ZSTD are available.

    • NONE is the default.

  • NUM_THREADS=number_of_threads/ALL_CPUS: (From GDAL 2.1) Enablemulti-threaded compression by specifying the number of workerthreads. Worth for slow compressions such as DEFLATE or LZMA. Will beignored for JPEG. Default is compression in the main thread.

  • PREDICTOR=[1/2/3]: Set the predictor for LZW, DEFLATE and ZSTDcompression. The default is 1 (no predictor), 2 is horizontaldifferencing and 3 is floating point prediction.

  • DISCARD_LSB=nbits or nbits_band1,nbits_band2,…nbits_bandN:Set the number of least-significant bits to clear,possibly different per band. Lossy compression scheme to be best usedwith PREDICTOR=2 and LZW/DEFLATE/ZSTD compression.

  • SPARSE_OK=TRUE/FALSE: Should newly createdfiles (through Create() interface) be allowed to be sparse? Sparsefiles have 0 tile/strip offsets for blocks never written and savespace; however, most non-GDAL packages cannot read such files.Starting with GDAL 2.2, SPARSE_OK=TRUE is also supported through theCreateCopy() interface. Starting with GDAL 2.2, even an attempt towrite a block whose all pixels are 0 or the nodata value will causeit not to be written at all (unless there is a corresponding blockalready allocated in the file). The default is FALSE.

  • JPEG_QUALITY=[1-100]: Set the JPEG quality when using JPEGcompression. A value of 100 is best quality (least compression), and1 is worst quality (best compression). The default is 75.

  • JPEGTABLESMODE=0/1/2/3: Configure how and whereJPEG quantization and Huffman tables are written in the TIFFJpegTables tag and strip/tile. Default to 1.

    • 0: JpegTables is not written. Each strip/tile contains its ownquantization tables and use optimized Huffman coding.

    • 1: JpegTables is written with only the quantization tables. Eachstrip/tile refers to those quantized tables and use optimizedHuffman coding. This is generally the optimal choice for smallestfile size, and consequently is the default.

    • 2: JpegTables is written with only the default Huffman tables.Each strip/tile refers to those Huffman tables (thus no optimizedHuffman coding) and contains its own quantization tables(identical). This option has no anticipated practical value.

    • 3: JpegTables is written with the quantization and default Huffmantables. Each strip/tile refers to those tables (thus no optimizedHuffman coding). This option could perhaps with some data be moreefficient than 1, but this should only occur in rarecircumstances.

  • ZLEVEL=[1-9] or [1-12]: Set the level of compression when using DEFLATEcompression (or LERC_DEFLATE). A value of 9 (resp. 12) is best/slowest whenusing zlib (resp. libdeflate), and 1 is least/fastest compression. The default is 6.

  • ZSTD_LEVEL=[1-22]: Set the level of compression when using ZSTDcompression (or LERC_ZSTD). A value of 22 is best (very slow), and 1is least compression. The default is 9.

  • MAX_Z_ERROR=threshold: Set the maximum error threshold on valuesfor LERC/LERC_DEFLATE/LERC_ZSTD compression. The default is 0(lossless).

  • WEBP_LEVEL=[1-100]: Set the WEBP quality level when using WEBPcompression. A value of 100 is best quality (least compression), and1 is worst quality (best compression). The default is 75.

  • WEBP_LOSSLESS=True/False: (GDAL >= 2.4.0 and libwebp >= 0.1.4):By default, lossy compression is used. If set to True, losslesscompression will be used. There is a significant time penalty for eachtile/strip with lossless WebP compression, so you may want to increase theBLOCKYSIZE value for strip layout.

  • PHOTOMETRIC=[MINISBLACK/MINISWHITE/RGB/CMYK/YCBCR/CIELAB/ICCLAB/ITULAB]:Set the photometric interpretation tag. Default is MINISBLACK, but ifthe input image has 3 or 4 bands of Byte type, then RGB will beselected. You can override default photometric using this option.

  • ALPHA=[YES/NON-PREMULTIPLIED/PREMULTIPLIED/UNSPECIFIED]: Thefirst “extrasample” is marked as being alpha if there are any extrasamples. This is necessary if you want to produce a greyscale TIFFfile with an alpha band (for instance). YES is an aliasfor NON-PREMULTIPLIED alpha.

  • PROFILE=[GDALGeoTIFF/GeoTIFF/BASELINE]: Control what non-baselinetags are emitted by GDAL.

    • With GDALGeoTIFF (the default) various GDAL custom tags may bewritten.

    • With GeoTIFF only GeoTIFF tags will be added to the baseline.

    • With BASELINE no GDAL or GeoTIFF tags will be written.BASELINE is occasionally useful when writing files to be read byapplications intolerant of unrecognized tags.

  • BIGTIFF=YES/NO/IF_NEEDED/IF_SAFER: Control whether the createdfile is a BigTIFF or a classic TIFF.

    • YES forces BigTIFF.

    • NO forces classic TIFF.

    • IF_NEEDED will only create a BigTIFF if it is clearly needed (inthe uncompressed case, and image larger than 4GB. So no effectwhen using a compression).

    • IF_SAFER will create BigTIFF if the resulting file *might*exceed 4GB. Note: this is only a heuristics that might not alwayswork depending on compression ratios.

    BigTIFF is a TIFF variant which can contain more than 4GiB of data(size of classic TIFF is limited by that value). This option isavailable if GDAL is built with libtiff library version 4.0 orhigher. The default is IF_NEEDED.

    When creating a new GeoTIFF with no compression, GDAL computes inadvance the size of the resulting file. If that computed file size isover 4GiB, GDAL will automatically decide to create a BigTIFF file.However, when compression is used, it is not possible in advance toknown the final size of the file, so classical TIFF will be chosen.In that case, the user must explicitly require the creation of aBigTIFF with BIGTIFF=YES if the final file is anticipated to be toobig for classical TIFF format. If BigTIFF creation is not explicitlyasked or guessed and the resulting file is too big for classicalTIFF, libtiff will fail with an error message like“TIFFAppendToStrip:Maximum TIFF file size exceeded”.

  • PIXELTYPE=[DEFAULT/SIGNEDBYTE]: By setting this to SIGNEDBYTE, anew Byte file can be forced to be written as signed byte.

  • COPY_SRC_OVERVIEWS=[YES/NO]: (CreateCopy() only)By setting this to YES (default is NO), the potential existingoverviews of the source dataset will be copied to the target datasetwithout being recomputed. This option is typically used to generateCloud Optimized Geotiff (starting with GDAL 3.1, the COG – Cloud Optimized GeoTIFF generator drivercan be used as a convenient shortcut). If overviews of mask band also exist,provided that the GDAL_TIFF_INTERNAL_MASK configuration option is setto YES, they will also be copied. Note that this creation option willhave no effect ifgeneral options (i.e. options which are not creation options) ofgdal_translate are used. Creation options related to compression arealso applied to the output overviews.

  • GEOTIFF_KEYS_FLAVOR=[STANDARD/ESRI_PE]: (GDAL >= 2.1.0) Determinewhich “flavor” of GeoTIFF keys must be used to write the SRSinformation. The STANDARD way (default choice) will use the generalaccepted formulations of GeoTIFF keys, including extensions of thevalues accepted for ProjectedCSTypeGeoKey to new EPSG codes. TheESRI_PE flavor will write formulations that are (more) compatible ofArcGIS. At the time of writing, the ESRI_PE choice has mostly aneffect when writing the EPSG:3857 (Web Mercator) SRS. For other SRS,the standard way will be used, with the addition of a ESRI_PE WKTstring as the value of PCSCitationGeoKey.

  • GEOTIFF_VERSION=[AUTO/1.0/1.1]: (GDAL >= 3.1.0) Select the version ofthe GeoTIFF standard used to encode georeferencing information. 1.0corresponds to the original1995, GeoTIFF Revision 1.0, by Ritter & Ruth.1.1 corresponds to the OGC standard 19-008, which is an evolution of 1.0,which clear ambiguities and fix inconsistencies mostly in the processing ofthe vertical part of a CRS.AUTO mode (default value) will generally select 1.0, unless the CRS toencode has a vertical component or is a 3D CRS, in which case 1.1 is used.

    Note

    Write support for GeoTIFF 1.1 requires libgeotiff 1.6.0 or later.

Subdatasets¶

Multi-page TIFF files are exposed as subdatasets. On opening, asubdataset name is GTIFF_DIR:{index}:filename.tif, where {index} startsat 1.

Starting with GDAL 3.0, subdataset creation is possible by using theAPPEND_SUBDATASET=YES creation option. The filename passed to Create() /CreateCopy() should be the regular filename (not with GTIFF_DIR: syntax.Creating overviews on a multi-page TIFF is not supported.

Starting with GDAL 3.2, read-only access to subdataset overviews and masksis possible provided that they are referenced by their parent IFD throughthe TIFFTAG_SUBIFD tag.

About JPEG compression of RGB images¶

When translating a RGB image to JPEG-In-TIFF, using PHOTOMETRIC=YCBCRcan make the size of the image typically 2 to 3 times smaller than thedefault photometric value (RGB). When using PHOTOMETRIC=YCBCR, theINTERLEAVE option must be kept to its default value (PIXEL), otherwiselibtiff will fail to compress the data.

Note also that the dimensions of the tiles or strips must be a multipleof 8 for PHOTOMETRIC=RGB or 16 for PHOTOMETRIC=YCBCR

Streaming operations¶

The GeoTIFF driver can support reading orwriting TIFF files (with some restrictions detailed below) in astreaming compatible way.

Driver Creative Camera

When reading a file from /vsistdin/, a named pipe (on Unix), or ifforcing streamed reading by setting the TIFF_READ_STREAMINGconfiguration option to YES, the GeoTIFF driver will assume that theTIFF Image File Directory (IFD) is at the beginning of the file, i.e. atoffset 8 for a classical TIFF file or at offset 16 for a BigTIFF file.The values of the tags of array type must be contained at the beginningof file, after the end of the IFD and before the first image strip/tile.The reader must read the strips/tiles in the order they are written inthe file. For a pixel interleaved file (PlanarConfiguration=Contig), therecommended order for a writer, and thus for a reader, is from top tobottom for a strip-organized file or from top to bottom, which a chunkof a block height, and left to right for a tile-organized file. For aband organized file (PlanarConfiguration=Separate), the above order isrecommended with the content of the first band, then the content of thesecond band, etc… Technically this order corresponds to increasingoffsets in the TileOffsets/StripOffsets tag. This is the order that theGDAL raster copy routine will assume.

If the order is not the one described above, the UNORDERED_BLOCKS=YESdataset metadata item will be set in the TIFF metadata domain. Eachblock offset can be determined by querying the“BLOCK_OFFSET_[xblock]_[yblock]” band metadata items in the TIFFmetadata domain (where xblock, yblock is the coordinate of the block),and a reader could use that information to determine the appropriatereading order for image blocks.

The files that are streamed into the GeoTIFF driver may be compressed,even if the GeoTIFF driver cannot produce such files in streamableoutput mode (regular creation of TIFF files will produce such compatiblefiles for streamed reading).

When writing a file to /vsistdout/, a named pipe (on Unix), or whendefiniting the STREAMABLE_OUTPUT=YES creation option, the CreateCopy()method of the GeoTIFF driver will generate a file with the above definedconstraints (related to position of IFD and block order), and this isonly supported for a uncompressed file. The Create() method alsosupports creating streamable compatible files, but the writer must becareful to set the projection, geotransform or metadata before writingimage blocks (so that the IFD is written at the beginning of the file).And when writing image blocks, the order of blocks must be the one ofthe above paragraph, otherwise errors will be reported.

Some examples :

or

Note: not all utilities are compatible with such input or outputstreaming operations, and even those which may deal with such files maynot manage to deal with them in all circumstances, for example if thereading driver driven by the output file is not compatible with theblock order of the streamed input.

Configuration options¶

This paragraph lists the configuration options that can be set to alterthe default behavior of the GTiff driver.

  • GTIFF_IGNORE_READ_ERRORS : Can be set to TRUE toavoid turning libtiff errors into GDAL errors. Can help readingpartially corrupted TIFF files

  • ESRI_XML_PAM : Can be set to TRUE to force metadata in the xml:ESRIdomain to be written to PAM.

  • JPEG_QUALITY_OVERVIEW : Integer between 0 and 100. Default value : 75.Quality of JPEG compressed overviews, either internal or external.

  • WEBP_LEVEL_OVERVIEW : Integer between 1 and 100. Default value : 75.WEBP quality level of overviews, either internal or external.

  • GDAL_TIFF_INTERNAL_MASK : See Internal nodatamasks section. Default value : FALSE.

  • GDAL_TIFF_INTERNAL_MASK_TO_8BIT : See Internal nodatamasks section. Default value : TRUE

  • USE_RRD : Can be set to TRUE to force external overviews in the RRDformat. Default value : FALSE

  • TIFF_USE_OVR : Can be set to TRUE to force external overviews in theGeoTIFF (.ovr) format. Default value : FALSE

  • GTIFF_POINT_GEO_IGNORE : Can be set to TRUE to revert back to thebehavior of ancient GDAL versions regarding how PixelIsPoint is interpretedw.r.t geotransform. See RFC 33: GTiff - Fixing PixelIsPoint Interpretation for more details. Default value : FALSE

  • GTIFF_REPORT_COMPD_CS : Can be set to TRUE to avoidstripping the vertical CRS of compound CRS when reading the SRS of afile. Does not affect the writing side. Default value : FALSE for GeoTIFF 1.0files, or TRUE (starting with GDAL 3.1) for GeoTIFF 1.1 files.

  • GDAL_ENABLE_TIFF_SPLIT : Can be set to FALSE to avoidall-in-one-strip files being presented as having. Default value :TRUE

  • GDAL_TIFF_OVR_BLOCKSIZE : See Overviews section.

  • GTIFF_LINEAR_UNITS : Can be set to BROKEN to read GeoTIFF files thathave false easting/northing improperly set in meters when it ought tobe in coordinate system linear units. (Ticket#3901).

  • TAB_APPROX_GEOTRANSFORM =YES/NO: To decide if anapproximate geotransform is acceptable when reading a .tab file.Default value: NO

  • GTIFF_DIRECT_IO =YES/NO: Can be set to YES to usespecialized RasterIO() implementations when reading un-compressedTIFF files (un-tiled only in GDAL 2.0, both un-tiled and tiled inGDAL 2.1) to avoid using the block cache. Setting it to YES even whenthe optimized cases do not apply should be safe (genericimplementation will be used). Default value:NO

  • GTIFF_VIRTUAL_MEM_IO =YES/NO/IF_ENOUGH_RAM: Can be setto YES to use specialized RasterIO() implementations when readingun-compressed TIFF files to avoid using the block cache. Thisimplementation relies on memory-mapped file I/O, and is currentlyonly supported on Linux (64-bit build strongly recommended) or,starting with GDAL 2.1, on other POSIX-like systems. Setting it toYES even when the optimized cases do not apply should be safe(generic implementation will be used), but if the file exceeds RAM,disk swapping might occur if the whole file is read. Setting it toIF_ENOUGH_RAM will first check if the uncompressed file size is nobigger than the physical memory. Default value:NO. If bothGTIFF_VIRTUAL_MEM_IO and GTIFF_DIRECT_IO are enabled, the former isused in priority, and if not possible, the later is tried.

  • GDAL_GEOREF_SOURCES =comma-separated list with one or several of PAM,INTERNAL, TABFILE or WORLDFILE. (GDAL >= 2.2). SeeGeoreferencing paragraph.

  • GDAL_NUM_THREADS =number_of_threads/ALL_CPUS: (GDAL >= 2.1) Enablemulti-threaded compression by specifying the number of workerthreads. Worth it for slow compression algorithms such as DEFLATE orLZMA. Will be ignored for JPEG. Default is compression in the mainthread. Note: this configuration option also apply to other parts toGDAL (warping, gridding, …).

  • GTIFF_WRITE_TOWGS84 =AUTO/YES/NO: (GDAL >= 3.0.3). When set to AUTO, aGeogTOWGS84GeoKey geokey will be written with TOWGS84 3 or 7-parameterHelmert transformation, if the CRS has no EPSG code attached to it, or ifthe TOWGS84 transformation attached to the CRS doesn’t match the one importedfrom the EPSG code.If set to YES, then the TOWGS84 transformation attached to the CRS will bealways written. If set to NO, then the transformation will not be written inany situation.

See Also¶

Drivers Of Value Creation In Branding

  • COG – Cloud Optimized GeoTIFF generator driver