Доступно с лицензией 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.
Синтаксис
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.
(Значение по умолчанию — ONE_BIT_SEPARATES) | String |
compression | Indicates what compression method is used to encode the image.
(Значение по умолчанию — 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. (Значение по умолчанию — 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')