光栅程序的通用选项

不羁的心 提交于 2019-12-29 08:04:18

【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>

Common options for raster programs 光栅程序的通用选项

All GDAL command line programs support the following common options.

所有 GDAL 命令行程序都支持以下通用选项。

--version

Report the version of GDAL and exit.

报告 GDAL 版本并退出。

--formats

List all raster formats supported by this GDAL build (read-only and read-write) and exit. The format support is indicated as follows: ‘ro’ is read-only driver; ‘rw’ is read or write (i.e. supports CreateCopy); ‘rw+’ is read, write and update (i.e. supports Create). A ‘v’ is appended for formats supporting virtual IO (/vsimem, /vsigzip, /vsizip, etc). A ‘s’ is appended for formats supporting subdatasets. Note: The valid formats for the output of gdalwarp are formats that support the Create() method (marked as rw+), not just the CreateCopy() method.

列出这个 GDAL 构建(只读和读写)支持的所有光栅格式并退出。 格式支持如下: ro 是只读驱动程序; rw 是读或写(即支持 CreateCopy) ; rw + 是读、写和更新(即支持创建)。 对于支持虚拟 IO (/ vsimem、 / vsigzip、 / vsizip 等)的格式,会添加一个“ v”。 对于支持子数据集的格式,将附加“ s”。 注意: gdalwarp 输出的有效格式是支持 Create ()方法(标记为 rw +)的格式,而不仅仅是 CreateCopy ()方法。

--format <format>

List detailed information about a single format driver. The format should be the short name reported in the –formats list, such as GTiff.

列出有关单一格式驱动程序的详细信息。 格式应该是-formats 列表中报告的短名称,比如 GTiff。

--optfile <filename>

Read the named file and substitute the contents into the command line options list. Lines beginning with # will be ignored. Multi-word arguments may be kept together with double quotes.

读取指定文件并将其内容替换为命令行选项列表。 以 # 开头的行将被忽略。 多词参数可以用双引号保存在一起。

--config <key> <value>

Sets the named configuration keyword to the given value, as opposed to setting them as environment variables. Some common configuration keywords are GDAL_CACHEMAX (memory used internally for caching in megabytes) and GDAL_DATA (path of the GDAL “data” directory). Individual drivers may be influenced by other configuration options.

将指定的配置关键字设置为给定的值,而不是将它们设置为环境变量。 一些常见的配置关键字是 GDAL cachemax (内部用于缓存兆字节的内存)和 GDAL data (GDAL“ data”目录的路径)。 单个驱动程序可能会受到其他配置选项的影响。

--debug <value>

Control what debugging messages are emitted. A value of ON will enable all debug messages. A value of OFF will disable all debug messages. Another value will select only debug messages containing that string in the debug prefix code.

控制发出的调试消息。 值 ON 将启用所有调试消息。 值 OFF 将禁用所有调试消息。 另一个值将只选择在调试前缀代码中包含该字符串的调试消息。

--help-general

Gives a brief usage message for the generic GDAL command line options and exit.

给出通用 GDAL 命令行选项的简短使用信息并退出。

Creating new files 创建新文件

Access an existing file to read it is generally quite simple. Just indicate the name of the file or dataset on the command line. However, creating a file is more complicated. It may be necessary to indicate the the format to create, various creation options affecting how it will be created and perhaps a coordinate system to be assigned. Many of these options are handled similarly by different GDAL utilities, and are introduced here.

访问一个现有的文件来读取它通常是相当简单的。 只需在命令行上指定文件或数据集的名称。 但是,创建文件要复杂得多。 可能有必要指出要创建的格式,各种各样的创建选项会影响如何创建它,也许还需要指定一个坐标系。 许多这些选项都是由不同的 GDAL 实用程序以类似的方式处理的,这里将介绍这些选项。

-of <format>

Select the format to create the new file as. The formats are assigned short names such as GTiff (for GeoTIFF) or HFA (for Erdas Imagine). The list of all format codes can be listed with the --formats switch. Only formats list as (rw) (read-write) can be written.

选择要创建新文件的格式。 这些格式分配了简短的名称,如 GTiff (用于 GeoTIFF)或 HFA (用于 Erdas Imagine)。 所有格式代码的列表可以通过 -- formats 开关列出。 只能将列表格式写为(rw)(读-写)。

New in version 2.3: If not specified, the format is guessed from the extension. Previously, it was generally GTiff for raster, or ESRI Shapefile for vector.

版本2.3中的新增: 如果没有指定,格式将从扩展名中猜测。 以前,它通常是 GTiff 为光栅,或 ESRI Shapefile 为矢量。

-co <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.

许多格式具有一个或多个可选的创建选项,可用于控制所创建文件的详细信息。 例如,GeoTIFF 驱动程序支持创建选项来控制压缩,以及是否应该平铺文件。

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.

可用的创建选项因格式驱动程序而异,一些简单的格式根本没有创建选项。 格式支持的选项列表可以用-formats 命令行选项列出,但格式文档是驱动程序创建选项的最终信息来源。 请参阅光栅驱动程序格式特定的文档,了解每种格式的合法创建选项。

-a_srs <srs>

-s_srs <srs>

-t_srs <srs>

Several utilities (e.g. gdal_translate and gdalwarp) include the ability to specify coordinate systems with command line options like -a_srs (assign SRS to output), -s_srs (source SRS) and -t_srs (target SRS). These utilities allow the coordinate system (SRS = spatial reference system) to be assigned in a variety of formats.

一些实用程序(例如 gdal translate 和 gdalwarp)包括使用命令行选项指定坐标系统的能力,比如-a SRS (将 SRS 分配给输出)、-s SRS (源 SRS)和-t SRS (目标 SRS)。 这些实用程序允许以各种格式分配坐标系参考系统。

  • NAD27|NAD83|WGS84|WGS72

    NAD27 | NAD83 | WGS84 | WGS72

    These common geographic (lat/long) coordinate systems can be used directly by these names.

    这些通用的地理坐标系(lat / long)可以直接使用这些名称。

  • EPSG:n

    EPSG: n

    Coordinate systems (projected or geographic) can be selected based on their EPSG codes. For instance, EPSG:27700 is the British National Grid. A list of EPSG coordinate systems can be found in the GDAL data files gcs.csv and pcs.csv.

    坐标系统(投影或地理)可以根据它们的 EPSG 代码来选择。 例如,EPSG: 27700是英国国家电网。 EPSG 坐标系列表可以在 GDAL 数据文件 gcs.csv 和 pcs.csv 中找到。

  • PROJ.4 definition

    PROJ. 4定义文件

    A PROJ.4 definition string can be used as a coordinate system. Take care to keep the proj.4 string together as a single argument to the command (usually by double quoting).

    一个 PROJ. 4定义的字符串可以用作坐标系。 注意将 PROJ 4字符串保持为命令的单个参数(通常是双引号)。

    For instance +proj=utm +zone=11 +datum=WGS84.

    例如 + proj utm + zone 11 + datum WGS84。

  • OpenGIS Well Known Text

    The Open GIS Consortium has defined a textual format for describing coordinate systems as part of the Simple Features specifications. This format is the internal working format for coordinate systems used in GDAL. The name of a file containing a WKT coordinate system definition may be used a coordinate system argument, or the entire coordinate system itself may be used as a command line option (though escaping all the quotes in WKT is quite challenging).

    开放地理空间协会已经定义了一种文本格式来描述坐标系统,作为简单功能规范的一部分。 这种格式是 GDAL 使用的坐标系统的内部工作格式。 包含 WKT / 坐标系定义的文件的名称可以用作 WKT / 坐标系参数,或者整个坐标系本身可以用作命令行选项(尽管在 WKT 中转义所有引号非常具有挑战性)。

  • ESRI Well Known Text

    ESRI uses a slight variation on OGC WKT format in their ArcGIS product (ArcGIS .prj files), and these may be used in a similar manner o WKT files, but the filename should be prefixed with ESRI::.

    Esri 在他们的 ArcGIS 产品(ArcGIS)中使用了 OGC WKT 格式的稍微变化。 Prj 文件) ,这些文件可以以类似的方式使用 o WKT 文件,但是文件名应该以 ESRI: : 作为前缀。

    For example, “ESRI::NAD 1927 StatePlane Wyoming West FIPS 4904.prj”.

    例如,“ ESRI: : NAD 1927年怀俄明州州界西 FIPS 4904。 “ prj”。

  • Spatial References from URLs

    来自 url 的空间引用

    For example http://spatialreference.org/ref/user/north-pacific-albers-conic-equal-area/.

    比如 http://spatialreference.org/ref/user/north-pacific-albers-conic-equal-area/ 。

  • filename

    文件名

    File containing WKT, PROJ.4 strings, or XML/GML coordinate system definitions can be provided.

    可以提供包含 WKT、 PROJ. 4字符串或 xml / gml 坐标系定义的文件。

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!