Class Viewshed

  • Direct Known Subclasses:
    GeoElementViewshed, LocationViewshed

    public abstract class Viewshed
    extends Analysis
    Viewshed is a type of visibility analysis that shows the visible and obstructed areas covered by a directed field of view. Visible and obstructed areas are determined for an area defined by an observer location, horizontal and vertical view angles, and a minimum/maximum distance range. These properties define a frustum (a 3D solid) inside of which visibility is calculated.

    Viewshed analysis is visual only - the result is rendered on to the GeoView, there is no API to get the visible and obstructed areas as geometries.

    Viewshed analysis is reactive - whenever data changes (such as change in scene layer load status or visibility), the viewshed will automatically update.

    Notes on JavaSE:

    • Maximum number of viewsheds per GeoView is 16. Viewsheds in excess of 16 will not be rendered.

    Notes on Android:

    • Viewshed is supported only on devices that support OpenGL ES 3.0 or later. For unsupported devices, adding a Viewshed may not render anything.
    • If Viewshed is always required by your application and cannot be enabled/disabled, then add the following to the application's Manifest:
      <uses-feature android:glEsVersion="0x00030000" android:required="true" />
    • If Viewshed is not always required by your application and can be enabled/disabled, then add the following to the application's Manifest:
      <uses-feature android:glEsVersion="0x00020000" android:required="true" />
      In this case, the application can query the version of OpenGL ES and enable Viewshed if the supported version is at least 3.0. For more details see OpenGL ES
    • Maximum number of viewsheds per GeoView is 8. Viewsheds in excess of 8 will not be rendered.
    Since:
    100.2.0
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static int getFrustumOutlineColor()
      Gets the color to render the frustum outline.
      double getHorizontalAngle()
      Gets the horizontal spread of the viewshed, in degrees, > 0 and <= 360.
      double getMaxDistance()
      Gets the maximum distance from the viewshed Location where the viewshed renders, in meters within [0, Double.MAX_VALUE].
      double getMinDistance()
      Gets the minimum distance from the location where the viewshed starts to render, in meters within [0, Double.MAX_VALUE].
      static int getObstructedColor()
      Gets the color to render areas not visible from the observer location and within the frustum.
      double getVerticalAngle()
      Gets the vertical spread of the viewshed, in degrees, > 0 and <= 360.
      static int getVisibleColor()
      Gets the color to render areas visible from the observer location and within the frustum.
      boolean isFrustumOutlineVisibile()
      Gets whether the outline of the frustum is visible.
      static void setFrustumOutlineColor​(int frustumOutlineColor)
      Sets the color to render the frustum outline.
      void setFrustumOutlineVisible​(boolean frustumOutlineVisible)
      Sets whether the outline of the frustum should be visible.
      void setHorizontalAngle​(double horizontalAngle)
      Sets the horizontal spread of the viewshed, in degrees, > 0 and <= 360.
      void setMaxDistance​(double maxDistance)
      Sets the maximum distance from the viewshed Location where the viewshed renders, in meters within [0, Double.MAX_VALUE].
      void setMinDistance​(double minDistance)
      Sets the minimum distance from the location where the viewshed starts to render, in meters within [0, Double.MAX_VALUE].
      static void setObstructedColor​(int obstructedColor)
      Sets the color to render areas not visible from the observer location and within the frustum.
      void setVerticalAngle​(double verticalAngle)
      Sets the vertical spread of the viewshed, in degrees, > 0 and <= 360.
      static void setVisibleColor​(int visibleColor)
      Sets the color to render areas visible from the observer location and within the frustum.
    • Method Detail

      • setVisibleColor

        public static void setVisibleColor​(int visibleColor)
        Sets the color to render areas visible from the observer location and within the frustum.
        Parameters:
        visibleColor - the color of visible areas, as 0xAARRGGBB
        Since:
        100.2.0
      • getVisibleColor

        public static int getVisibleColor()
        Gets the color to render areas visible from the observer location and within the frustum.
        Returns:
        the color of visible areas, as 0xAARRGGBB
        Since:
        100.2.0
      • setObstructedColor

        public static void setObstructedColor​(int obstructedColor)
        Sets the color to render areas not visible from the observer location and within the frustum.
        Parameters:
        obstructedColor - the color of areas not visible, as 0xAARRGGBB
        Since:
        100.2.0
      • getObstructedColor

        public static int getObstructedColor()
        Gets the color to render areas not visible from the observer location and within the frustum.
        Returns:
        the color of areas not visible, as 0xAARRGGBB
        Since:
        100.2.0
      • setFrustumOutlineColor

        public static void setFrustumOutlineColor​(int frustumOutlineColor)
        Sets the color to render the frustum outline.
        Parameters:
        frustumOutlineColor - the color of the frustum outline, as 0xAARRGGBB
        Since:
        100.2.0
      • getFrustumOutlineColor

        public static int getFrustumOutlineColor()
        Gets the color to render the frustum outline.
        Returns:
        the color of the frustum outline, as 0xAARRGGBB
        Since:
        100.2.0
      • getHorizontalAngle

        public double getHorizontalAngle()
        Gets the horizontal spread of the viewshed, in degrees, > 0 and <= 360.

        Default is 90.

        Returns:
        the horizontal spread of the viewshed, in degrees, > 0 and <= 360
        Since:
        100.2.0
      • setHorizontalAngle

        public void setHorizontalAngle​(double horizontalAngle)
        Sets the horizontal spread of the viewshed, in degrees, > 0 and <= 360.
        Parameters:
        horizontalAngle - the horizontal spread of the viewshed, in degrees, > 0 and <= 360
        Since:
        100.2.0
      • getVerticalAngle

        public double getVerticalAngle()
        Gets the vertical spread of the viewshed, in degrees, > 0 and <= 360.

        Default is 90.

        Returns:
        the vertical spread of the viewshed, in degrees, > 0 and <= 360
        Since:
        100.2.0
      • setVerticalAngle

        public void setVerticalAngle​(double verticalAngle)
        Sets the vertical spread of the viewshed, in degrees, > 0 and <= 360.
        Parameters:
        verticalAngle - the vertical spread of the viewshed, in degrees, > 0 and <= 360
        Since:
        100.2.0
      • getMinDistance

        public double getMinDistance()
        Gets the minimum distance from the location where the viewshed starts to render, in meters within [0, Double.MAX_VALUE].
        Returns:
        the minimum distance from the location where the viewshed starts to render, in meters within [0, Double.MAX_VALUE]
        Since:
        100.2.0
      • setMinDistance

        public void setMinDistance​(double minDistance)
        Sets the minimum distance from the location where the viewshed starts to render, in meters within [0, Double.MAX_VALUE].
        Parameters:
        minDistance - the minimum distance from the location where the viewshed starts to render, in meters within [0, Double.MAX_VALUE]
        Since:
        100.2.0
      • getMaxDistance

        public double getMaxDistance()
        Gets the maximum distance from the viewshed Location where the viewshed renders, in meters within [0, Double.MAX_VALUE].
        Returns:
        the maximum distance from the viewshed Location where the viewshed renders, in meters within [0, Double.MAX_VALUE]
        Since:
        100.2.0
      • setMaxDistance

        public void setMaxDistance​(double maxDistance)
        Sets the maximum distance from the viewshed Location where the viewshed renders, in meters within [0, Double.MAX_VALUE].
        Parameters:
        maxDistance - the maximum distance from the viewshed Location where the viewshed renders, in meters within [0, Double.MAX_VALUE]
        Since:
        100.2.0
      • isFrustumOutlineVisibile

        public boolean isFrustumOutlineVisibile()
        Gets whether the outline of the frustum is visible.

        Default is false.

        Returns:
        true if the outline of the frustum is visible, otherwise false
        Since:
        100.2.0
      • setFrustumOutlineVisible

        public void setFrustumOutlineVisible​(boolean frustumOutlineVisible)
        Sets whether the outline of the frustum should be visible.

        Default is false.

        Parameters:
        frustumOutlineVisible - true if the outline of the frustum should be visible, otherwise false
        Since:
        100.2.0