Analysis (IAnalysis80)

This interface is composed of methods for analyzing the terrain.

 

 

Methods

 

Create3DViewshed

Creates a graphical representation of all regions on the terrain and on 3D models and objects that are visible, within a field of view, from a given viewing point.

CreateContourMap

Creates a topographic map that portrays differences in terrain elevation.

CreateFloodContinuousWaterRise

Creates a set of polygons showing the land area covered by water when the water level is rising at a constant rate over a certain period of time

CreateFloodSingleWaterRise

Creates a set of polygons showing the land area covered by water when the water level rises once

CreateLineOfSight

Creates a visual marker for the existence of a line of sight between two points.

CreateSlopeMap

Creates a slope map on the terrain that can show degree (steepness)and/or aspect (direction).

CreateThreatDome

Obsolete. The new threat dome can be created using the ICommand80.Execute method (set the CommandID parameter to 1149 and the parameters parameter to 33).

CreateViewshed

Creates a graphical representation of all the visible areas of the terrain, within a field of view, from a given viewing point.

CreateViewshedOnRoute

Creates a graphical representation of all the visible areas of the terrain, within a field of view, from any selected point along a route.

EndVisibilityQuery

Frees resources for a new StartViewshedVisibilityQuery or StartShadowVisibilityQuery call. 

HideCompareBox

Hides the compare box created by ShowCompareBox.

HideCrossSectionBox

Hides the cross section box created by ShowCrossSectionBox.

MeasureTerrainArea

Measures the area of the horizontal projection (2D measurement) of a defined region.

MeasureTerrainGroundDistance

Measures the distance along a line path taking into account terrain contour.

MeasureTerrainPerimeter

Measures the perimeter of the horizontal projection (2D measurement).

MeasureTerrainProfile

Measures the terrain elevation profile along a defined path.

MeasureTerrainSurface

Measures the surface area (3D measurement) of the defined region, taking into account terrain contours.

MeasureTerrainSurfacePerimeter

Measures the perimeter of the surface of the defined region, taking into account terrain contours.

QueryElevationBuffer

Returns an array of elevation values for a designated area of the terrain.

QueryElevationBufferAsync

Returns an array of elevation values for a designated area of the terrain. The method executes asynchronously, immediately returning an ITerraExplorerAsync80.

QueryPointVisibility

Executes a visibility query based on the parameters set by the last StartViewshedVisibilityQuery or StartShadowVisibilityQuery call.

QueryVisibilityDistance

Checks the visibility from the origin of the shadow/viewshed source, based on the parameters set by the last StartViewshedVisibilityQuery or StartShadowVisibilityQuery call.

SetCompareGroup

Assigns objects to either of the two available comparison groups to enable you to compare between the groups, i.e., the two versions of the 3D View, using the ShowCompareBox method.

ShowCompareBox

Enables you to compare two versions of the 3D View, each of which is composed of a different group of objects, by defining a comparison box with which you can control which of the groups is visible inside the box, and which outside.

ShowCrossSectionBox

Shows a cross section box that exposes obscured sections of the 3D View.

StartShadowVisibilityQuery

Initializes a shadow visibility query for a selected position and shadow effect.

StartViewshedVisibilityQuery

Initializes a viewshed visibility query for a specific viewshed.

Create3DViewshed

Creates a graphical representation of all regions on the terrain and on 3D models and objects that are visible, within a field of view, from a given viewing point.

 

JavaScript

 

Create3DViewshed(

       ViewerPosition,

       FieldOfViewX,

       FieldOfViewY,

       Distance,

       ParentGroupID,

       Description)

 

C#

 

I3DViewshed80 Create3DViewshed(

       IPosition80 ViewerPosition,

       double FieldOfViewX,

       double FieldOfViewY,

       double Distance,

       string ParentGroupID = "",

       string Description = "")

 

C++

 

HRESULT Create3DViewshed(

IPosition80* ViewerPosition,

double FieldOfViewX,

double FieldOfViewY,

double Distance,

BSTR ParentGroupID,

BSTR Description,

I3DViewshed80** pI3DViewshed80)

Parameters

ViewerPosition

An IPosition80 representing the viewing point position, defined by its coordinates in the 3D World.

FieldOfViewX

The horizontal angle limits of the viewshed. Values are in degrees from 0 to 120. For a spherical 3D viewshed, the value is 360.

FieldOfViewY

The vertical angle limits of the viewshed. Values are in degrees from 0 to 120. For a spherical 3D viewshed, the value is 360.

Distance

Length, in meters, of the viewshed analysis from the viewer position.

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 IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 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 to this parameter, TerraExplorer assigns it a unique name.

Return Value

pI3DViewshed80

An I3DViewshed80 representing the newly created 3D viewshed object.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

CreateContourMap

Creates a topographic map that portrays differences in terrain elevation by connecting points of equal elevation with contour lines or by coloring terrain according to varying altitudes. The contour palettes and/or contour lines can be applied to a specified rectangular area, or to the entire terrain using the CoverageArea property of the resulting IContourMap80 object.

 

JavaScript

 

 

 

CreateContourMap(

       UpperLeftX,

       UpperLeftY,

       LowerRightX,

       LowerRightY,

       DisplayStyle,

       PaletteID,

       GroupID,

       Description)

 

C#

 

 

 

IContourMap80 CreateContourMap(

       double UpperLeftX,

       double UpperLeftY,

       double LowerRightX,

       double LowerRightY,

       ContourDisplayStyle DisplayStyle = ContourDisplayStyle.CDS_CONTOUR_STYLE_COLORS,

       string PaletteID = "",

       string GroupID = "",

       string Description = "")

 

C++

 

 

 

HRESULT CreateContourMap(

       double UpperLeftX,

       double UpperLeftY,

       double LowerRightX,

       double LowerRightY,

       ContourDisplayStyle DisplayStyle,

       BSTR PaletteID,

       BSTR GroupID,

       BSTR Description,

       IContourMap80** pIContourMap80)

 

Parameters

UpperLeftX

The West-East coordinate of the contour map’s upper left corner in the project’s coordinate system units.

UpperLeftY

The North-South coordinate of the contour map’s upper left corner in the project’s coordinate system units.

LowerRightX

The West-East coordinate of the contour map’s lower right corner in the project’s coordinate system units.

LowerRightY

The North-South coordinate of the contour map’s lower right corner in the project’s coordinate system units.

DisplayStyle

An enum that determines how the contour map is displayed. The following are the possible values:

·          CDS_CONTOUR_STYLE_DEFAULT = -1,

·          CDS_CONTOUR_STYLE_LINES = 0 – Displays contour lines at set elevation values.

·          CDS_CONTOUR_STYLE_COLORS = 1 - Represents varying altitudes in different colors according to the selected color scheme.

·          CDS_CONTOUR_STYLE_LINES_AND_COLORS = 2 - Displays both contour lines and contour colors

PaletteID

The GUID for the palette. GUIDs are listed in the palette XMLs found in the Pseudo directory, which is located under the [TerraExplorer installation]\Lang\1033 folder and under %APPDATA%\Skyline\TerraExplorer.

Note:    1033 is the English language directory. If you are running TerraExplorer in a different language, the Pseudo folder will be located under your language directory.

This parameter is applied only when the DisplayStyle parameter is set to CDS_CONTOUR_STYLE_COLORS or CDS_CONTOUR_STYLE_LINES_AND_COLORS.

GroupID                                                                                                                              

The Project Tree group in which the contour map object 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 IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the contour map 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

pIContourMap80

An IContourMap80 representing the newly created contour map object.

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list, as well as the following values:

TE_E_INFOTREE_PARENTNOTGROUP

The group ID entered does not represent a valid group in the Project Tree.

TE_E_INFOTREE_ITEMNOTGROUP

The item entered is not a group and therefore cannot be used as a group.

TE_E_INFOTREE_CANTUSEROOT

Cannot use Tree root for this operation

TE_E_INFOTREE_ITEMISGROUP

Item ID is a group so an object cannot be retrieved.

 

CreateFloodContinuousWaterRise

Creates a set of polygons showing the land area covered by water when the water level is rising at a constant rate over a certain period of time (rate of rise and rise interval set by user).

 

JavaScript

 

CreateFloodContinuousWaterRise(

       OriginX,

       OriginY,

       Radius,

       WaterRiseRate,

       SampleInterval,

       TimeSampleIntervalHours,

       StartTime,

       EndTime,

       GroupID,

       Description)

 

C#

 

string CreateFloodContinuousWaterRise(

       double OriginX,

       double OriginY,

       double Radius,

       double WaterRiseRate,

       double SampleInterval,

       double TimeSampleIntervalHours,

       object StartTime,

       object EndTime,

       string ParentGroupID = "",

       string Description = "")

 

C++

 

HRESULT CreateFloodContinuousWaterRise(

       double OriginX,

       double OriginY,

       double Radius,

       double WaterRiseRate,

       double SampleInterval,

       double TimeSampleIntervalHours,

       VARIANT StartTime,

       VARIANT EndTime,

       BSTR ParentGroupID,

       BSTR Description,

       BSTR *FloodGroupID) 

Parameters

OriginX

The flood origin’s x-coordinate (longitude).

OriginY

The flood origin’s y-coordinate (latitude).

Radius

The radius of the area on which the flood analysis is being performed.

WaterRiseRate

The rate the water is rising (meters per hour).

SampleInterval

The distance between terrain sample points. The smaller the sample interval, the more accurate the calculation, but the longer it takes to calculate.

TimeSampleIntervalHours

The time between terrain samples within the time period between the StartTime and EndTime. A shorter sample size is more accurate but slower to calculate.

StartTime

The date and time the water begins to rise. SeeTime” for more information on valid formats for this parameter.

EndTime

The date and time the water stops rising. SeeTime” for more information on valid formats for this parameter.

ParentGroupID                                                                                                                 

The Project Tree group in which the flood analysis object 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 IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the flood analysis 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

FloodGroupID

The ID of the flood polygon set.

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list, as well as the following values:

TE_E_INFOTREE_PARENTNOTGROUP

The group ID entered does not represent a valid group in the Project Tree.

TE_E_INFOTREE_ITEMNOTGROUP

The item entered is not a group and therefore cannot be used as a group.

TE_E_INFOTREE_CANTUSEROOT

Cannot use Tree root for this operation

TE_E_INFOTREE_ITEMISGROUP

Item ID is a group so an object cannot be retrieved.

CreateFloodSingleWaterRise

Creates a set of polygons showing the land area covered by water when the water level rises once (initial water level set by user).

 

JavaScript

 

CreateFloodSingleWaterRise(

       OriginX,

       OriginY,

       Radius,

       TotalWaterLevelRaise,

       SampleInterval,

       GroupID,

       Description)

 

C#

 

string CreateFloodSingleWaterRise(     

       double        OriginX,

       double        OriginY,

       double        Radius,

       double        TotalWaterLevelRaise,

       double        SampleInterval,

       string        ParentGroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreateFloodSingleWaterRise(    

       double        OriginX,

       double        OriginY,

       double        Radius,

       double        TotalWaterLevelRaise,

       double        SampleInterval,

       BSTR   ParentGroupID,

       BSTR   Description,

       BSTR *FloodGroupID) 

Parameters

OriginX

The flood origin’s x-coordinate (longitude).

OriginY

The flood origin’s y-coordinate (latitude).

Radius

The radius of the area on which the flood analysis is being performed.

TotalWaterLevelRaise

The total number of meters the water rises.

SampleInterval

The distance between terrain sample points. The smaller the sample interval, the more accurate the calculation, but the longer it takes to calculate.

ParentGroupID

The ID of the group in which the flood analysis object 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 IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the flood analysis 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

FloodGroupID

The ID of the flood polygon set.

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list, as well as the following values:

TE_E_INFOTREE_PARENTNOTGROUP

The group ID entered does not represent a valid group in the Project Tree.

TE_E_INFOTREE_ITEMNOTGROUP

The item entered is not a group and therefore cannot be used as a group.

TE_E_INFOTREE_CANTUSEROOT

Cannot use Tree root for this operation

TE_E_INFOTREE_ITEMISGROUP

Item ID is a group so an object cannot be retrieved.

CreateLineOfSight

Creates a visual marker for the existence of a line of sight between two points.

 

JavaScript

 

CreateLineOfSight(

       ViewerPosition,

       SampleInterval,

       arrTargetPosition,

       GroupID,

       Description)

 

C#

 

ILineOfSight80 CreateLineOfSight(

       IPosition80 ViewerPosition,

       double SampleInterval,

       object arrTargetPosition,

       string ParentGroupID = "",

       string Description)

 

C++

 

HRESULT CreateLineOfSight(

        IPosition80 * ViewerPosition,

        double SampleInterval,

        VARIANT arrTargetPosition,

        BSTR ParentGroupID,

        BSTR Description,

        ILineOfSight80 ** pLineOfSight) 

Parameters

ViewerPosition

The position of the viewer, defined by its coordinates in the 3D world.

SampleInterval

The distance between terrain samples for the measurement along each line. A smaller sample size is more accurate but slower to calculate.

arrTargetPosition

An array of IPosition80 objects that contains the target positions in the 3D World.

ParentGroupID

The Project Tree group in which the line of sight object 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 IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the line of sight 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

pLineOfSight

An ILineOfSight80 representing the line of sight visual marker created.

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list, as well as the following values:

TE_E_INFOTREE_PARENTNOTGROUP

The group ID entered does not represent a valid group in the Project Tree.

TE_E_INFOTREE_ITEMNOTGROUP

The item entered is not a group and therefore cannot be used as a group.

TE_E_INFOTREE_CANTUSEROOT

Cannot use Tree root for this operation

TE_E_INFOTREE_ITEMISGROUP

Item ID is a group so an object cannot be retrieved.

CreateSlopeMap

Creates a slope map on the terrain that can show degree (steepness) and/or aspect (direction). The terrain is colored according to degree of slope, and arrows display the direction of the slope. The color map and arrows can be applied to a specified rectangular area or to the entire terrain using the CoverageArea property of the resulting ISlopeMap80 object.

 

JavaScript

 

 

 

CreateSlopeMap(

       UpperLeftX,

       UpperLeftY,

       LowerRightX,

       LowerRightY,

       DisplayStyle,

       PaletteID,

       GroupID,

       Description)

 

C#

 

 

 

ISlopeMap80 CreateSlopeMap(

       double UpperLeftX,

       double UpperLeftY,

       double LowerRightX,

       double LowerRightY,

       SlopeDisplayStyle DisplayStyle = SlopeDisplayStyle.SDS_SLOPE_STYLE_COLORS,

       string PaletteID = "",

       string GroupID = "",

       string Description = "")

 

C++

 

 

 

HRESULT CreateSlopeMap(

       double UpperLeftX,

       double UpperLeftY,

       double LowerRightX,

       double LowerRightY,

       SlopeDisplayStyle DisplayStyle,

       BSTR PaletteID,

       BSTR GroupID,

       BSTR Description,

       ISlopeMap80** pISlopeMap80)

 

Parameters

UpperLeftX

The West-East coordinate of the slope map’s upper left corner in the project’s coordinate system units.

UpperLeftY

The North-South coordinate of the slope map’s upper left corner in the project’s coordinate system units.

LowerRightX

The West-East coordinate of the slope map’s lower right corner in the project’s coordinate system units.

LowerRightY

The North-South coordinate of the slope map’s lower right corner in the project’s coordinate system units.

DisplayStyle

An enum that determines how the slope map is displayed. The following are the possible values:

·          SDS_SLOPE_STYLE_DEFAULT = -1
Default

·          SDS_SLOPE_STYLE_DIRECTION = 0
Display arrows on the terrain indicating the direction of the slope.

·          SDS_SLOPE_STYLE_COLORS = 1
Displays palette colors on the terrain according to degree of slope.

·          SDS_SLOPE_STYLE_DIRECTION_AND_COLORS = 2
Display both slope colors and arrows indicating slope direction.

PaletteID

The GUID for the palette. GUIDs are listed in the palette XMLs found in the Pseudo directory, which is located under the [TerraExplorer installation]\Lang\1033 folder and under %APPDATA%\Skyline\TerraExplorer.

Note:    1033 is the English language directory. If you are running TerraExplorer in a different language, the Pseudo folder will be located under your language directory.

This parameter is applied only when the DisplayStyle property is set to CDS_SLOPE_STYLE_COLORS or CDS_SLOPE_STYLE_DIRECTION_AND_COLORS.

GroupID                                                                                                                              

The Project Tree group in which the slope map object 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 IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the slope map 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

pISlopeMap80

An ISlopeMap80 representing the newly created slope map object.

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list, as well as the following values:

TE_E_INFOTREE_PARENTNOTGROUP

The group ID entered does not represent a valid group in the Project Tree.

TE_E_INFOTREE_ITEMNOTGROUP

The item entered is not a group and therefore cannot be used as a group.

TE_E_INFOTREE_CANTUSEROOT

Cannot use Tree root for this operation

TE_E_INFOTREE_ITEMISGROUP

Item ID is a group so an object cannot be retrieved.

CreateThreatDome

Obsolete. Use ICommand80.Execute (setting the CommandID parameter to 1149 and the parameters parameter to 33) to create the new threat dome.

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(

       IPosition80 ViewerPosition,

       double FieldOfView,

       double SampleInterval,

       double RaySpacing,

       double TargetHeightAboveGround,

       object TimeStart,

       object TimeEnd,

       string ParentGroupID = "",

       string Description = "")

 

C++

 

HRESULT CreateViewshed(

       IPosition80 * ViewerPosition,

       double FieldOfView,

       double SampleInterval,

       double RaySpacing,

       double TargetHeightAboveGround,

       VARIANT TimeStart,

       VARIANT TimeEnd,

       BSTR ParentGroupID,

       BSTR   Description,

       BSTR * ViewshedGroupID) 

Parameters

ViewerPosition

An IPosition80 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. SeeTime” for information on valid formats for this parameter.

TimeEnd

The end time for the visibility of the Viewshed Analysis group of objects in the 3D Window. SeeTime” for information on valid formats for this parameter.

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 IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 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.

CreateViewshedOnRoute

Creates a graphical representation of all the visible areas of the terrain, within a field of view, from a given viewing point. The user can define viewer height and radius of viewshed analysis. The calculated route viewshed can be displayed as: 

§   Individual viewshed results for each selected point along the route

§   A single composite viewshed showing visible area from any of the route’s waypoints

§   A series of individual viewshed results that display according to a set timespan

 

JavaScript

 

 

 

CreateViewshedOnRoute(

       Route,

       AnalysisType,

       ViewerHeight,

       Distance,

       SampleInterval,

       RaySpacing,

       DistanceBetweenWaypoints,

       TimeStart,

       TimeEnd,

       ParentGroupID,

       Description)

 

C#

 

 

 

string CreateViewshedOnRoute(

       ILineString Route,

       MultipleViewshedAnalysisType AnalysisType,

       double ViewerHeight,

       double Distance,

       double SampleInterval,

       double RaySpacing,

       double DistanceBetweenWaypoints,

       object TimeStart,

       object TimeEnd,

       string ParentGroupID = "",

       string Description = "")

 

C++

 

 

 

HRESULT CreateViewshedOnRoute(

       ILineString* Route,

       MultipleViewshedAnalysisType AnalysisType,

       double ViewerHeight,

       double Distance,

       double SampleInterval,

       double RaySpacing,

       double DistanceBetweenWaypoints,

       VARIANT TimeStart,

       VARIANT TimeEnd,

       BSTR ParentGroupID,

       BSTR Description,

       BSTR *ViewshedGroupID)

Parameters

Route

An ILineString object representing the geometry that defines the route.

AnalysisType

An enum that determines the Viewshed analysis type. The following are the possible values:

·          MVT_NOT_VALID = -1
Viewshed is invalid.

·          MVT_VIEWSHED_ON_ROUTE = 0
Displays the viewshed as individual viewshed results for each waypoint along the route.

·          MVT_TIMESPAN_VIEWSHED_ON_ROUTE = 1
Displays the viewshed as a series of individual viewshed results that display according to a set timespan.

·          MVT_CUMULATIVE_VIEWSHED_ON_ROUTE = 2
Displays the viewshed as a single composite viewshed showing visible area from any of the route’s waypoints.

ViewerHeight

The height of the viewer waypoints on the route.

Distance

The radius of the viewshed analysis from each of the route’s waypoints.

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.

DistanceBetweenWaypoints

The distance between viewsheds along the route.

TimeStart

The start time assigned to the Viewshed on Route results. SeeTime” for information on valid formats for this parameter.

TimeEnd

The end time assigned to the Viewshed on Route results. SeeTime” for information on valid formats for this parameter.

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 IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 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.

EndVisibilityQuery

This method frees resources for a call from either StartShadowVisibilityQuery or StartViewshedVisibilityQuery.

 

JavaScript

 

 

 

EndVisibilityQuery()

 

C#

 

 

 

void EndVisibilityQuery()

 

C++

 

 

 

HRESULT EndVisibilityQuery()

HideCompareBox

Hides the compare box created by ShowCompareBox.

JavaScript

 

 

 

HideCompareBox()

 

C#

 

 

 

void HideCompareBox ()

 

C++

 

 

 

HRESULT HideCompareBox ()

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list.

 

HideCrossSectionBox

Hides the cross section box created by ShowCrossSectionBox.

JavaScript

 

 

 

HideCrossSectionBox()

 

C#

 

 

 

void HideCrossSectionBox()

 

C++

 

 

 

HRESULT HideCrossSectionBox()

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list.

 

MeasureTerrainArea

Measures the area of the horizontal projection (2D measurement) of a defined region, even if some or all of the defined region encompasses mountainous terrain.

 

JavaScript

 

 

 

MeasureTerrainArea(

       pIGeometry)

 

C#

 

 

 

double MeasureTerrainArea(

       IGeometry pIGeometry)

 

C++

 

 

 

HRESULT MeasureTerrainArea(

       IGeometry* pIGeometry,

       double* pVal)

Parameters

pIGeometry

An IGeometry representing the geometric properties of the defined region.

Return Value

pVal

The resulting value of the terrain area measurement.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

MeasureTerrainGroundDistance

Measures the distance along a line path taking into account the terrain contour.

 

JavaScript

 

 

 

MeasureTerrainGroundDistance (

       pIGeometry,

       sampleInterval,

       IncludeGroundObjects)

 

C#

 

 

 

double MeasureTerrainGroundDistance(

       IGeometry pIGeometry,

       double sampleInterval,

       bool IncludeGroundObjects = false)

 

C++

 

 

 

HRESULT MeasureTerrainGroundDistance (

       IGeometry* pIGeometry,

       double SampleInterval,

       VARIANT_BOOL IncludeGroundObjects,

       double* pVal)

Parameters

pIGeometry

An IGeometry representing the geometric properties of the defined path. Only ILineString geometries are accepted.

sampleInterval

The distance between terrain sample points. Pass zero (0) for automatic interval.

IncludeGroundObjects

A Boolean that determines if ground objects are taken into account in calculating the distance measurement.

Return Value

pVal

The resulting value of the terrain ground distance measurement.     

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

 

MeasureTerrainPerimeter

Measures the perimeter of the horizontal projection (2D measurement). The region measured is the horizontal projection of the defined region, even if some or all of the defined region encompasses mountainous terrain.

 

JavaScript

 

 

 

MeasureTerrainPerimeter(

       pIGeometry)

 

C#

 

 

 

double MeasureTerrainPerimeter(

       IGeometry pIGeometry)

 

C++

 

 

 

HRESULT MeasureTerrainPerimeter(

       IGeometry* pIGeometry,

       double* pVal)

Parameters

pIGeometry

An IGeometry representing the geometric properties of the defined region.

Return Value

pVal

The resulting value of the terrain perimeter measurement. 

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

MeasureTerrainProfile

Measures the terrain elevation profile along a defined path, returning a polyline with the X and Y coordinates of each of the sampled points along the path, and the Z value that was sampled from the terrain for each of these points.

 

JavaScript

 

 

 

MeasureTerrainProfile(

       KeyPoints,

       SampleInterval,

       IncludeGroundObjects)

 

C#

 

 

 

IGeometry MeasureTerrainProfile (

       IGeometry KeyPoints,

       double SampleInterval,

       bool IncludeGroundObjects = false)

 

C++

 

 

 

HRESULT MeasureTerrainProfile (

       IGeometry* KeyPoints,

       double SampleInterval,

       VARIANT_BOOL IncludeGroundObjects,

       IGeometry** pProfile)

Parameters

KeyPoints

An IGeometry with the X and Y coordinates of the points marking the path to be analyzed.

SampleInterval

The distance between terrain sample points along the path. Pass zero (0) for automatic interval.

IncludeGroundObjects

A Boolean that determines if ground objects are taken into account in calculating the terrain profile.

Return Value

IGeometry

An ILineString with the X and Y coordinates of each of the sampled points along the path and the Z value that was sampled from the terrain for each of these points.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

MeasureTerrainSurface

Measures the surface area (3D measurement) of the defined region. The measurement takes into account terrain contours.

 

JavaScript

 

 

 

MeasureTerrainSurface(

       pIGeometry,

       SampleInterval)

 

C#

 

 

 

double MeasureTerrainSurface(

       IGeometry pIGeometry,

       double SampleInterval)

 

C++

 

 

 

HRESULT MeasureTerrainSurface(

       IGeometry* pIGeometry,

       double SampleInterval,

       double* pVal)

Parameters

pIGeometry

An IGeometry representing the geometric properties of the defined region.

SampleInterval

The distance between terrain sample points.

Return Value

pVal

The resulting value of the surface area measurement.           

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

MeasureTerrainSurfacePerimeter

Measures the perimeter of the surface of the defined region. The perimeter measured takes into account terrain contours.

 

JavaScript

 

 

 

MeasureTerrainSurfacePerimeter(

       pIGeometry,

       SampleInterval)

 

C#

 

 

 

double MeasureTerrainSurfacePerimeter(

       IGeometry pIGeometry,

       double SampleInterval)

 

C++

 

 

 

HRESULT MeasureTerrainSurfacePerimeter(

       IGeometry* pIGeometry,

       double SampleInterval,

       double* pVal)

Parameters

pIGeometry

An IGeometry representing the geometric properties of the defined region.

SampleInterval

The distance between terrain sample points.

Return Value

pVal

The resulting value of the perimeter of the surface of the defined region.     

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

QueryElevationBuffer

This method returns an array of elevation values for a designated area of the terrain. The query includes all ground objects, modify terrain objects, 3DML, etc. that are currently loaded on the terrain. If a layer is being streamed, this QueryElevationBuffer only returns elevation values for features that were already streamed at the time this method is called.

The designated area’s coordinates and coordinate system units should be passed in the coordinate system of the terrain and they are not translated by ICoordServices.SourceCoordinateSystem like other places in the API. See ITerrain80.CoordinateSystem for information.

This method executes synchronously, meaning it returns after the query is executed. If you want to execute asynchronously, use QueryElevationBufferAsync instead.

Note:    Make sure the terrain opacity is set to 100% (ITerrain.Opacity = 1) before calling this method.

 

JavaScript

 

 

 

QueryElevationBuffer (

       UpperLeftX,

       UpperLeftY,

       ResX,

       ResY,

       DimensionX,

       DimensionY)

 

C#

 

 

 

dynamic QueryElevationBuffer (

       double UpperLeftX,

       double UpperLeftY,

       double ResX,

       double ResY,

       int DimensionX,

       int DimensionY)

 

C++

 

 

 

HRESULT QueryElevationBuffer (

       double UpperLeftX,

       double UpperLeftY,

       double ResX,

       double ResY,

       long DimensionX,

       long DimensionY,

       VARIANT* pVal)

Parameters

UpperLeftX

The West-East coordinate of the elevation layer’s upper left corner in the terrain coordinate system.

UpperLeftY

The North-South coordinate of the elevation layer’s upper left corner in the terrain coordinate system.

ResX

The X cell resolution in the terrain coordinate system units.

ResY

The Y cell resolution in the terrain coordinate system units.

DimensionX

The width, in pixels, of the raster array. This value can range from 512-2048.

DimensionY

The height, in pixels, of the raster array. This value can range from 512-2048.

Return Value

pVal

SafeArray of float values representing the elevation values in the designated area. The values are stored in the array in typewriter order, beginning with the UpperLeftX, UpperLeftY coordinate.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

QueryElevationBufferAsync

This method returns an array of elevation values for a designated area of the terrain. The query includes all ground objects, modify terrain objects, 3DML, etc. that are currently loaded on the terrain. If a layer is being streamed, this QueryElevationBuffer only returns elevation values for features that were already streamed at the time this method is called.

The designated area’s coordinates and coordinate system units should be passed in the coordinate system of the terrain and they are not translated by ICoordServices.SourceCoordinateSystem like other places in the API. See ITerrain80.CoordinateSystem for information.

QueryElevationBufferAsync executes asynchronously, immediately returning an ITerraExplorerAsync80, thereby ensuring that control is promptly handed back to the calling function. The ITerraExplorerAsync80 object provides a callback-based mechanism similar to the JavaScript promise and the C# Task that offers the following functionality:

§   Allows for handling the various stages of the asynchronous operation, from tracking progress to managing rejection/error, and finally resolving the operation (using OnProgress, OnReject, and OnResolve respectively).

§   Upon resolution of the query, enables the passing of a SafeArray of float values representing the elevation values in the designated area, to the OnResolve callback.

If you want to execute synchronously, use QueryElevationBuffer instead.

Note:    Make sure the terrain opacity is set to 100% (ITerrain.Opacity = 1) before calling this method.

 

JavaScript

 

 

 

QueryElevationBufferAsync (

       UpperLeftX,

       UpperLeftY,

       ResX,

       ResY,

       DimensionX,

       DimensionY)

 

C#

 

 

 

ITerraExplorerAsync80 QueryElevationBufferAsync (

       double UpperLeftX,

       double UpperLeftY,

       double ResX,

       double ResY,

       int DimensionX,

       int DimensionY)

 

C++

 

 

 

HRESULT QueryElevationBufferAsync (

       double UpperLeftX,

       double UpperLeftY,

       double ResX,

       double ResY,

       long DimensionX,

       long DimensionY,

       ITerraExplorerAsync80* pVal)

Parameters

UpperLeftX

The West-East coordinate of the elevation layer’s upper left corner in the terrain coordinate system.

UpperLeftY

The North-South coordinate of the elevation layer’s upper left corner in the terrain coordinate system.

ResX

The X cell resolution in the terrain coordinate system units.

ResY

The Y cell resolution in the terrain coordinate system units.

DimensionX

The width, in pixels, of the raster array. This value can range from 512-2048.

DimensionY

The height, in pixels, of the raster array. This value can range from 512-2048.

Return Value

pVal

An ITerraExplorerAsync80 object, which provides a callback-based mechanism similar to the JavaScript promise and the C# Task that offers the following functionality:

·          Allows for handling the various stages of the asynchronous operation, from tracking progress to managing rejection/error, and finally resolving the operation (using OnProgress, OnReject, and OnResolve respectively).

·          Upon resolution of the query, enables the passing of a SafeArray of float values representing the elevation values in the designated area, to the OnResolve callback.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

 

QueryPointVisibility

This method executes a visibility query (either StartShadowVisibilityQuery or StartViewshedVisibilityQuery) based on the parameters set by the last StartXXVisibilityQuery call. Multiple calls to QueryPointVisibility can be made. When the queries are finished, EndVisibilityQuery should be called to free system resources.

 

JavaScript

 

 

 

QueryPointVisibility(

       QueryPosition)

 

C#

 

 

 

double QueryPointVisibility(

       IPosition80 QueryPosition)

 

C++

 

 

 

HRESULT QueryPointVisibility(

       IPosition80* QueryPosition,

       double* pVal)

Parameters

QueryPosition

An IPosition80representing the position for which the query is being performed.

Return Value

pVal

The value returned by the visibility query:

·          1 – visible

·          0 – not visible

·          -1 – QueryPosition is outside of the region defined for the analysis. This area is defined in the StartShadowVisibilityQuery and StartViewshedVisibilityQuery.

·          -2 – Error

 

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list, as well as the following value:

§   TE_E_OUT_OF_RANGE - Point is not in the shadow/viewshed area

QueryVisibilityDistance

Based on the parameters set by the last StartXXVisibilityQuery call (either StartShadowVisibilityQuery or StartViewshedVisibilityQuery), this method gets the point along the path from the origin of the shadow (QuerySperePosition) or viewshed source where the visibility or shadow is blocked by the terrain or a ground object.

 

JavaScript

 

 

 

QueryVisibilityDistance(

       QueryPosition)

 

C#

 

 

 

double QueryVisibilityDistance (

       IPosition80 QueryPosition)

 

C++

 

 

 

HRESULT QueryVisibilityDistance (

       IPosition80* QueryPosition,

       double* pVal)

Parameters

QueryPosition

An IPosition80representing the position of the endpoint of the path from the origin of the shadow (QuerySperePosition) or viewshed source that is being queried for the presence of a terrain or ground object.

Return Value

pVal

The distance to the point along the path from the origin of the shadow (QuerySperePosition) or viewshed source where the visibility or shadow is blocked by the terrain or a ground object.

-1 is returned if the query position is outside the range of the viewshed or shadow analysis. This range is defined in the StartShadowVisibilityQuery and StartViewshedVisibilityQuery.

Note:    The distance is returned whether or not the visibility was blocked by a ground object or terrain. Use QueryPointVisibility to determine whether visibility was blocked.

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list.

SetCompareGroup

This method enables you to compare two versions of the 3D View, each of which is composed of a different group of objects, by dynamically hiding one of the groups inside or outside of a box area defined by the ShowCompareBox method.

Call this method for each object you want to assign to either of the groups (CG_Group_1/ CG_Group_2). You can then call ShowCompareBox to define a comparison box and control which of the groups is visible inside the box, and which outside, e.g. to allow dynamically swiping between the two versions. See “ShowCompareBox” for more information

This method is similar to the Swipe 3D Mesh Layers tool available from the TerraExplorer application. See "Swipe 3D Mesh Layers" in the TerraExplorer User Guide for more information.

 

JavaScript

 

 

 

SetCompareGroup (

       ID,

       Group)

 

C#

 

 

 

void SetCompareGroup (

       String* ID,

       CompareGroup Group)

 

C++

 

 

 

HRESULT SetCompareGroup (

       BSTR* ID,

       CompareGroup Group)

Parameters

ID

The ITerraExplorerObject80.ID of the object to be included in the group.

Group

An enum representing the group that the ID object should be included in. It can have any of the following values:

·          CG_ALL_OBJECTS = 0
Include the object with all objects that were not assigned a group. All these objects will be displayed in both groups.

·          CG_GROUP_1 = 1
Include the object only in group 1.

·          CG_GROUP_2 = 2
Include the object only in group 2.

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list.

ShowCompareBox

This method enables you to compare two versions of the 3D View, each of which is composed of a different group of objects, by dynamically hiding one of the groups inside or outside of a box area.

After calling SetCompareGroup for each object you want to assign to either of the groups (CG_Group_1/ CG_Group_2), you can then call ShowCompareBox to define a comparison box, and control which of the groups is visible inside the box, and which outside. This can be used, for example, to allow dynamically swiping between the two versions. See “SetCompareGroup” for more information

Within the frame of the box, you see objects from one group, while outside the box you see objects from the other group. Any object that is not assigned to either group is displayed both inside and outside of the box. The show compare box can be hidden using HideCompareBox

 

JavaScript

 

 

 

ShowCompareBox (

       Box,

       ShowIn,

       Color)

 

C#

 

 

 

void ShowCompareBox (

       ILineString* Box,

       bool ShowIn,

       object Color)

 

C++

 

 

 

HRESULT ShowCompareBox (

       ILineString* Box,

       VARIANT_BOOL ShowIn,

       VARIANT Color)

Parameters

Box

A linestring geometry with eight points, that defines the compare box’s corners. The box points should already be rotated in space (there is no yaw/pitch/roll). Points 1-4 define the base of the cross section box, while points 5-8 define the top of the box, all in clockwise order.

cross section2.gif

ShowIn

A Boolean that determines whether the objects assigned to Group_1 using SetCompareGroup are shown inside or outside the box. When set to TRUE, TerraExplorer shows Group_1 from SetCompareGroup inside the box and Group_2 from SetCompareGroup outside the box, and when set to FALSE, TerraExplorer shows the reverse.

Color

Color of the compare box.

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list.

 

ShowCrossSectionBox

Shows a cross section box that exposes obscured sections of the 3D View. The cross section box can be hidden using HideCrossSectionBox. This method is similar to the Cross Section tool available from the TerraExplorer application. See "Cross Section Tool" in the TerraExplorer User Guide for more information.

 

JavaScript

 

 

 

ShowCrossSectionBox (

       Box,

       ShowIn)

 

C#

 

 

 

void ShowCrossSectionBox (

       ILineString* Box,

       bool ShowIn,

       object Color)

 

C++

 

 

 

HRESULT ShowCrossSectionBox (

       ILineString* Box,

       VARIANT_BOOL ShowIn,

       VARIANT Color)

Parameters

Box

A linestring geometry with eight points, that defines the cross section box’s corners. The box points should already be rotated in space (there is no yaw/pitch/roll). Points 1-4 define the base of the cross section box, while points 5-8 define the top of the box, all in clockwise order.

cross section2.gif

 

ShowIn

A Boolean that determines whether to show what’s inside or outside the box. When set to TRUE, TerraExplorer shows what is inside and hides what is outside, and when set to FALSE, TerraExplorer shows what’s outside the box and hides what is inside.

Color

Color of the cross section box.

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list.

 

StartShadowVisibilityQuery

Initializes a shadow visibility query for a selected position and shadow effect. After this initialization, subsequent calls can be made to QueryPointVisibility to calculate shadow visibility or to QueryVisibilityDistance to return the point where the shadow is blocked. The query can be based on the shadow effect of selected objects (selection Shadow) or of all the project’s objects (global shadow). Shadows are displayed using the ICommand80.Execute method (set the CommandID parameter to 2118 for a global shadow and to 2119 for a selection shadow).

Note:    The selection of objects for a selection shadow can only be performed through the user interface since it is not currently supported by the API.

 

JavaScript

 

 

 

StartShadowVisibilityQuery(

       QuerySpherePosition,

       QuerySphereRadius,

       Type)

 

C#

 

 

 

void StartShadowVisibilityQuery(

       IPosition80 QuerySpherePosition,

       double QuerySphereRadius,

       ShadowType Type)

 

C++

 

 

 

HRESULT StartShadowVisibilityQuery(

       IPosition80* QuerySpherePosition,

       double QuerySphereRadius,

       ShadowType Type)

 

Parameters

QuerySperePosition

The center point of the sphere that defines the region in which the shadow analysis is performed.

QuerySphereRadius

The radius of the sphere that defines the region in which the shadow analysis is performed.

Type

An enum that defines what shadow effect should be considered in the query. The following are the possible values:

·          STP_NONE = 0
No shadow

·          STP_GLOBAL = 1
Global shadow cast by all of the project’s objects

·          STP_SELECTION = 2
Shadow effect of selected objects

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list.

StartViewshedVisibilityQuery

Initializes a viewshed visibility query for a specific viewshed. After this initialization, subsequent calls can be made to QueryPointVisibility to calculate the visibility of a selected position on a 3D viewshed (passed in this method’s ViewshedID parameter) from the observer viewpoint of the 3D viewshed or to QueryVisibilityDistance to get the point where the view is blocked.

 

JavaScript

 

 

 

StartViewshedVisibilityQuery(

       ViewshedID,

       Quality)

 

C#

 

 

 

void StartViewshedVisibilityQuery(

       string ViewshedID,

       ViewshedQuality Quality = ViewshedQuality.VSQ_QUALITY_HIGH)

 

C++

 

HRESULT StartViewshedVisibilityQuery(

       BSTR ViewshedID,

       ViewshedQuality Quality)

 

Parameters

ViewshedID

The ID of the required I3DViewshed80 object that defines the viewshed on which the analysis is being performed.

Quality

An enum that determines the accuracy level of the viewshed query. The following are the possible values:

·          VSQ_QUALITY_LOW = 0

·          VSQ_QUALITY_MEDIUM = 1

·          VSQ_QUALITY_HIGH = 2

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list.