HOW TO
Calculating building heights using roof and ground elevation data is an essential task for urban planning, 3D visualization, and infrastructure analysis.
This article describes the workflow to calculate building heights using roof and ground elevation data with Arcade in the ArcGIS Enterprise portal and ArcGIS Online.
var roof = $feature.Roof_Elevation;
var ground = $feature.Ground_Elevation;
if (IsEmpty(roof) || IsEmpty(ground)) {
return null; // Return null if data is missing
}
var height = roof - ground;
if (height < 0) {
return null; // Return null for invalid data
}
return Round(height, 2); // Round to 2 decimal places for precision
The code block below shows the example of the full working script:
var roof = $feature.Roof_Elevation;
var ground = $feature.Ground_Elevation;
if (IsEmpty(roof) || IsEmpty(ground)) {
return null; // Return null if data is missing
}
var height = roof - ground;
if (height < 0) {
return null; // Return null for invalid data
}
return Round(height, 2); // Round to 2 decimal places for precision
The image below shows the calculated building heights in meters using roof and ground elevation data.
Article ID: 000034566
Get help from ArcGIS experts
Download the Esri Support App