TPKExportSettings

Tile Package Export Settings.

@example:
# settings class to export the terrain as a TPK file. Note that the user may be prompted for
# a coordinate system for the scene if none is set.
ce.setSceneCoordSystem("EPSG:26954")
terrain = ce.getObjectsFrom(ce.scene, ce.withName("'Heightmap'"))[0]
exportSettings = TPKExportSettings()
exportSettings.setOutputPath(ce.toFSPath(EXPORT_PATH))
exportSettings.setBaseName("terrainImage")
exportSettings.setMaps("ELEVATION")
ce.export(terrain, exportSettings)

 

此处定义的方法如下:

getBaseName

getBaseName(self):

Gets the base name for the tile package files.

@return: The base name for the tile package files. [str]

@example:
exportSettings = TPKExportSettings()
print exportSettings.getBaseName()

getMaps

getMaps(self):

Gets the enabled maps.

@return: A string containing the curently set map type. Possible values are [ BASEMAP_AND_ELEVATION, BASEMAP, ELEVATION ]. [str]

@example:
exportSettings = TPKExportSettings()
print exportSettings.getMaps()

getOutputPath

getOutputPath(self):

Gets the folder path for the tile package files.

@return: The absolute system path to the folder for the tile package files. [str]

@example:
exportSettings = TPKExportSettings()
print exportSettings.getOutputPath()

getOverwrite

getOverwrite(self):

Gets the state of the overwrite option.

@return: True or False. [True/False]

@example:
exportSettings = TPKExportSettings()
print exportSettings.getOverwrite()

getSceneType

getSceneType(self):

Gets the set scene type.

@return: A string containing the curently set scene type. Possible values are [ GLOBAL, LOCAL ]. [str]

@example:
exportSettings = TPKExportSettings()
print exportSettings.getSceneType()

getVerticalOffset

getVerticalOffset(self):

Gets how much the terrain should be offset vertically for the export.

@return: The vertical offset value. [float]

setBaseName

setBaseName(self, baseName):

Sets the base name for the tile package files.

@param baseName: The base name of the tile package files.  [str]

@example:
exportSettings = TPKExportSettings()
exportSettings.setBaseName("terrainImage")

setMaps

setMaps(self, maps):

Sets which maps should be written.

@param maps: String which defines what maps are written. Possible values are [ BASEMAP_AND_ELEVATION, BASEMAP, ELEVATION ]. Defualt is BASEMAP_AND_ELEVATION.  [str]

@example:
exportSettings = TPKExportSettings()
exportSettings.setMaps("BASEMAP_AND_ELEVATION")

setOutputPath

setOutputPath(self, outputPath):

Sets the folder path for the tile package files.

@param outputPath: The absolute system path to the folder which will contain the tile package files.  [str]

@example:
exportSettings = TPKExportSettings()
exportSettings.setOutputPath(ce.toFSPath("/python/maps"))

setOverwrite

setOverwrite(self, overwrite):

Sets whether extisting files should be overwritten.

@param overwrite: True = overwrite existing files, False = don't. Default = True.  [True/False]

@example:
exportSettings = TPKExportSettings()
exportSettings.setOverwrite(False)

setSceneType

setSceneType(self, sceneType):

Sets in what scene environment the files should be written.

@param sceneType: String which defines whether a global or a local scene is written. Possible values are [ GLOBAL, LOCAL ]. Default is GLOBAL.  [str]

@example:
exportSettings = TPKExportSettings()
exportSettings.setSceneType("LOCAL")

setVerticalOffset

setVerticalOffset(self, verticalOffset):

Sets how much the terrain should be offset vertically for the export.

@param verticalOffset: How much the terrain should be offset vertically for the export.  [float]