image export terrain settings.
@example:
# settings class to export the terrain as an image file. Note that the user may be prompted for
# a coordinate system for the scene if one is not already set.
ce.setSceneCoordSystem("EPSG:26954")
terrain = ce.getObjectsFrom(ce.scene, ce.withName("'Heightmap'"))[0]
exportSettings = ImageExportTerrainSettings()
exportSettings.setFilename(ce.toFSPath("/python/scripts/apidoctest/exports/terrain/images/terrainImage.png"))
ce.export(terrain, exportSettings)
此处定义的方法如下:
getResolution
getResolution(self):
Gets the resolution with which to export the image file.
@return: An array with exactly two integer values: [width, height]. -1 if hightest dimension of selected terrains will be used. [sequence of int]
@example:
exportSettings = ImageExportTerrainSettings()
resolution = exportSettings.getResolution()
print "Original Resolution" if resolution == [-1, -1] else "Resolution: " + str(resolution)
# Prints 'Original Resolution'
set16Bit
set16Bit(self, bit16):
Sets whether the exporter should attempt to write a 16 bit image.
@param bit16: Sets whether the exporter should attempt to write a 16 bit image. [True/False]
setFilename
setFilename(self, filename):
Sets the absolute path of the output image file.
@param filename: The absolute path of the output image file . [str]
setFloat
setFloat(self, bitFloat):
Sets whether the exporter should attempt to write a 32 bit float image.
@param bitFloat: Sets whether the exporter should attempt to write a 32 bit float image. [True/False]
setGeoTiff
setGeoTiff(self, geoTiff):
Sets whether the exporter should attempt to add geotiff metadata to the image.
@param geoTiff: Sets whether the exporter should attempt to add geotiff metadata to the image. [True/False]
setResolution
setResolution(self, resolution):
Sets the resolution with which to export the image file.
@param resolution: Controls the resolution of the image file: [width, height]. Use -1 to use highest dimension of selected terrains. [sequence of int]
@example:
exportSettings = ImageExportTerrainSettings()
exportSettings.setResolution([1024, 2048])
resolution = exportSettings.getResolution()
print "Original Resolution" if resolution == [-1, -1] else "Resolution: " + str(resolution)
# Prints 'Resolution: [1024, 2038]'