JPEGFormat
Zusammenfassung
The JPEGFormat object represents a collection of Joint Photographic Experts Group (JPEG) file properties that can be configured and used with the export method on the Layout, MapFrame, MapView, MapSeries and BookmarkMapSeries objects to create an output JPG file.
Diskussion
JPEG files are compressed image files. They support 24-bit color and have been a popular choice for use on the web because JPEG file size is often substantially smaller than many other image formats. However, the JPEG compression algorithm is lossy and is not recommended for many map images, as line drawings and text or iconic graphics become blurred by compression artifacts. Thus, PNG is usually a superior format for map images. JPEGs can be generated with an accompanying world file for use as georeferenced raster data.
The createExportFormat method can be used to create a JPEGFormat object if the format parameter is set to JPEG. The returned JPEGFormat object contains all the properties associated with a generating a JPEG file. These properties can be modified accordingly to produce different output results.
Eigenschaften
| Name | Erläuterung | Datentyp |
|---|---|---|
|
clipToElements (Lesen und schreiben) |
If set to |
Boolean |
|
colorMode (Lesen und schreiben) |
A string constant that represents the number of bits to describe color in a pixel. The default value is
|
String |
|
filePath (Lesen und schreiben) |
A string that represents the system path and file name, including the extension, for the exported file. |
String |
|
geoReferenceMapFrame (Lesen und schreiben) |
The MapFrame used to control the coordinate system when the |
MapFrame |
|
height (Lesen und schreiben) |
The height, in pixels, of the map area to be exported. This property only applies when exporting a |
Double |
|
imageCompressionQuality (Lesen und schreiben) |
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 |
Integer |
|
resolution (Lesen und schreiben) |
The effective dpi of the output vector data. The default value is 96. Hinweis:When exporting a |
Integer |
|
showSelectionSymbology (Lesen und schreiben) |
Show selected features in the map or map frame as selected in the output file. Setting this value to |
Boolean |
|
width (Lesen und schreiben) |
The width, in pixels, of the map area to be exported. This property only applies when exporting a |
Double |
|
worldFile (Lesen und schreiben) |
If set to |
Boolean |
Methoden
setColorMode(color_mode)
A string constant that represents the number of bits to describe color in a pixel.
| Name | Erläuterung | Datentyp |
|---|---|---|
|
color_mode |
Below is a list of valid strings.
|
String |
Codebeispiel
The following script exports a layout to JPEG format using default property values.
p = arcpy.mp.ArcGISProject('current')
lyt = p.listLayouts()[0]
jpg = arcpy.mp.CreateExportFormat('JPEG', r'C:\Temp\Output.jpg')
lyt.export(jpg)