Commit db4cb66
authored
Add visibility analysis tutorial (r.viewshed) (#135)
* Add visibility analysis tutorial using r.viewshed
New intermediate tutorial covering viewshed/visibility analysis:
- a single-observer viewshed and measuring the visible area
- the effect of observer height (ground vs 40 m tower) and max_distance
- cumulative visibility from multiple sites with r.series
Uses the North Carolina sample dataset and the grass.tools API (GRASS 8.5).
Categories: raster, terrain, visualization, intermediate, Python.
* Rework viewshed tutorial around Nantahala fire lookout towers
Address review feedback: replace the synthetic center-of-map observer
with a real story. The tutorial now uses three historic fire lookout
towers in the Nantahala National Forest (Wayah Bald, Wesser Bald,
Albert Mountain, verified coordinates on the Appalachian Trail) and
downloads real USGS 1 arc-second elevation via the r.in.usgs addon
into a new EPSG:32617 project, with a pinned tile for reproducibility.
Content changes:
- observer height: standing on the bald vs the 16 m cab (165 vs 277 km2)
- Earth curvature with -c at a lookout's 32 km range, and why the
effect is small in ridge-limited terrain
- target_elevation as a rising smoke column (277 to 412 km2 detectable)
- three-tower network summed with r.series, coverage reported as a
table from r.report JSON output (44% of the region)
- new worked section on siting a fourth tower: the best candidate
recovers under 4% of the blind area because the gaps are valleys
Figures regenerated at 600 px with labeled towers (d.text), shaded
relief bases, non-overlapping legend and scale bar, and zoomed extents
for the single-tower maps. Get-started link now points to the Python
quick start; callouts are spread out; area estimation commands are
shown in the text.
* Address review: Tools API, r.report areas, clearer figures
- create the project in Python with create_project() and install the
add-on with g.extension, instead of a shell block
- read the tower coordinates (and the candidate site) with StringIO so
v.in.ascii runs through the Tools API
- report visible areas with r.report instead of a custom helper
- redraw the figures: tower labels shifted clear of the markers,
larger legends, smaller file sizes
- wording fixes from the review; comment the integer coverage step
The NED tile stays pinned with title_filter for reproducible numbers;
the download note explains how to drop it to fetch the current data.
* Use default current NED release instead of pinning a vintage
Per review: drop ned_release=all and title_filter and let r.in.usgs
fetch the current 1 arc-second tile (the default). For this footprint
the current tile is identical to the previously pinned one, so all
figures and reported areas are unchanged; the download note now says
the numbers may shift slightly if USGS republishes the data.
* Address review: use the Tools API throughout
- create the project directly under the home directory
- pass the tower coordinates as comma-separated values
- read tabular output with .text and JSON results by subscripting the
ToolResult (v_db_select/r_report/r_stats with format="json")
- set color rules with tools.r_colors and a StringIO buffer instead of
gs.write_command, and read the region with tools.g_region().keyval1 parent 914e98b commit db4cb66
7 files changed
Lines changed: 429 additions & 0 deletions
File tree
- content/tutorials/viewshed
- images
Loading
Loading
Loading
Large diffs are not rendered by default.
0 commit comments