.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "GDALTINDEX" "1" "Apr 22, 2024" "" "GDAL" .SH NAME gdaltindex \- Builds a shapefile as a raster tileindex. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gdaltindex [\-\-help] [\-\-help\-general] [\-overwrite] [\-recursive] [\-filename_filter ]... [\-min_pixel_size ] [\-max_pixel_size ] [\-f ] [\-tileindex ] [\-write_absolute_path] [\-skip_different_projection] [\-t_srs ] [\-src_srs_name ] [\-src_srs_format {AUTO|WKT|EPSG|PROJ}] [\-lyr_name ] [\-lco =]... [\-gti_filename ] [\-tr ] [\-te ] [\-ot ] [\-bandcount ] [\-nodata [,...]] [\-colorinterp [,...]] [\-mask] [\-mo =]... [\-fetch_md ]... []... .ft P .fi .UNINDENT .UNINDENT .SH DESCRIPTION .sp This program creates an OGR\-supported dataset with a record for each input raster file, an attribute containing the filename, and a polygon geometry outlining the raster. This output is suitable for use with \fI\%MapServer\fP as a raster tileindex, or as input for the \fI\%GTI\fP driver. .INDENT 0.0 .TP .B \-\-help Show this help message and exit .UNINDENT .INDENT 0.0 .TP .B \-\-help\-general Gives a brief usage message for the generic GDAL commandline options and exit. .UNINDENT .INDENT 0.0 .TP .B \-overwrite New in version 3.9. .sp Overwrite the tile index if it already exists. .UNINDENT .INDENT 0.0 .TP .B \-recursive New in version 3.9. .sp Whether directories specified in should be explored recursively. .UNINDENT .INDENT 0.0 .TP .B \-filename_filter New in version 3.9. .sp Pattern that the filenames contained in directories pointed by should follow. \(aq*\(aq is a wildcard character that matches any number of any characters including none. \(aq?\(aq is a wildcard character that matches a single character. Comparisons are done in a case insensitive way. Several filters may be specified. .sp For example :\fB\-filename_filter \(dq*.tif\(dq \-filename_filter \(dq*.tiff\(dq\fP .UNINDENT .INDENT 0.0 .TP .B \-min_pixel_size New in version 3.9. .sp 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 SRS defined by \fI\%\-t_srs\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-max_pixel_size New in version 3.9. .sp 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 SRS defined by \fI\%\-t_srs\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-f The OGR format of the output tile index file. Starting with GDAL 2.3, if not specified, the format is guessed from the extension (previously was ESRI Shapefile). .UNINDENT .INDENT 0.0 .TP .B \-tileindex The output field name to hold the file path/location to the indexed rasters. The default tile index field name is \fBlocation\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-write_absolute_path The absolute path to the raster files is stored in the tile index file. By default the raster filenames will be put in the file exactly as they are specified on the command line. .UNINDENT .INDENT 0.0 .TP .B \-skip_different_projection Only files with same projection as files already inserted in the tileindex will be inserted (unless \fI\%\-t_srs\fP is specified). Default does not check projection and accepts all inputs. .UNINDENT .INDENT 0.0 .TP .B \-t_srs Geometries of input files will be transformed to the desired target coordinate reference system. Default creates simple rectangular polygons in the same coordinate reference system as the input rasters. .UNINDENT .INDENT 0.0 .TP .B \-src_srs_name The name of the field to store the SRS of each tile. This field name can be used as the value of the TILESRS keyword in MapServer .UNINDENT .INDENT 0.0 .TP .B \-src_srs_format {AUTO|WKT|EPSG|PROJ} The format in which the SRS of each tile must be written. Types can be \fBAUTO\fP, \fBWKT\fP, \fBEPSG\fP, \fBPROJ\fP\&. This option should be used together with \fI\%\-src_srs_format\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-lyr_name Layer name to create/append to in the output tile index file. .UNINDENT .INDENT 0.0 .TP .B \-lco = New in version 3.9. .sp Layer creation option (format specific) .UNINDENT .INDENT 0.0 .TP .B The name of the output file to create/append to. The default dataset will be created if it doesn\(aqt already exist, otherwise it will append to the existing dataset. .UNINDENT .INDENT 0.0 .TP .B The input GDAL raster files, can be multiple files separated by spaces. Wildcards my also be used. Stores the file locations in the same style as specified here, unless \fI\%\-write_absolute_path\fP option is also used. .sp Starting with GDAL 3.9, this can also be a directory name. \fI\%\-recursive\fP can also be used to recurse down to sub\-directories. .sp It is also possible to use the generic option \fB\-\-optfile filelist.txt\fP to specify a list of source files. .UNINDENT .SH OPTIONS SPECIFIC TO USE BY THE GDAL GTI DRIVER .sp gdaltindex can be used to generate a tile index suitable for use by the \fI\%GTI\fP driver. There are two possibilities: .INDENT 0.0 .IP \(bu 2 either use directly a vector tile index generated by gdaltindex as the input of the GTI driver .IP \(bu 2 or generate a small XML .gti wrapper file, for easier use with non\-file\-based formats such as databases, or for vector formats that do not support setting layer metadata items. .UNINDENT .sp Formats that support layer metadata are for example GeoPackage (\fB\-f GPKG\fP), FlatGeoBuf (\fB\-f FlatGeoBuf\fP) or PostGIS (\fB\-f PG\fP) .sp Setting \fI\%\-tr\fP and \fI\%\-ot\fP is recommended to avoid the GTI driver to have to deduce them by opening the first tile in the index. If the tiles have nodata or mask band, \fI\%\-nodata\fP and \fI\%\-mask\fP should also be set. .sp In a GTI context, the extent of all tiles referenced in the tile index must be expressed in a single SRS. Consequently, if input tiles may have different SRS, either \fI\%\-t_srs\fP or \fI\%\-skip_different_projection\fP should be specified. .INDENT 0.0 .TP .B \-gti_filename New in version 3.9. .sp Filename of the XML Virtual Tile Index file to generate, that can be used as an input for the GDAL GTI / Virtual Raster Tile Index driver. This can be useful when writing the tile index in a vector format that does not support writing layer metadata items. .UNINDENT .INDENT 0.0 .TP .B \-tr New in version 3.9. .sp Target resolution in SRS unit per pixel. .sp Written in the XML Virtual Tile Index if \fI\%\-gti_filename\fP is specified, or as \fBRESX\fP and \fBRESY\fP layer metadata items for formats that support layer metadata. .UNINDENT .INDENT 0.0 .TP .B \-te New in version 3.9. .sp Target extent in SRS unit. .sp Written in the XML Virtual Tile Index if \fI\%\-gti_filename\fP is specified, or as \fBMINX\fP, \fBMINY\fP, \fBMAXX\fP and \fBMAXY\fP layer metadata items for formats that support layer metadata. .UNINDENT .INDENT 0.0 .TP .B \-ot New in version 3.9. .sp Data type of the tiles of the tile index: \fBByte\fP, \fBInt8\fP, \fBUInt16\fP, \fBInt16\fP, \fBUInt32\fP, \fBInt32\fP, \fBUInt64\fP, \fBInt64\fP, \fBFloat32\fP, \fBFloat64\fP, \fBCInt16\fP, \fBCInt32\fP, \fBCFloat32\fP or \fBCFloat64\fP .sp Written in the XML Virtual Tile Index if \fI\%\-gti_filename\fP is specified, or as \fBDATA_TYPE\fP layer metadata item for formats that support layer metadata. .UNINDENT .INDENT 0.0 .TP .B \-bandcount New in version 3.9. .sp Number of bands of the tiles of the tile index. .sp Written in the XML Virtual Tile Index if \fI\%\-gti_filename\fP is specified, or as \fBBAND_COUNT\fP layer metadata item for formats that support layer metadata. .sp A mix of tiles with N and N+1 bands is allowed, provided that the color interpretation of the (N+1)th band is alpha. The N+1 value must be written as the band count in that situation. .sp If \fI\%\-nodata\fP or \fI\%\-colorinterp\fP are specified and have multiple values, the band count is also inferred from that number. .UNINDENT .INDENT 0.0 .TP .B \-nodata [,...] New in version 3.9. .sp Nodata value of the tiles of the tile index. .sp Written in the XML Virtual Tile Index if \fI\%\-gti_filename\fP is specified, or as \fBNODATA\fP layer metadata item for formats that support layer metadata. .UNINDENT .INDENT 0.0 .TP .B \-colorinterp [,...] New in version 3.9. .sp Color interpretation of of the tiles of the tile index: \fBred\fP, \fBgreen\fP, \fBblue\fP, \fBalpha\fP, \fBgray\fP, \fBundefined\fP\&. .sp Written in the XML Virtual Tile Index if \fI\%\-gti_filename\fP is specified, or as \fBCOLOR_INTERPRETATION\fP layer metadata item for formats that support layer metadata. .UNINDENT .INDENT 0.0 .TP .B \-mask New in version 3.9. .sp Whether tiles in the tile index have a mask band. .sp Written in the XML Virtual Tile Index if \fI\%\-gti_filename\fP is specified, or as \fBMASK_BAND\fP layer metadata item for formats that support layer metadata. .UNINDENT .INDENT 0.0 .TP .B \-mo = New in version 3.9. .sp Write an arbitrary layer metadata item, for formats that support layer metadata. This option may be repeated. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 This option cannot be used together \fI\%\-gti_filename\fP .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-fetch_md New in version 3.9. .sp Fetch a metadata item from the raster tile and write it as a field in the tile index. .sp should be the name of the raster metadata item. \fB{PIXEL_SIZE}\fP may be used as a special name to indicate the pixel size. .sp should be the name of the field to create in the tile index. .sp should be the name of the type to create. One of \fBString\fP, \fBInteger\fP, \fBInteger64\fP, \fBReal\fP, \fBDate\fP, \fBDateTime\fP .sp This option may be repeated. .sp For example: \fB\-fetch_md TIFFTAG_DATETIME creation_date DateTime\fP .UNINDENT .SH EXAMPLES .INDENT 0.0 .IP \(bu 2 Produce a shapefile (\fBdoq_index.shp\fP) with a record for every image that the utility found in the \fBdoq\fP folder. Each record holds information that points to the location of the image and also a bounding rectangle shape showing the bounds of the image: .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gdaltindex doq_index.shp doq/*.tif .ft P .fi .UNINDENT .UNINDENT .INDENT 0.0 .IP \(bu 2 Perform the same command as before, but now we create a GeoPackage instead of a Shapefile. .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gdaltindex \-f GPKG doq_index.gpkg doq/*.tif .ft P .fi .UNINDENT .UNINDENT .INDENT 0.0 .IP \(bu 2 The \fI\%\-t_srs\fP option can also be used to transform all input rasters into the same output projection: .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gdaltindex \-t_srs EPSG:4326 \-src_srs_name src_srs tile_index_mixed_srs.shp *.tif .ft P .fi .UNINDENT .UNINDENT .INDENT 0.0 .IP \(bu 2 Make a tile index from files listed in a text file, with metadata suitable for use by the GDAL GTI / Virtual Raster Tile Index driver. .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gdaltindex tile_index.gti.gpkg \-datatype Byte \-tr 60 60 \-colorinterp Red,Green,Blue \-\-optfile my_list.txt .ft P .fi .UNINDENT .UNINDENT .SH C API .sp This utility is also callable from C with \fI\%GDALTileIndex()\fP\&. .SH SEE ALSO .sp \fI\%Common options for raster programs\fP for other command\-line options, and in particular the \fI\%\-\-optfile\fP switch that can be used to specify a list of input datasets. .SH AUTHOR Frank Warmerdam .SH COPYRIGHT 1998-2024 .\" Generated by docutils manpage writer. .