[007] How to Perform Viewshed Analysis in CityEngine
In this tutorial, you will learn how to use the built-in Viewshed Creation tool in CityEngine. We will move beyond traditional 2D line-of-sight mapping to perform highly accurate 3D visibility analysis, taking into account terrain, building heights, and precise camera angles.
In landscape review reports or environmental impact assessments, viewshed analysis is a methodology you will frequently encounter.
Originally used in telecommunications to identify radio wave shadow areas, it has been widely adopted in landscape architecture to evaluate changes in visual obstruction before and after a construction project.
Let's look at a common visual example of how viewshed analysis is typically presented.
This is a viewshed analysis conducted from position 1, where the red areas indicate the regions that are visible from that specific point.
While this particular image includes both terrain and buildings in the analysis, traditionally, most of these analyses rely solely on terrain (elevation) data.
If you perform a viewshed analysis using only terrain data, the result might falsely show the target site as perfectly visible, even if a 10-story building is completely blocking the view right in front of the observer.
Furthermore, even if existing buildings are somehow factored into a 2D analysis, it is impossible to determine exactly from which floor a specific building becomes visible.
Step 1: Setting Up the Scene
Launch CityEngine.
Today, we will not create a new scene. Instead, please load the scene you saved from our previous lecture: [002-003] How to Create Terrain and Align 3D Buildings in Esri CityEngine.
Have you loaded the scene?
From the top toolbar, select Visibility tools -> Viewshed creation.
Step 2: Creating the Viewshed
Imagine looking from your viewpoint toward the main target or project site. Click on position 1 (the observer point), and then click on position 2 (the target direction).
Simple, right? The viewshed analysis is complete.
The green areas represent the visible parts, while the red areas represent the obstructed (hidden) parts. (You can also change these colors later).
What do you think of this 3D approach to viewshed analysis?
While traditional 2D viewshed analysis was limited to analyzing visible and hidden areas on a flat plane, 3D viewshed analysis can distinguish visible areas right down to the actual building facades.
Step 3: Refining Camera Parameters
Now, let's refine this a bit more to simulate real-world conditions.
Viewpoint photographs are typically taken using a standard angle of view (a horizontal field of view of roughly 39.6 degrees), which corresponds to a 50mm focal length on a full-frame camera, at an average human eye level of 1.6 meters.
(Yes, that's correct. It is perfectly fine to adjust the angle of view depending on the scale of the project site and the specific conditions of the viewpoint.)
Anyway, for now, we will adjust the settings to match this standard angle of view.
In the Scene panel, select the Viewshed 1 object you just created.
Let's take a look at the Inspector panel.
Change the Horizontal Angle of View to 39.6, and add 1.6 to the Observer Point Y value.
The reason we add 1.6 to the Observer Point Y value is that your initial mouse click snaps directly to the ground level.
After making these adjustments, you can appropriately change the composition in the 3D View, capture the screen, and insert it directly into your report.
It is distinctly different from 2D analysis, isn't it?
Step 4: Analyzing Multiple Viewsheds (Overlaps and Blind Spots)
You can also create multiple viewsheds to identify overlapping areas.
Where would this be used?
By synthesizing the field of view of CCTV cameras planned for installation in various locations, you can easily pinpoint blind spots in security coverage.
Try installing a couple more virtual cameras in the scene and follow the steps below. (Each Viewshed must be located within the same Analyses layer.)
Select the main Analyses layer in the Scene panel. In the Inspector window, change the color for Visible by multiple. The overlapping visible areas will then be displayed in yellow.
The blind spots will remain highlighted in red.
It is a remarkably simple task that finishes with just a couple of mouse clicks.
We will conclude the functional viewshed analysis tutorial here.
Analyses parent folder
in the Scene panel. If they are separated, CityEngine cannot calculate their
intersections for the 'Visible by multiple' feature.
Bonus: A Tip for Real-World Viewpoint Photography
Ah, here is a practical tip for taking viewpoint photographs on site.
There are common mistakes people make when capturing viewpoints in the field.
You might have experienced trying to composite a real photo back at the office, only to find the project site falls outside the horizontal field of view. Or, when dealing with a tall building, an incorrect tilt angle leaves the top or bottom floors completely cut out of the frame.
To prevent this, you might have experienced turning yourself into a human panoramic tripod on site, snapping dozens of unnecessary photos just in case.
If you create a camera in CityEngine using this Viewshed information as a reference, and take that camera snapshot image with you to the site as a guide, you can always capture accurate, perfectly aligned photographs the first time.
Conclusion and Next Steps
To take a break from the heavy theory, we covered one of CityEngine's built-in, out-of-the-box features today.
Our next lecture will return to CGA.
[008] will be about understanding the framework of CGA code.
Don't worry. We are still a long way from actual, intensive coding.
It's just about grasping the outline, understanding 'Ah, so this is the general flow of how coding works.'
- To understand the fundamental differences between traditional 3D modeling and rule-based hierarchies, see [006] Understanding the Basic Concepts of Procedural Modeling in CityEngine
- To get a broad look at how rules are structured before writing them, see [008] Quick Overview of CGA Rule Structure
- To learn the fundamentals of procedural modeling and 3D terrain alignment in CityEngine, see [003] How to Create Terrain and Align 3D Buildings in Esri CityEngine
- To automatically generate accurate camera viewpoints from viewshed data, see [115] How to Create Bookmarks from Viewshed Analysis in CityEngine
- To automate time-lapse snapshot exports for dynamic sunlight and shadow analysis, see [137] How to Automate Solar Shadow Simulations in CityEngine
- To automatically generate complex camera viewsheds from imported CSV coordinates, see [141] How to Automate Viewsheds from CSV in CityEngine
If you have any questions, please leave a comment. Let's solve them together!
[A Quiet Thought]
"The real voyage of discovery consists not in seeking new landscapes, but in having new eyes."
A viewshed analysis in CityEngine gives us precisely these 'new eyes.' By calculating exact lines of sight, it removes human guesswork and reveals the hidden visual impact of our designs. Whether we are assessing the environmental footprint of a new skyscraper or positioning a security camera to eliminate blind spots, shifting our perspective through hard spatial data ensures our digital cities serve their true, intended purpose.
May you continually find new ways to view the world you are building.
Comments
Post a Comment
Feel free to leave a comment if you have any questions about Global Mapper or CityEngine. I will get back to you with a sincere response as soon as possible. (Please note that all comments are moderated and manually approved to maintain a high-quality community. Promotional or spam content will not be published.)