gdaltindex

Creates an OGR-supported dataset as a raster tileindex.

简介

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]*

描述

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>

输出平铺索引文件的OGR格式。从GDAL 2.3开始,如果未指定,则从扩展名猜测格式(以前是ESRI Shapefile)。

-tileindex <field_name>

保存索引栅格的文件路径/位置的输出字段名。默认的磁贴索引字段名为 location .

-write_absolute_path

栅格文件的绝对路径存储在平铺索引文件中。默认情况下,栅格文件名将按照命令行中指定的格式放入文件中。

-skip_different_projection

只插入与tileindex中已插入的文件具有相同投影的文件(除非 -t_srs 已指定)。默认不检查投影并接受所有输入。

-t_srs <target_srs>:

输入文件的几何图形将转换为所需的目标坐标参考系。默认情况下,在与输入栅格相同的坐标参考系中创建简单的矩形多边形。

-src_srs_name <field_name>

存储每个磁贴的SRS的字段的名称。此字段名可以用作MapServer中tiless关键字的值

-src_srs_format <type>

必须写入每个磁贴的SRS的格式。类型可以是AUTO、WKT、EPSG、PROJ。

-lyr_name <name>

要在输出平铺索引文件中创建/附加到的图层名。

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>

输入的GDAL栅格文件,可以是由空格分隔的多个文件。通配符my也可以使用。以此处指定的相同样式存储文件位置,除非 -write_absolute_path 选项也被使用。

实例

  • 生成形状文件 (doq_index.shp )对于实用程序在 doq 文件夹。每条记录都包含指向图像位置的信息,以及显示图像边界的边框形状:

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
  • 这个 -t_srs 选项还可用于将所有输入栅格转换为相同的输出投影:

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

也见

栅格程序的常用选项 对于其他命令行选项,尤其是 --optfile 可用于指定输入数据集列表的开关。