Summary
Updates the z-coordinates of 3D feature vertices using a surface.
Usage
Only features that entirely overlap the input surface will have their vertices updated. Features that do not overlap the surface will be skipped.
Note:
If the z-value obtained for a given vertex is outside of a geodatabase feature's spatial reference z-domain, the vertex's z-value will not be updated. Create a copy of the input features and specify an appropriate z-domain to process the affected features.
Syntax
UpdateFeatureZ(in_features, in_surface, {method}, {status_field})
Parameter | Explanation | Data Type |
in_features | The 3D features whose vertex z-values will be modified. | Feature Layer |
in_surface | The surface that will be used to determine the new z-value for the 3D feature vertices. | LAS Dataset Layer; Mosaic Layer; Raster Layer; TIN Layer |
method (Optional) | Interpolation method used in determining information about the surface. The available options depend on the data type of the input surface:
| String |
status_field (Optional) | An existing numeric field that will be populated with values to reflect whether the feature's vertices were successfully updated. A value of 1 would be specified for updated features and 0 for features that were not updated. Features that partially overlap the surface will not be updated. | Field |
Derived Output
Name | Explanation | Data Type |
out_feature_class | The updated 3D features whose vertex z-values have been modified. | Feature Layer |
Code sample
The following sample demonstrates the use of this tool in the Python window.
arcpy.env.workspace = 'C:/data'
arcpy.UpdateFeatureZ_3d('lines_3d.shp', 'dsm.tif', status_field='Updated')
The following sample demonstrates the use of this tool in a stand-alone Python script.
'''****************************************************************************
Name: Update Antenna Positions
Description: Updates antenna positions based on elevations from a surface.
****************************************************************************'''
# Import system modules
import arcpy
in_fc = arcpy.GetParameterAsText(1) # pt features representing antenna locations
surface = arcpy.GetParameterAsText(2) # surface used to modify feature Z values
try:
if arcpy.Describe(surface).dataType in ('Raster', 'RasterLayer'):
method = 'BILINEAR'
else:
method = 'CONFLATE_ZMAX'
arcpy.ddd.UpdateFeatureZ(in_fc, surface, method)
except arcpy.ExecuteError:
print(arcpy.GetMessages())
Environments
Licensing information
- Basic: Requires 3D Analyst
- Standard: Requires 3D Analyst
- Advanced: Requires 3D Analyst