GDAL-RASTER-INDEX(1)
π NAME π
gdal-raster-index β bestie, it makes a vector index of your raster datasets π
No cap, it was Added in version 3.11. β so it's new-ish, and it ate.
π SYNOPSIS π
Usage: gdal raster index [OPTIONS] <INPUT>... <OUTPUT>
Create a vector index of raster datasets.
Positional arguments π«Ά
-i,--input <INPUT>β the input raster datasets. [may be repeated] [required] β yes bestie, required, it needs to know what to index-o,--output <OUTPUT>β the output vector dataset. [required] β where the index goes, also required, no skips
Common Options β¨
-h,--helpβ Display help message and exit--json-usageβ Display usage as JSON document and exit--config <KEY>=<VALUE>β Configuration option [may be repeated]-q,--quietβ Quiet mode (no progress bar or warning message) [not available in pipelines]
Options πΈ
-f,--of,--format,--output-format <OUTPUT-FORMAT>β Output format--co,--creation-option <KEY>=<VALUE>β Creation option [may be repeated]--lco,--layer-creation-option <KEY>=<VALUE>β Layer creation option [may be repeated]--overwriteβ Whether overwriting existing output dataset is allowed. Mutually exclusive with--update--updateβ Whether to open existing dataset in update mode. Mutually exclusive with--overwrite--overwrite-layerβ Whether overwriting existing output layer is allowed--appendβ Whether appending to existing layer is allowed--nln,--output-layer <OUTPUT-LAYER>β Output layer name--recursiveβ Whether input directories should be explored recursively.--filename-filter <FILENAME-FILTER>β Pattern that the filenames in input directories should follow ('*'and'?'wildcard) [may be repeated]--min-pixel-size <MIN-PIXEL-SIZE>β Minimum pixel size in term of geospatial extent per pixel (resolution) that a raster should have to be selected.--max-pixel-size <MAX-PIXEL-SIZE>β Maximum pixel size in term of geospatial extent per pixel (resolution) that a raster should have to be selected.--location-name <LOCATION-NAME>β Name of the field with the raster path (default:location)--absolute-pathβ Whether the path to the input datasets should be stored as an absolute path--output-crs <OUTPUT-CRS>β Output CRS--metadata <KEY>=<VALUE>β Add dataset metadata item [may be repeated]--skip-errorsβ Skip errors related to input datasets--profile <PROFILE>β Profile of output dataset.PROFILE=none|STAC-GeoParquet(default:none)--base-url <BASE-URL>β Base URL for STAC-GeoParquet href--id-method <ID-METHOD>β How to derive STAC-GeoParquet'id'.ID-METHOD=filename|md5|metadata-item(default:filename)--id-metadata-item <ID-METADATA-ITEM>β Name of metadata item used to set STAC-GeoParquet'id'(default:id)--source-crs-field-name <SOURCE-CRS-FIELD-NAME>β Name of the field to store the CRS of each dataset--source-crs-format <SOURCE-CRS-FORMAT>β Format in which the CRS of each dataset must be written.SOURCE-CRS-FORMAT=auto|WKT|EPSG|PROJ(default:auto)
π DESCRIPTION π
Okay so the way that gdal raster index works is: it creates a vector dataset with a record for each input raster file, an attribute holding the filename, and a polygon geometry outlining the raster. Iconic behavior, honestly. And this output is suitable for use with MapServer as a raster tileindex β that's the whole vibe, iykyk. πΊοΈ
Also, peep gdal driver gti create β that's an extension of this command that creates files to be used as input for the GTI driver. Different tool, related energy. β¨
The following options are available:
π PROGRAM-SPECIFIC OPTIONS π
--absolute-pathβ the absolute path to the raster files gets stored in the index file. By default though? The raster filenames go in the file exactly as they are specified on the command line. So no sneaky rewriting. π--base-url <BASE-URL>β Added in version 3.13.
Base URL for STAC-GeoParquet, for the href property of the id property in a STAC-GeoParquet index.
--filename-filter <FILENAME-FILTER>β the pattern that the filenames contained in input directories should follow. So'*'is a wildcard character that matches any number of any characters including none, and'?'is a wildcard character that matches a single character. Comparisons are done in a case insensitive way, bestie. Several filters may be specified.
For example: --filename-filter "*.tif,*.tiff" π
--id-metadata-item <ID-METADATA-ITEM>β Added in version 3.13.
Name of metadata item used to set STAC-GeoParquet id property. Defaults to id.
--id-method filename|md5|metadata-itemβ Added in version 3.13.
How to derive the STAC-GeoParquet id property:
filename(the default): only the filename (without directory, but including extension) is usedmd5: theMD5Sumof the file is computed, and suffixed with the filename.metadata-item: the value of the metadata item defined by--id-metadata-itemfrom each source dataset is used.
--location-name <LOCATION-NAME>β the output field name to hold the file path/location to the indexed rasters. The default field name islocation. π--max-pixel-size <val>β Maximum pixel size in term of geospatial extent per pixel (resolution) that a raster should have to be selected. The pixel size is evaluated after reprojection of its extent to the target CRS defined by--output-crs. π--metadata <KEY>=<VALUE>β Write an arbitrary layer metadata item, for formats that support layer metadata. This option may be repeated. (Repeat away, bestie.)--min-pixel-size <val>β Minimum pixel size in term of geospatial extent per pixel (resolution) that a raster should have to be selected. The pixel size is evaluated after reprojection of its extent to the target CRS defined by--output-crs. π--output-crs <OUTPUT-CRS>β Geometries of input files will be transformed to the desired target coordinate reference system. The default creates simple rectangular polygons in the same coordinate reference system as the input rasters. No transformation, just vibes. π--profile none|STAC-GeoParquetβ Added in version 3.13.
Defines the profile of the output dataset. If you select STAC-GeoParquet, a Parquet file conforming to the STAC-GeoParquet specification is created (provided that the Parquet format is also selected). Such a file can be read by the GTI driver. And heads up: setting STAC-GeoParquet also implicitly sets the target CRS to EPSG:4326. It just does that. π
--recursiveβ Whether input directories should be explored recursively. Go deep, bestie. π³οΈ--skip-errorsβ Added in version 3.12.
Skip errors related to input datasets.
--source-crs-field-name <SOURCE-CRS-FIELD-NAME>β The name of the field to store the CRS of each tile. This field name can be used as the value of theTILESRSkeyword in MapServer. ποΈ--source-crs-format auto|WKT|EPSG|PROJβ The format in which the CRS of each tile must be written. Types can beauto,WKT,EPSG,PROJ. This option should be used together with--source-crs-field-name. They're a package deal. π«Ά
β STANDARD OPTIONS β
--appendβ Whether appending features to existing layer(s) is allowed. This also creates the output dataset if it does not exist yet. Two-for-one. β¨--co,--creation-option <NAME>=<VALUE>β Many formats have one or more optional creation options that can be used to control particulars about the file created. For instance, the GeoTIFF driver supports creation options to control compression, and whether the file should be tiled.
May be repeated.
The creation options available vary by format driver, and some simple formats have no creation options at all. A list of options supported for a format can be listed with the --formats command line option but the documentation for the format is the definitive source of information on driver creation options. See Raster drivers format specific documentation for legal creation options for each format. π
--lco,--layer-creation-option <NAME>=<VALUE>β Many formats have one or more optional layer creation options that can be used to control particulars about the layer created. For instance, the GeoPackage driver supports layer creation options to control the feature identifier or geometry column name, setting the identifier or description, etc.
May be repeated.
The layer creation options available vary by format driver, and some simple formats have no layer creation options at all. A list of options supported for a format can be listed with the --formats command line option but the documentation for the format is the definitive source of information on driver creation options. See Vector drivers format specific documentation for legal creation options for each format.
β οΈ Note that layer creation options are different from dataset creation options. Do not confuse them, bestie, they are not the same girlies.
-f,--of,--format,--output-format <OUTPUT-FORMAT>β Which output vector format to use. Allowed values may be given by:
gdal --formats | grep vector | grep rw | sort
--nln,--output-layer <LAYER>β Provides a name for the output vector layer. π·οΈ--overwriteβ Allow program to overwrite existing target file or dataset. Otherwise, by default,gdalerrors out if the target file or dataset already exists. So like, it will not just bulldoze your stuff without permission. π--overwrite-layerβ Whether overwriting the existing output vector layer is allowed.--updateβ Whether the output dataset must be opened in update mode. Implies that it already exists. (It has to exist, okay? Don't come at it with a dataset that doesn't.) π
π¦ RETURN STATUS CODE π¦
The program returns status code 0 in case of success, and non-zero in case of error β and yeah, non-blocking errors emitted as warnings count as a successful execution. So 0 can still have been a little messy, but that's fine, that's growth. π±
β¨ EXAMPLES β¨
ok bestie these are the little recipes that make it all click, like a vibe check for your brain π§ π
πΈ Example 1 πΈ
so picture this: you want a GeoPackage where every single image that the utility sniffed out in the doq folder gets its own record. and each record is holding info that points to where the image lives, plus a bounding rectangle shape showing the bounds of that image. it's giving catalog energy fr fr π
gdal raster index doq/*.tif doq_index.gpkg
πΈ Example 2 πΈ
okay so the --output-crs option can highkey also be used to transform all your input raster geometries into the same output projection. mixed CRSs could never π
gdal raster index --output-crs EPSG:4326 --source-crs-field-name=src_srs *.tif tile_index_mixed_crs.gpkg
πΈ Example 3 πΈ
this one creates a STAC-GeoParquet compliant index. iconic behaviour, no notes πβ¨
gdal raster index --profile STAC-GeoParquet *.tif index.parquet
π AUTHOR π
Even Rouault <even.rouault@spatialys.com> β the main character who wrote this whole thing π«Ά
π COPYRIGHT π
1998-2026 β yeah, that's a long legacy and it ate π
okay that's the whole page bestie, we did it π
β¨ this was GDAL-RASTER-INDEX(1), dated Aug 18, 2026, and the copyright is 1998-2026 π¦ love u, go index something gorgeous πΈπ
π¦ 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