ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

ExportToSeparatedTIFF

获得 Production Mapping 许可后可用。

  • 描述
  • 讨论
  • 语法
  • 代码示例

描述

Exports the page layout or data frame of an .mxd to separate Tagged Image File Format (TIFF) files based on color mapping settings.

讨论

TIFF files are the most versatile raster format. TIFFs can store pixel data at several bit depths and can be compressed with either lossy or lossless compression techniques depending on file size and accuracy requirements.

Maps can be exported to 1-bit TIFF format, color-separated files based on the unique list of colors defined in symbols that appear in the data frame and page layout.

The defined colors and their parameters can be set up and exported to an ECT file. This ECT file can then be loaded by any system using the TIFF Color Separator. In this way, a color definition file can be set up for different production workflows. This color file can then be distributed for use during the color separation process. Tools for loading and saving color files help with this process.

要导出单个数据框(而不是整个页面布局),可将 DataFrame 对象传给函数的 data_frame 参数。由于数据框导出不具有可提供高度和宽度信息的关联页面,所以必须通过 df_export_width 和 df_export_height 参数来提供此信息。

对于页面布局导出和数据框导出,控制生成图像图形质量的方式有所不同。导出页面布局时,通过更改 resolution 参数来控制图像细节。导出数据框时,保持 resolution 参数的默认值,更改 df_export_width 和 df_export_height 参数来更改图像细节。高度和宽度参数直接控制在导出文件中生成的像素数,且仅在导出数据框时使用。像素数较高的图像具有较高的图像细节。对于大多数页面布局导出,默认参数值应在第一次尝试时生成良好的结果和美观的导出图像。对于数据框导出,您可能需要对 df_export_width 和 df_export_height 值进行若干次试验,之后才能得到理想的结果。

Refer to Exporting to Separated TIFF in ArcGIS Desktop help for more detailed discussions on exporting maps.

注:

File sizes can differ when map documents are exported using arcpyproduction.mapping instead of the ArcMap commands. This is due to the differences in the functions in the Python module versus the commands in ArcMap.

语法

ExportToSeparatedTIFF (map_document, out_tiff_path, settings_file, {file_format}, {compression}, {invert_plates}, {data_frame}, {df_export_width}, {df_export_height}, {resolution}, {world_file}, {root_filename})
参数说明数据类型
map_document

A variable that references a MapDocument object.

MapDocument
out_tiff_path

A string that represents the path to the directory where the separated TIFF files will be created.

String
settings_file

The path to an Esri Color Table (ECT) file that contains the color mapping settings to be used when the TIFF is generated.

String
file_format

Indicates the format in which the color files are exported.

  • COMPOSITE_TRUE_COLOR —Exports the image without color mappings.
  • EIGHT_BIT_SEPARATES —Exports the image using 8-bit color separates, where one color mapping is created for colors based on similar RGB values. White is excluded from the mappings.
  • ONE_BIT_SEPARATES —Exports the image using 1-bit color separates, where one color mapping is created for each color in the map. This is the default value.

(默认值为 ONE_BIT_SEPARATES)

String
compression

Indicates what compression method is used to encode the image.

  • NONE —No compression is applied.
  • PACKBITS —The PackBits compression, which is supported for one-bit and eight-bit separates.
  • CCITT_GROUP_4_FAX —A compression that is only valid for one-bit separates. This is the default value.

(默认值为 CCITT_GROUP_4_FAX)

String
invert_plates

Indicates whether the output values are toggled between positive and negative values for the exported TIFF files. This is only supported with one-bit and eight-bit separates.

(默认值为 False)

Boolean
data_frame

A variable that references a DataFrame object. Use the string/constant PAGE_LAYOUT to export the map document's page layout instead of an individual data frame.

注:

This parameter is required if you define the world_file parameter.

(默认值为 PAGE_LAYOUT)

DataFrame
df_export_width

A number that defines the width of the export image in pixels for a data frame export; df_export_width is only used when exporting a data frame. Exporting a page layout uses the map document page width instead of df_export_width.

(默认值为 640)

Integer
df_export_height

A number that defines the width of the export image in pixels for a data frame export; df_export_width is only used when exporting a data frame. Exporting a page layout uses the map document page width instead of df_export_width.

(默认值为 480)

Integer
resolution

A number that defines the resolution of the export file in DPI (dots per inch).

(默认值为 96)

Integer
world_file

If set to True, a georeferenced world file is created. The file contains pixel scale information and real-world coordinate information.

(默认值为 False)

Boolean
root_filename

The root file name for each TIFF. The TIFF file name includes the RGB information for the color and can be modified to include the map name, for example, SoCal_UTM_Map_RGB_0_0_0.

If no file name is defined, the color is exported as RGB_X_X_X, where X is the red, green, or blue value for the color.

(默认值为 None)

String

代码示例

ExportToSeparatedTIFF example 1

This script exports a map to a separated TIFF using the required parameters and default settings for the optional parameters.

import arcpy
import arcpyproduction

# Check out Production Mapping extension
arcpy.CheckOutExtension("foundation")

# Define variables
mxd = arcpy.mapping.MapDocument(r"C:\Project\MXDs\Project.mxd")
out = r"C:\Project\sep_TIFFs"
settings = r"C:\Project\ect\all_colors.ect"

# Run ExportToSeparatedTIFF with only required parameters
arcpyproduction.mapping.ExportToSeparatedTIFF(mxd, out, settings)

# Check in extension
arcpy.CheckInExtension('foundation')
ExportToSeparatedTIFF example 2

This script exports the same map twice using different settings files. Visibility is set to False for two layers before export.

import os
import arcpy
import arcpyproduction

# Check out Production Mapping license
arcpy.CheckOutExtension("foundation")

# Define variables
mxd = arcpy.mapping.MapDocument(r"C:\Project\MXDs\Project.mxd")
out = r"C:\Project\tiffs"
settings = [r"C:\Project\ect\TopoMap.ect", r"C:\Project\ect\USGS.ect"]
df = arcpy.mapping.ListDataFrames(mxd)[0]

# Change visibility of layers
for lyr in arcpy.mapping.ListLayers(mxd, "", df):
    if lyr.name.lower() in ["contourl" or "openwatera"]:
        lyr.visible = False

# Loop through settings files and export map
for i in range(len(settings)):
    project_name = os.path.basename(settings[i]).split(".")[0]
    arcpyproduction.mapping.ExportToSeparatedTIFF(
         mxd, out, settings[i], root_filename="project_{0}".format(project_name))

# Check in extension
arcpy.CheckInExtension('foundation')

相关主题

  • Exporting to Separated TIFF
  • Introduction to arcpyproduction.mapping

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • Esri 博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2021 Esri. | 隐私政策 | 法律声明