Home > Working with SGWorld > Analysis (IAnalysis66) > CreateViewshed
Creates a graphical representation of all the visible areas of the terrain within a field of view, from a given viewing point.
JavaScript |
|
CreateViewshed( ViewerPosition, FieldOfView, SampleInterval, RaySpacing, TargetHeightAboveGround, TimeStart, TimeEnd, ParentGroupID, Description) |
C# |
|
string CreateViewshed( IPosition66 ViewerPosition, double FieldOfView, double SampleInterval, double RaySpacing, double TargetHeightAboveGround, object TimeStart, object TimeEnd, [string ParentGroupID = ""], [string Description = ""]) |
C++ |
|
HRESULT CreateViewshed( IPosition66 * ViewerPosition, double FieldOfView, double SampleInterval, double RaySpacing, double TargetHeightAboveGround, VARIANT TimeStart, VARIANT TimeEnd, BSTR ParentGroupID, BSTR Description, BSTR * ViewshedGroupID) |
Parameters
ViewerPosition
An IPosition66 representing the viewing point position, defined by its coordinates in the 3D World.
FieldOfView
The angular extent of the 3D World that can be seen. The default is set to 53 degrees.
SampleInterval
The distance between terrain samples for the measurement along each ray. A smaller sample size is more accurate but slower to calculate.
RaySpacing
The space in degrees between each ray that TerraExplorer samples. TerraExplorer samples several rays (lines of sight) in the area sector. The smaller the ray spacing, the more accurate the measurement, but the longer it takes to calculate.
TargetHeightAboveGround
The target height.
TimeStart
The start time for the visibility of the Viewshed Analysis group of objects in the 3D Window. The value can be any of the following:
· Javascript DateTime object
· VT_DATE
Note: DateTime (e.g. in JavaScript) is automatically converted to VT_DATE.
· _time_t
Int or long values representing the number of seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time.
· double
double values representing the number of milliseconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time.
· C# DateTime object.
TimeEnd
The end time for the visibility of the Viewshed Analysis group of objects in the 3D Window. The value can be any of the following:
· Javascript DateTime object
· VT_DATE
Note: DateTime (e.g. in JavaScript) is automatically converted to VT_DATE.
· _time_t
Int or long values representing the number of seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time.
· double
double values representing the number of milliseconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time.
· C# DateTime object.
ParentGroupID
The Project Tree group in which the model is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:
· Create the group using IProjectTree66.CreateGroup.
· Find the group, if you know the name, using IProjectTree66.FindItem.
· Traverse the Tree using IProjectTree66 methods such as GetNextItem, until you come to the desired GroupID.
Description
The name of the viewshed object as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.
Return Value
ViewshedGroupID
The ID of the viewshed object.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.