Packages

object R2Viewshed extends Serializable

An implementation of the R2 [1] Viewshed algorithm.

1. Franklin, Wm Randolph, and Clark Ray. "Higher isn’t necessarily better: Visibility algorithms and experiments." Advances in GIS research: sixth international symposium on spatial data handling. Vol. 2. Taylor & Francis Edinburgh, 1994.

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. R2Viewshed
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed trait AggregationOperator extends AnyRef
  2. type Bundle = Map[From, ArrayBuffer[Ray]]
  3. sealed case class DirectedSegment(x0: Int, y0: Int, x1: Int, y1: Int, theta: Double) extends Product with Serializable
  4. sealed trait From extends AnyRef
  5. sealed case class Ray(theta: Double, alpha: Double) extends Product with Serializable
  6. type TileCallback = (Bundle) ⇒ Unit

Value Members

  1. def apply(elevationTile: Tile, startCol: Int, startRow: Int, op: AggregationOperator = Or, scatter: Boolean = false): Tile

    Compute the viewshed of the tile using the R2 algorithm.

    Compute the viewshed of the tile using the R2 algorithm. Makes use of the compute method of this object.

    elevationTile

    Elevations in units of meters

    startCol

    The x position of the vantage point

    startRow

    The y position of the vantage point

    op

    The aggregation operator to use (e.g. Or)

    scatter

    Whether to allow light to move (one pixel) normal to the ray

  2. def compute(elevationTile: Tile, viewshedTile: MutableArrayTile, startCol: Int, startRow: Int, viewHeight: Double, from: From, rays: Array[Ray], tileCallback: TileCallback, resolution: Double, maxDistance: Double, curvature: Boolean, operator: AggregationOperator, altitude: Double = Double.NegativeInfinity, cameraDirection: Double = 0, cameraFOV: Double = -1.0, epsilon: Double = 1/math.Pi, scatter: Boolean = true): Tile

    Compute the viewshed of the elevatonTile using the R2 algorithm from [1].

    Compute the viewshed of the elevatonTile using the R2 algorithm from [1]. The numbers in the elevationTile are assumed to be elevations in units of meters. The results are written into the viewshedTile.

    1. Franklin, Wm Randolph, and Clark Ray. "Higher isn’t necessarily better: Visibility algorithms and experiments." Advances in GIS research: sixth international symposium on spatial data handling. Vol. 2. Taylor & Francis Edinburgh, 1994.

    elevationTile

    Elevations in units of meters

    viewshedTile

    The tile into which the viewshed will be written

    startCol

    The x position of the vantage point

    startRow

    The y position of the vantage point

    viewHeight

    The absolute height (above sea level) of the vantage point

    from

    The direction from which the rays are allowed to come

    rays

    Rays shining in from other tiles

    tileCallback

    A callback to communicate rays which have reached the periphery of the tile

    resolution

    The resolution of the elevationTile in units of meters/pixel

    maxDistance

    The maximum distance that any ray is allowed to travel

    curvature

    Whether to account for the Earth's curvature or not

    operator

    The aggregation operator to use

    altitude

    The absolute altitude (above sea level) to query; if -∞, use the terrain height

    cameraDirection

    The direction (in radians) of the camera

    cameraFOV

    The camera field of view, rays whose dot product with the camera direction are less than this are filtered out

    epsilon

    Any ray within this many radians of vertical (horizontal) will be considered vertical (horizontal)

    scatter

    Whether to allow light to move (one pixel) normal to the ray

  3. def generateEmptyViewshedTile(cols: Int, rows: Int, debug: Int = 0): MutableArrayTile

    Generate an empty viewshed tile.

    Generate an empty viewshed tile.

    cols

    The number of columns

    rows

    The number of rows

  4. def nop(b: Bundle): Unit
  5. object And extends AggregationOperator with Product with Serializable
  6. object Debug extends AggregationOperator with Product with Serializable
  7. object FromEast extends From with Product with Serializable
  8. object FromInside extends From with Product with Serializable
  9. object FromNorth extends From with Product with Serializable
  10. object FromSouth extends From with Product with Serializable
  11. object FromWest extends From with Product with Serializable
  12. object Or extends AggregationOperator with Product with Serializable
  13. object RayComparator extends Comparator[Ray]

    A Comparator for Rays which compares them by their theta angle.

    A Comparator for Rays which compares them by their theta angle. This is used in the binary search that is performed in thetaToAlpha.