根据自定义输入类型添加图像 (定向影像)

摘要

可根据自定义输入类型定义的输入数据将图像添加至定向影像数据集。

使用情况

  • 该工具将使用在 Python 中实现的自定义输入类型来定义如何将复杂或非标准的元数据和图像添加至定向影像数据集。

    Python 模块必须位于与该模块同名的文件夹中。 将文件夹放置在 [InstallDirectory]\Resources\OrientedImagery\CustomInputTypes 中以列出自定义输入类型参数下拉菜单中的类型。 如果输入类型文件夹位于不同位置,请选择 Folder 选项,并在自定义输入类型文件夹参数中提供文件夹位置。

  • 要自动化数据管理工作流或者经常使用非标准影像并且简化数据管理流,请为数据定义自定义输入类型。 然后,可以使用该工具将图像添加至定向影像数据集。

  • 该工具是将图像添加至定向影像数据集工具的替代工具,该工具将使用定向影像表方案中的影像元数据创建一个 .csv 文件,以将图像添加至定向影像数据集。

参数

标注说明数据类型
定向影像数据集

将在其中添加图像的定向影像数据集的路径和名称。

Oriented Imagery Layer
自定义输入类型

自定义输入类型的名称。

要选择未列出的输入类型,请使用 Folder 选项。 此参数值将激活自定义输入类型文件夹参数。

String
自定义输入类型文件夹

自定义输入类型文件夹的路径。 该文件夹必须包含与该文件夹同名的 Python 模块以及所需的公共函数。

Folder
输入数据

输入数据的名称和路径或值。 所选自定义输入类型将确定可用选项。

Value Table
辅助参数

输入类型方案中定义的任何辅助参数的名称和值。

Value Table

派生输出

标注说明数据类型
输出定向影像数据集

已更新的输出定向影像数据集。

Oriented Imagery Dataset

arcpy.management.AddImagesFromCustomInputType(in_oriented_imagery_dataset, input_type, in_type_folder, in_data, auxiliary_parameters)
名称说明数据类型
in_oriented_imagery_dataset

将在其中添加图像的定向影像数据集的路径和名称。

Oriented Imagery Layer
input_type

自定义输入类型的名称。

如果自定义输入类型文件夹不在 [InstallDirectory]\Resources\OrientedImagery\CustomInputTypes 中,请将参数值指定为 Folder 并在 in_type_folder 参数中提供文件夹路径。

String
in_type_folder

自定义输入类型文件夹的路径。 该文件夹必须包含与该文件夹同名的 Python 模块以及所需的公共函数。

Folder
in_data
[in_data,...]

输入数据的名称和路径或值。 所选自定义输入类型将确定可用选项。

Value Table
auxiliary_parameters
[auxiliary_parameters,...]

输入类型方案中定义的任何辅助参数的名称和值。

Value Table

派生输出

名称说明数据类型
out_oriented_imagery_dataset

已更新的输出定向影像数据集。

Oriented Imagery Dataset

代码示例

AddImagesFromCustomInputType 示例 1(独立脚本)

以下 Python 脚本演示了如何在独立脚本中使用 AddImagesFromCustomInputType 函数。

# Import system modules
import arcpy
import os

arcpy.env.workspace = "C:/OrientedImageryExample"

# Set local variables
fld = r"C:\OrientedImagerySamples"
oi_dataset = "C:\OrientedImageryExample\Sample.gdb\oi_dataset"
in_file = os.path.join(fld, "sampleinput.csv")
in_folder = os.path.join(arcpy.GetInstallInfo()['InstallDir'], 'Resources',
                         'OrientedImagery', 'CustomInputTypes',
                         'SampleInputType')
img_folder = os.path.join(fld, "Images")
img_ext = "mrf"
in_data= f'"CSV File" {in_file};"Image Folder" {img_folder};"Image Extension" {img_ext}'

# Run Add Images From Custom Input Type
arcpy.oi.AddImagesFromCustomInputType(
    oi_dataset, input_type="SampleInputType", in_type_folder="in_folder",
    in_data=in_data)