Resumen
The TIFFFormat object represents a collection of Tagged Image File Format (TIFF) file properties that can be configured and used with the export method on the Layout, MapFrame, and MapView objects to create an output TIF file.
Debate
TIFF files are the best choice for importing into image editing applications and are also a common GIS raster data format. However, they cannot be natively viewed by a web browser. TIFFs also support georeferencing information in GeoTIFF tags or in a separate world file for use as raster data.
The createExportFormat method can be used to create a TIFFFormat object if the format parameter is set to TIFF. The returned TIFFFormat object contains all the properties associated with a generating a TIFF file. These properties can be modified accordingly to produce different output results.
Propiedades
Propiedad | Explicación | Tipo de datos |
clipToElements (Lectura y escritura) | If set to True, include the areas of the page that have map or layout element content only, rather than exporting the entire page. This property only applies when exporting a Layout object. The default value is False. | Boolean |
colorMode (Lectura y escritura) | A string constant that represents the number of bits to describe color in a pixel. The default value is 24-BIT_TRUE_COLOR.
Nota:The available colorMode values are dependent on the specified color model set in color management properties. The 32-BIT_CMYK_TRUE_COLOR and 40-BIT_CMYK_WITH_ALPHA options are only available if the layout or map has a CMYK color model. Similarly, the 24-BIT_TRUE_COLOR and the 32-BIT_WITH_ALPHA options are only available if the layout or map has a RGB color model. | String |
embedColorProfile (Lectura y escritura) |
Include the color profile set for the map or layout in the exported file. This helps create consistency in colors when the file is viewed on different devices. If the profile is not embedded, or a non-color-managed viewer is used, the colors may be significantly different than what is seen on-screen. The default value is True. Nota:This option is only available when color management is enabled. If color management is not enabled and the colorspace is set to CMYK, the CMYK colorspace is still included in the export. This may cause some colors to appear differently when viewing the exported file. | Boolean |
filePath (Lectura y escritura) | A string that represents the system path and file name, including the extension, for the exported file. | String |
geoReferenceMapFrame (Lectura y escritura) | The MapFrame used to control the coordinate system when the worldFile property is set to True. The default value is None. | MapFrame |
geoTIFFTags (Lectura y escritura) | If set to True and a valid georef_mapframe is set, geoTIFF tags will be embedded in the resulting image based on the map frame's coordinate system. This allows the exported image to be used as raster data in ArcGIS Pro or other GIS applications. The default value is False.
Nota:When exporting a layout, the GeoTIFF information needs to be based on a 2D map associated with the geoReferenceMapFrame property. The geoTIFFTags property is independent from the worldFile property. With GIS-capable software, you can honor the GeoTIFF information or the world file for these exports. | Boolean |
height (Lectura y escritura) | The height, in pixels, of the map area to be exported. This property only applies when exporting a MapView object. The default value is 960. | Double |
imageCompression (Lectura y escritura) | A string constant that represents the compression scheme used to compress image or raster data in the output file. The default value is LZW.
| String |
imageCompressionQuality (Lectura y escritura) | The amount of image compression applied to the export. Low quality has a smaller file size but less clear data; max quality has a larger file size but crisper data. This only applies when certain compression types are used. The default value is 100. | Integer |
resolution (Lectura y escritura) | The effective dpi of the output vector data. The default value is 96. Nota:When exporting a MapView, the dpi is calculated automatically using system dpi scaling and therefore this value will be ignored. | Integer |
showSelectionSymbology (Lectura y escritura) | Show selected features in the map or map frame as selected in the output file. Setting this value to False does not affect selection within the view, only in the output file. The default value is False. | Boolean |
threshold (Lectura y escritura) | Image intensities set above this value will appear white in the output file and all other values will appear black. This property is applied only when the colorMode property is set to 1-BIT_MONOCHROME_THRESHOLD. The default value is 128. | Boolean |
transparentBackground (Lectura y escritura) | If set to True, the white page background is set to transparent. The default value is False. | Boolean |
width (Lectura y escritura) | The width, in pixels, of the map area to be exported. This property only applies when exporting a MapView object. The default value is 960. | Double |
worldFile (Lectura y escritura) | If set to True and a valid georef_mapframe is set, a world file will be generated based on the map frame's coordinate system. The default value is False. | Boolean |
Descripción general del método
Método | Explicación |
setColorMode (color_mode) | A string constant that represents the number of bits used to describe color. |
setImageCompression (image_compression) | A string constant that represents the compression scheme used to compress image or raster data in the output file. |
Métodos
setColorMode (color_mode)
Parámetro | Explicación | Tipo de datos |
color_mode | Below is a list of valid strings.
Nota:The available colorMode values are dependent on the specified color model set in color management properties. | String |
The 32-BIT_CMYK_TRUE_COLOR and 40-BIT_CMYK_WITH_ALPHA options are only available if the layout or map has a CMYK color model. Similarly, the 24-BIT_TRUE_COLOR and the 32-BIT_WITH_ALPHA options are only available if the layout or map has a RGB color model.
setImageCompression (image_compression)
Parámetro | Explicación | Tipo de datos |
image_compression | Below is a list of valid strings.
| String |
Muestra de código
The following script exports a layout to TIFF format using default property values.
p = arcpy.mp.ArcGISProject('current')
lyt = p.listLayouts()[0]
tif = arcpy.mp.CreateExportFormat('TIFF', r'C:\Temp\Output.tif')
lyt.export(tif)