Skip to content

Commit 4a110da

Browse files
committed
Add visibility module to exports, accessor, docs, and README (#1145)
1 parent 5b8696b commit 4a110da

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@ Same-CRS tiles skip reprojection entirely and are placed by direct coordinate al
316316
| [TRI](xrspatial/terrain_metrics.py) | Computes Terrain Ruggedness Index (local elevation variation) | Riley et al. 1999 | ✅️ | ✅️ | ✅️ | ✅️ |
317317
| [Landforms](xrspatial/terrain_metrics.py) | Classifies terrain into 10 landform types using the Weiss (2001) TPI scheme | Weiss 2001 | ✅️ | ✅️ | ✅️ | ✅️ |
318318
| [Viewshed](xrspatial/viewshed.py) | Determines visible cells from a given observer point on terrain | GRASS GIS r.viewshed | ✅️ | ✅️ | 🔄 | 🔄 |
319+
| [Cumulative Viewshed](xrspatial/visibility.py) | Counts how many observers can see each cell | Custom | ✅️ | 🔄 | 🔄 | 🔄 |
320+
| [Visibility Frequency](xrspatial/visibility.py) | Fraction of observers with line-of-sight to each cell | Custom | ✅️ | 🔄 | 🔄 | 🔄 |
321+
| [Line of Sight](xrspatial/visibility.py) | Elevation profile and visibility along a point-to-point transect | Custom | ✅️ | 🔄 | 🔄 | 🔄 |
319322
| [Min Observable Height](xrspatial/experimental/min_observable_height.py) | Finds the minimum observer height needed to see each cell *(experimental)* | Custom | ✅️ | | | |
320323
| [Perlin Noise](xrspatial/perlin.py) | Generates smooth continuous random noise for procedural textures | Perlin 1985 | ✅️ | ✅️ | ✅️ | ✅️ |
321324
| [Worley Noise](xrspatial/worley.py) | Generates cellular (Voronoi) noise returning distance to the nearest feature point | Worley 1996 | ✅️ | ✅️ | ✅️ | ✅️ |

docs/source/reference/surface.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,27 @@ Viewshed
8181

8282
xrspatial.viewshed.viewshed
8383

84+
Cumulative Viewshed
85+
===================
86+
.. autosummary::
87+
:toctree: _autosummary
88+
89+
xrspatial.visibility.cumulative_viewshed
90+
91+
Visibility Frequency
92+
====================
93+
.. autosummary::
94+
:toctree: _autosummary
95+
96+
xrspatial.visibility.visibility_frequency
97+
98+
Line of Sight
99+
=============
100+
.. autosummary::
101+
:toctree: _autosummary
102+
103+
xrspatial.visibility.line_of_sight
104+
84105
Perlin Noise
85106
============
86107
.. autosummary::

xrspatial/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@
119119
from xrspatial.hydro import twi_d8 # noqa
120120
from xrspatial.polygonize import polygonize # noqa
121121
from xrspatial.viewshed import viewshed # noqa
122+
from xrspatial.visibility import cumulative_viewshed # noqa
123+
from xrspatial.visibility import line_of_sight # noqa
124+
from xrspatial.visibility import visibility_frequency # noqa
122125
from xrspatial.hydro import basin # noqa: unified wrapper
123126
from xrspatial.hydro import basin_d8 # noqa
124127
from xrspatial.hydro import basins # noqa: backward-compat alias

xrspatial/accessor.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,18 @@ def viewshed(self, x, y, **kwargs):
212212
from .viewshed import viewshed
213213
return viewshed(self._obj, x, y, **kwargs)
214214

215+
def cumulative_viewshed(self, observers, **kwargs):
216+
from .visibility import cumulative_viewshed
217+
return cumulative_viewshed(self._obj, observers, **kwargs)
218+
219+
def visibility_frequency(self, observers, **kwargs):
220+
from .visibility import visibility_frequency
221+
return visibility_frequency(self._obj, observers, **kwargs)
222+
223+
def line_of_sight(self, x0, y0, x1, y1, **kwargs):
224+
from .visibility import line_of_sight
225+
return line_of_sight(self._obj, x0, y0, x1, y1, **kwargs)
226+
215227
def min_observable_height(self, x, y, **kwargs):
216228
from .experimental.min_observable_height import min_observable_height
217229
return min_observable_height(self._obj, x, y, **kwargs)

0 commit comments

Comments
 (0)