GDAL_RETILE(1)
π GDAL_RETILE(1) π
okay bestie, gather round, because we're talking about gdal_retile from the GDAL fam β it's a whole little command-line moment and I'm obsessed π
β¨ NAME β¨
gdal_retile β retiles a set of tiles and/or builds tiled pyramid levels. that's the whole vibe, no cap π¦
πΈ SYNOPSIS πΈ
gdal_retile [--help] [--help-general]
[-v] [-co <NAME>=<VALUE>]... [-of <out_format>] [-ps <pixelWidth> <pixelHeight>]
[-overlap <val_in_pixel>]
[-ot {Byte/Int8/Int16/UInt16/UInt32/Int32/Float32/Float64/
CInt16/CInt32/CFloat32/CFloat64}]'
[ -tileIndex <tileIndexName> [-tileIndexField <tileIndexFieldName>]]
[-csv <fileName> [-csvDelim <delimiter>]]
[-s_srs <srs_def>] [-pyramidOnly]
[-r {near|bilinear|cubic|cubicspline|lanczos}]
-levels <numberoflevels>
[-useDirForEachRow] [-resume]
-targetDir <TileDirectory> <input_file> <input_file>...
like, look at her. so many flags. main character energy fr fr π
π DESCRIPTION π
so this utility retiles a set of input tile(s). crucial rules though, bestie, listen up:
- all the input tile(s) have to be georeferenced in the same coordinate system
- they also need a matching number of bands
- and the geotransform matrix of the input tiles must not contain rotation terms (nah, none of that)
optionally, pyramid levels get generated too. and here's the tea: all pyramid levels are generated from the input tiles, not from previous levels. remember that. it's giving "start from the source every time" π«
you can also generate shape file(s) for the tiled output. cute, right?
if your number of input tiles exhausts the command line buffer, use the general --optfile option. iykyk π
NOTE: gdal_retile is a Python utility, and it's only available if GDAL Python bindings are available. no bindings, no fun. π
TIP: Equivalent in the new"gdal"command line interface: seegdal raster tile(partially equivalent). slay, the glow-up is real β¨
π OPTIONS π
--helpβ show this help message and exit. short, sweet, done. π--help-generalβ gives you a brief usage message for the generic GDAL commandline options, then exits. the "wait what are all y'all" button π«Ά-targetDir <directory>β the directory where the tile result gets created. pyramids are stored in sub-directories numbered from1. created tile names have a numbering schema and contain the name of the source tiles(s). yes, it's organized, we love a tidy queen πΈ-of <format>β pick the output format. if you don't specify one, the format is guessed from the extension. use the short format name, bestie.-co <NAME>=<VALUE>β many formats have one or more optional creation options to control particulars about the file being created. for instance, the GeoTIFF driver supports creation options to control compression, and whether the file should be tiled. π
the creation options available vary by format driver, and some simple formats have no creation options at all. you can list the options supported for a format with the --format command line option, but honestly the documentation for the format is the definitive source of info on driver creation options. see Raster drivers format specific documentation for the legal creation options for each format.
-ot <type>β force the output image bands to have a specific data type supported by the driver, which may be one of:Byte,Int8,UInt16,Int16,UInt32,Int32,UInt64,Int64,Float32,Float64,CInt16,CInt32,CFloat32orCFloat64.-ps <pixelsize_x> <pixelsize_y>β pixel size to be used for the output file. if you don't specify it,256 x 256is the default. iconic default tbh π-overlap <val_in_pixel>β overlap in pixels between consecutive tiles. if not specified,0is the default. cozy, no overlap, respect π€-levels <numberOfLevels>β number of pyramid levels to build. π-vβ generate verbose output of tile operations as they're done. narrator mode, we stan a chatty icon π¬-pyramidOnlyβ no retiling, build only the pyramids. skips the main event for the encore ποΈ-r <algorithm>β resampling algorithm, default isnear. options includenear,bilinear,cubic,cubicspline,lanczos.-s_srs <srs_def>β source spatial reference to use. the coordinate systems you can pass are anything supported by theOGRSpatialReference.SetFromUserInput()call, which includes EPSG, PCS, and GCSes (i.e.EPSG:4296), PROJ.4 declarations (as above), or the name of a.prjfile containing well known text. if nosrs_defis given, thesrs_defof the source tiles is used (if there is any). thesrs_defwill be propagated to created tiles (if possible) and to the optional shape file(s). it's giving "this is my identity and i'm sharing it" π-tileIndex <tileIndexName>β the name of the shape file containing the result tile(s) index.-tileIndexField <tileIndexFieldName>β the name of the attribute containing the tile name.-csv <csvFileName>β the name of the csv file containing the tile(s) georeferencing information. the file contains 5 columns:tilename,minx,maxx,miny,maxy.-csvDelim <column delimiter>β the column delimiter used in the CSV file. the default value is a semicolon";". periodt π«Ά-useDirForEachRowβ normally the tiles of the base image are stored as described in-targetDir. for large images, some file systems have performance problems if the number of files in a directory is too big, which causesgdal_retileto not finish in reasonable time π using this parameter creates a different output structure: the tiles of the base image are stored in a sub-directory called0, and the pyramids live in sub-directories numbered1,2,.... within each of these directories another level of sub-directories gets created, numbered from0...n, depending on how many tile rows are needed for each level. finally, a directory contains only the tiles for one row for a specific level. for large images a performance improvement of a factorNcould be achieved. big brain behavior, truly π§ β¨-resumeβ resume mode. generate only missing files. the "we were on a break but we're back" flag π
β RETURN STATUS CODE β
the program returns status code 0 in case of success, and non-zero in case of error. and heads up: non-blocking errors emitted as warnings are considered as a successful execution β so a lil warning is not a fail, babes. vibe check passed β
π AUTHOR π
Christian Mueller <christian.mueller@nvoe.at> β thank you for your service, legend π
π COPYRIGHT π
1998-2026
and that's the whole page, bestie π«Ά go forth, retile, build those pyramids, and remember: source GDAL, dated Aug 18, 2026, GDAL_RETILE(1) β you're welcome, mwah ππ β¨
π¦ where this page comes from
- alpine 3.24: gdal-doc 3.13.3-r0 Β· MIT
- arch rolling: gdal 3.13.3-6 Β· MIT
- ubuntu stonking: gdal-bin 3.13.3+dfsg-1ubuntu4 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms