public class

Viewshed

extends Object
implements Function
java.lang.Object
   ↳ com.esri.core.analysis.Viewshed

Class Overview

This function will calculate viewsheds based on provided raster data and observer positions. To visualize the result, call getOutputFunctionRasterSource(), then create a RasterLayer with it.

When you are done using the viewshed, call its dispose method to release native resources and clean up any temporary files on the machine.

*

Note that this function requires Android RenderScript support library. Please refer to Android document to configure your development environment to be able to use this function.

@Beta

Summary

Public Constructors
Viewshed(String rasterPath)
Creates a Viewshed function, which analyzes raster data located at the provided path.
Public Methods
void dispose()
Disposes the Viewshed and releases its resources.
long getId()
Gets the unique ID of the viewshed function.
String getName()
Returns the name of the function.
Point getObserver()
Returns the position of the observer, which is used to calculate a viewshed.
double getObserverZOffset()
Gets the height of the observer in meters.
FunctionRasterSource getOutputFunctionRasterSource()
Returns a FunctionRasterSource, containing a single function (this Viewshed function).
void setObserver(Point observer)
Sets the position of the observer for use in calculating the viewshed from that position.
void setObserverZOffset(double observerZOffset)
Sets the height of the observer in meters (i.e.
Protected Methods
void finalize()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.esri.core.analysis.Function

Public Constructors

public Viewshed (String rasterPath)

Creates a Viewshed function, which analyzes raster data located at the provided path.

@Beta

Parameters
rasterPath String: the path to the raster data to be analyzed
Throws
IllegalArgumentException if the raster path is null or empty string
FileNotFoundException if file cannot be found
RuntimeException if there was an error binding the viewshed function to the file

Public Methods

public void dispose ()

Disposes the Viewshed and releases its resources.

@Beta

public long getId ()

Gets the unique ID of the viewshed function.

@Beta

Returns
long the unique ID of the viewshed function

public String getName ()

Returns the name of the function.

@Beta

Returns
String the name of the function.

public Point getObserver ()

Returns the position of the observer, which is used to calculate a viewshed. The position is in map coordinates.

@Beta

Returns
Point the observer position

public double getObserverZOffset ()

Gets the height of the observer in meters. See setObserverHeight(double) for more details. If the value cannot be determined, then -1.0 is returned.

@Beta

Returns
double the height of the observer, or -1.0 if it can't be determined

public FunctionRasterSource getOutputFunctionRasterSource ()

Returns a FunctionRasterSource, containing a single function (this Viewshed function). The FunctionRasterSource can then be used to instantiate a RasterLayer.

@Beta

Returns
FunctionRasterSource the FunctionRasterSource containing this Viewshed function

public void setObserver (Point observer)

Sets the position of the observer for use in calculating the viewshed from that position. The position should have valid X, and Y values. Z value will be determined by the elevation of the raster data at that X,Y coordinate, plus the observer height offset, if any. Note, the observer position should use map coordinates, not screen coordinates.

@Beta

Parameters
observer Point: the observer position to set

public void setObserverZOffset (double observerZOffset)

Sets the height of the observer in meters (i.e. the physical height of the observer. For example, if the elevation is 650 meters, and the observer is a human that is 2.0 meters tall, then the viewshed will be calculated for 652 meters at that X,Y coordinate. If the desire was instead to see what the view would be like on top of a 75 meter building, then the observer height could be set to 75, and the viewshed would be calculated for 725 meters at that X,Y coordinate.

@Beta

Parameters
observerZOffset double

Protected Methods

protected void finalize ()

Throws
Throwable