dwww Home | Manual pages | Find package

GDALTINDEX(1)                        GDAL                        GDALTINDEX(1)

NAME
       gdaltindex - Builds a shapefile as a raster tileindex.

SYNOPSIS
          gdaltindex [-f format] [-tileindex field_name] [-write_absolute_path]
                  [-skip_different_projection] [-t_srs target_srs]
                  [-src_srs_name field_name] [-src_srs_format [AUTO|WKT|EPSG|PROJ]
                  [-lyr_name name] index_file [gdal_file]*

DESCRIPTION
       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
       MapServer as a raster tileindex.

       -f <format>
              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).

       -tileindex <field_name>
              The output field name to hold the file path/location to the  in-
              dexed rasters. The default tile index field name is location.

       -write_absolute_path
              The  absolute path to the raster files is stored in the tile in-
              dex file.  By default the raster filenames will be  put  in  the
              file exactly as they are specified on the command line.

       -skip_different_projection
              Only files with same projection as files already inserted in the
              tileindex will be inserted (unless -t_srs is specified). Default
              does not check projection and accepts all inputs.

       -t_srs <target_srs>:
              Geometries  of  input  files  will be transformed to the desired
              target coordinate reference system.  Default creates simple rec-
              tangular polygons in the same coordinate reference system as the
              input rasters.

       -src_srs_name <field_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

       -src_srs_format <type>
              The format in which the SRS of each tile must be written.  Types
              can be AUTO, WKT, EPSG, PROJ.

       -lyr_name <name>
              Layer name to create/append to in the output tile index file.

       index_file
              The  name  of  the  output file to create/append to. The default
              dataset will be created if it doesn't already  exist,  otherwise
              it will append to the existing dataset.

       <gdal_file>
              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 -write_absolute_path
              option is also used.

EXAMPLES
       • Produce a shapefile (doq_index.shp) with a  record  for  every  image
         that  the utility found in the doq folder. Each record holds informa-
         tion that points to the location of the image  and  also  a  bounding
         rectangle shape showing the bounds of the image:

          gdaltindex doq_index.shp doq/*.tif

       • Perform  the  same  command as before, but now we create a GeoPackage
         instead of a Shapefile.

          gdaltindex -f GPKG doq_index.gpkg doq/*.tif

       • The -t_srs option can also be used to  transform  all  input  rasters
         into the same output projection:

          gdaltindex -t_srs EPSG:4326 -src_srs_name src_srs tile_index_mixed_srs.shp *.tif

       • Make a tile index from files listed in a text file :

          gdaltindex doq_index.shp --optfile my_list.txt

SEE ALSO
       raster_common_options for other command-line options, and in particular
       the --optfile switch that can be  used  to  specify  a  list  of  input
       datasets.

AUTHOR
       Frank Warmerdam <warmerdam@pobox.com>

COPYRIGHT
       1998-2021

                                 Dec 27, 2021                    GDALTINDEX(1)

Generated by dwww version 1.14 on Fri Jan 24 06:28:59 CET 2025.