007] How to Perform Accurate Viewshed Analysis with 3D Building Obstructions in Global Mapper

Learn how to incorporate 3D building data into visibility calculations for realistic urban line-of-sight mapping.

This tutorial covers the essential workflow for preparing vector building data, calculating floor-based heights using attribute math, and configuring the Viewshed tool to recognize buildings as physical obstructions on top of a terrain model.

Introduction to 3D Building Viewshed Analysis

🎥 Video Tutorial: Viewshed Analysis with 3D Buildings

For a clearer understanding, check out the video tutorial below. It walks you through the entire process—from calculating building heights using attribute data to generating an accurate Line of Sight (Viewshed) map with urban obstructions. Follow along with the video to master this advanced technique!

Video walkthrough of Viewshed Analysis with 3D Building Obstructions

To follow along, please open the Workspace we worked on in the previous session and add the following file to your layers. Simply download the file and drag it into the Global Mapper workspace.

Attachment: Cur_BD.zip (Verified and safe file for Global Mapper.)

Once the file is loaded, the building footprints will appear on the map as shown below.

Buildings displayed on the Global Mapper main screen over the terrain
img 1 : Buildings displayed on the Global Mapper main screen over the terrain

Preparing Building Vector Data for Viewshed Analysis

In order to include vector data in a viewshed analysis, the vector features must possess a height value assigned to an attribute named "height".

When you download continuous digital maps or NGI maps from national geographic information portals, you can usually obtain SHP files that include the number of floors for each building.

To estimate building heights, we can multiply the floor count attribute by 3 meters per floor.

First, let's identify which attribute contains the floor count in our Cur_BD layer. For clarity, turn off all other layers except for the DEM (Digital Elevation Model).

Control Center showing the building SHP layer selected among other layers
img 2 : Control Center showing the building SHP layer selected among other layers

Finding the Building Floor Count Attribute

Let's check the information for a specific building. Select the Digitizer Tool icon, then double-click a building on the main screen to view its attributes.

In the continuous digital topographic maps downloaded from the Korean National Information Map service, the NMLY attribute typically represents the floor count information.

The Modify Feature Info window showing the NMLY attribute indicating the floor count
img 3 : The Modify Feature Info window showing the NMLY attribute indicating the floor count

Creating the Height Attribute for Buildings

Now that we know NMLY holds the floor count, we need to create a new attribute called height and populate it with the value of $NMLY \times 3$.

Go to the top menu bar and select Layer -> Calculate/Copy Attribute Value(s). As the name suggests, this menu is used for copying or performing calculations on attribute values.

Accessing the Calculate/Copy Attribute Value(s) option in the Layer menu
img 4 : Accessing the Calculate/Copy Attribute Value(s) option in the Layer menu

After selecting the menu, a window will appear to choose the target layer. Since we are performing the calculation on the buildings in Cur_BD, select Cur_BD.shp and click OK.

Selecting the building SHP layer in the Select Layers dialog
img 5 : Selecting the building SHP layer in the Select Layers dialog

Setting Up Building Height Calculations

The Attribute Calculation Setup window will appear. Configure it as follows:

Configuring the Attribute Calculation Setup window with the height formula
img 6 : Configuring the Attribute Calculation Setup window with the height formula
  • Attribute to Assign: Type height
  • Source Attribute: Select NMLY
  • Operation: Select Multiply
  • Use Fixed Value: Enter 3

This configuration instructs Global Mapper to: "Create a 'height' attribute and fill it with the value of NMLY multiplied by 3."

Note: By selecting "Use Formula Calculation," you can perform even more complex operations using conditional expressions. Click OK after entering the values.


Verifying the Results

Once the calculation is complete, a confirmation window will appear.

Notification window stating that attributes for 11,344 features have been modified
img 7 : Notification window stating that attributes for 11,344 features have been modified

Click "OK" and then "Close" on the Attribute Calculation Setup window. If you double-click a building again to check its info, you will see that the height attribute and its calculated value have been successfully added.

Modified Feature Info window showing the newly added 'height' attribute
img 8 : Modified Feature Info window showing the newly added 'height' attribute

Running Viewshed Analysis with 3D Building Obstructions

Now that both the DEM and the building data with height values are ready, let's perform the Viewshed Analysis.

Select the Create Viewshed tool from the icon toolbar and click near the area indicated at the bottom of the screen.

Selecting the Create Viewshed tool and designating the observer location on the map
img 9 : Selecting the Create Viewshed tool and designating the observer location on the map
Configuring Viewshed Setup parameters including Vector Obstruction settings
img 10 : Configuring Viewshed Setup parameters including Vector Obstruction settings

Configuring Viewshed Parameters

The Viewshed Setup window will open. Enter the following parameters:

  • Layer Name: Viewshed Analysis
  • Transmitter (Observer) Elevation: 1.6m above Ground
  • Receiver Elevation: 0m above Ground
  • View Angle: Start Angle 270 (West), Swept Angle 90 (Counter-clockwise)
  • View Radius: 5km
  • Sample Spacing: 10x10m
  • Obstructions from Vector Data: Check "Use Vector Features with Heights" and ensure Cur_BD.shp is selected.

Click OK, and the result will appear as follows.

Result of the Viewshed Analysis including buildings as obstructions
img 11 : Result of the Viewshed Analysis including buildings as obstructions

Comparing Terrain-Only and Building-Based Viewshed Results

Currently, it might be difficult to distinguish the visible areas clearly because the building layer is still on. Let's turn off the building layer to see the results better.

Viewshed result displayed only over the terrain model
img 12 : Viewshed result displayed only over the terrain model

Now, let's compare this with an analysis that only considers the terrain. Select the newly created Viewshed layer, right-click, and choose Edit Viewshed Parameters and Recalculate.

Selecting the option to edit and recalculate the viewshed
img 13 : Selecting the option to edit and recalculate the viewshed

The Viewshed Setup window will reappear. Since we have hidden the vector layers, the "Use Vector Features with Heights" section will be empty or disabled. Just click OK to run the analysis based on terrain only.

Recalculated viewshed result based solely on terrain without building obstructions
img 14 : Recalculated viewshed result based solely on terrain without building obstructions

Why Building Obstructions Matter in Viewshed Analysis

Terrain-only visibility analysis can significantly overestimate visible areas in dense urban environments. By incorporating 3D building data, planners and GIS analysts can produce more realistic visibility studies for urban planning, telecommunications, security assessments, and environmental impact analysis.

Conclusion

This is the process of conducting a Viewshed Analysis in Global Mapper that incorporates building data as obstructions. Documenting each step with screenshots takes more time than expected — I started right after lunch and two hours have already flown by!

That's all for today. I hope this workflow helps you create more realistic urban visibility analyses in Global Mapper.

Continue Learning
Explore complete tutorial collections for CityEngine and Global Mapper.

Comments

Popular posts from this blog

029] How to Split Polygon Areas with Intersecting Lines in Global Mapper

[008] How to Understand CGA Rule Structure in CityEngine (Beginner Guide)

046] How to Create Parallel Offset Lines in Global Mapper