Synthèse
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.
Discussion
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.
Propriétés
Propriété | Explication | Type de données |
clipToElements (Lecture et écriture) | 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 (Lecture et écriture) | A string constant that represents the number of bits to describe color in a pixel. The default value is 24-BIT_TRUE_COLOR.
Remarque :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 (Lecture et écriture) |
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. Remarque :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 (Lecture et écriture) | A string that represents the system path and file name, including the extension, for the exported file. | String |
geoReferenceMapFrame (Lecture et écriture) | The MapFrame used to control the coordinate system when the worldFile property is set to True. The default value is None. | MapFrame |
geoTIFFTags (Lecture et écriture) | 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.
Remarque :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 (Lecture et écriture) | 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 (Lecture et écriture) | 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 (Lecture et écriture) | 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 (Lecture et écriture) | The effective dpi of the output vector data. The default value is 96. Remarque :When exporting a MapView, the dpi is calculated automatically using system dpi scaling and therefore this value will be ignored. | Integer |
showSelectionSymbology (Lecture et écriture) | 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 (Lecture et écriture) | 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 (Lecture et écriture) | If set to True, the white page background is set to transparent. The default value is False. | Boolean |
width (Lecture et écriture) | 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 (Lecture et écriture) | 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 |
Vue d’ensemble des méthodes
Méthode | Explication |
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éthodes
setColorMode (color_mode)
Paramètre | Explication | Type de données |
color_mode | Below is a list of valid strings.
Remarque :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)
Paramètre | Explication | Type de données |
image_compression | Below is a list of valid strings.
| String |
Exemple de code
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)
Vous avez un commentaire à formuler concernant cette rubrique ?