Synthèse
The ElevationSurface object provides access to the Ground surface layer or a custom surface and its methods and properties.
Discussion
A 2D map or 3D scene can contain only one Ground surface layer but can contain zero, one, or many custom surfaces. Each new local or global scene contains the Ground surface and the WorldElevation3D/Terrain3D elevation service when your active portal is set to ArcGIS Online. Each new map does not include any ground surface by default. To add a ground surface to a map, you can use the Add Elevation Source Layer dialog box. Use elevation surfaces in maps for editing workflows when creating or editing features and you want to set the z-value based on the underlying elevation surface.
An elevation surface can have no sources (representing a zero surface), or it can contain one or many elevation sources that contribute height values to the surface. You can access the elevation source layers in an elevation surface with the listElevationSources method.
Propriétés
Propriété | Explication | Type de données |
name (Lecture et écriture) | Gets and sets the name for the elevation surface. The Ground surface is read-only. | String |
verticalExaggeration (Lecture et écriture) | Gets and sets the vertical exaggeration for the elevation surface. The default is 1.0 for all elevation surfaces and only applies to the elevation surface. This vertical exaggeration does not apply to other layers in the map. Setting this value to a large number may affect performance, as the scene renders with highly exaggerated features. | Double |
Vue d’ensemble des méthodes
Méthode | Explication |
listElevationSources ({wildcard}) |
Returns a Python list of ElevationSource objects that are associated with an ElevationSurface object. |
Méthodes
listElevationSources ({wildcard})
Paramètre | Explication | Type de données |
wildcard | A wildcard is based on the elevation surface name and is not case sensitive. A combination of asterisks (*) and characters can be used to help limit the resulting list. (La valeur par défaut est None) | String |
Type de données | Explication |
List | Returns a Python list of ElevationSurface objects in a map. |
The listElevationSources method returns a list object even if only one elevation surface is returned. Use the appropriate wildcard parameter followed by an index to reference an ElevationSurface object.
There may be multiple layers in a map with the same name. In that case, you may need to use other properties to isolate a specific layer. You can use a layer's properties such as datasource to do this. A best practice is to uniquely name all layers in a map.
Exemple de code
The following script will set a new vertical exaggeration for the Ground elevation surface.
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps('Scene')[0]
for surface in m.listElevationSurfaces():
if surface.name == 'Ground':
surface.verticalExaggeration = 3.0
p.save()
The following script will print the elevation data source in each elevation surface.
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps('Scene')[0]
for surface in m.listElevationSurfaces():
for source in surface.listElevationSources():
print(source.dataSource)
Vous avez un commentaire à formuler concernant cette rubrique ?