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.