IFeatureGroup80

A feature group is a group of features within a layer that share the same geometry and display style. A feature layer can have multiple feature groups, each containing a homogeneous collection of point polyline, or polygon objects. This interface supplies properties and methods for interacting with a feature group. It returns and sets property values and annotation properties and provides methods for creating and removing features from a feature group.

If a feature group is an annotation feature group (these groups can be identified using the IsAnnotation method), the IFeatures80 that they return can only be used to query the point position of annotations and to read attribute values. Any values set for an annotation IFeature80 will not persist.

 

 

Properties

 

DisplayAs

Gets and sets the symbol type that is used to represent the features in the group.

Features

Obsolete. Use GetCurrentFeatures instead

GeometryType

Gets the geometry type of the features in the group.

TreeItem

An ITreeItem80 describing the representation of the group in the Project Tree.

 

Methods

 

CreateFeature

Adds a new feature to the feature group.

DrawFeature

Activates an interactive mode for drawing a feature in the 3D World.

ExecuteGetDataSourceFeatureIdQuery

Returns a feature based on the feature ID it was assigned by the data source.

GetClassification

Returns the classification XML for a specified property of the group's features.

GetCurrentFeatures

Returns the features that are currently loaded when this method is called.

GetFeatureByObjectID

Returns the feature based on object ID.

GetProperty

Returns the value set for the specified property.

IsAnnotation

Indicates whether the feature group contains annotation features.

IsClassified

Indicates whether a classification XML was set for a specified property. This method returns TRUE if a classification XML was set, and FALSE if a value (e.g., “Text” was set to “Bus Station”) was set.

OpenStyleEditorDialog

Opens the Field by Attribute dialog box to control the appearance and behavior of layer features based on field attribute values.

RemoveFeature

Removes a feature from the feature group.

SetClassification

Sets the value of a specified feature property.

SetProperty

Sets a value for the specified property.

DisplayAs

Gets and sets an enum determining the symbol type that is used to represent each of the features in the group. The possible values depend on the type of feature group (point, polyline, or polygon). See: ITerraExplorerObject80.ObjectType for more information.

 

JavaScript

 

DisplayAs

 

C#

 

ObjectTypeCode DisplayAs { get; set; }

 

C++

 

HRESULT DisplayAs([out, retval] ObjectTypeCode* ObjectType)

HRESULT DisplayAs([in] ObjectTypeCode* ObjectType)

 

Features

Obsolete. Use GetCurrentFeatures instead.

GeometryType

Gets an enum returning the geometry type of the features in the group:

§   LGT_NONE                 = -1

§   LGT_POINT                 = 0

§   LGT_POLYLINE          = 1

§   LGT_POLYGON         = 2

§   LGT_COLLECTION    = 3

 

JavaScript

 

GeometryType

 

C#

 

LayerGeometryType GeometryType { get; }

 

C++

 

HRESULT GeometryType([out, retval] LayerGeometryType* LayerType)

CreateFeature

Creates a new feature and adds it to the feature group.

 

JavaScript

 

string CreateFeature(

       Geometry,

       Attributes)

 

C#

 

string CreateFeature(

       object Geometry,

       string Attributes = "")

 

C++

 

HRESULT CreateFeature(

       VARIANT Geometry,

       BSTR Attributes,

       BSTR* ID)

Parameters

Geometry

The geometry of the added feature. Any of the following can be passed:

·          Safe Array of Vertices - An array that contains triplets of doubles (or in the case of a point feature, a single triplet of doubles). Each triplet is composed of an x-coordinate, a y-coordinate, and a height. The height is represented in meters and the x- and y-coordinates are represented in the coordinate system’s units. You can use the ITerrain80 interface to retrieve information about the coordinate system.

·          WKT of the feature’s geometry
SeeWell-Known Text Representation for Geometric Objects” in the “Overview” chapter for background information on WKT and WKB.

·          WKB of the feature’s geometry
SeeWell-Known Binary Representation for Geometric Objects” in the “Overview” chapter for background information on WKT and WKB.

·          IGeometry representing the feature’s geometry

Attributes

The new feature’s attribute values represented as a semi-colon delimited string. E.g., if a feature layer has three attributes, pass "a;b;c" for this parameter, where "a" is the value of the first attribute, "b" is the value of the second, and "c" the value of the third.

Return value

ID

The ID of the newly created feature represented as a string.

Exceptions

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

DrawFeature

Activates an interactive mode for drawing a layer feature in the 3D World. The drawing process and style can be controlled using the related drawing events: OnDrawingAbort, OnDrawingFinished, and OnDrawingGeometryChanged. The IFeature return value can be used to set any of the properties of the drawn feature.

Note:    The Position of the returning  IFeature feature should not be modified until the draw action is complete, i.e., until the OnDrawingFinished event is sent.

 

JavaScript

 

DrawFeature (

       DrawingMode,

       Left,

       Top)

 

C#

 

IFeature80 DrawFeature (

       DrawingMode = DrawingMode.DRAW_MODE_MAGNET,

       int Left = int.MaxValue,

       int Top = int.MaxValue)

 

C++

 

HRESULT DrawFeature(

       [in] DrawingMode DrawingMode

       [in] long Left,

       [in] long Top,

       [out, retval] IFeature80** pIFeature80)

Parameters

DrawingMode

An enum that determines a feature object's initial move mode, i.e., how it is moved in the 3D Window, and how the property sheet is displayed when the object is created. The DrawingMode enum is divided into two subgroups. This parameter can use a combination of values from the two subgroups, but no more than one value from each subgroup can be used.

Property Sheet Display Group – Use only one of the following values:

·          DRAW_MODE_SHOW_PROPERTY = 1
Open the property sheet including the top toolbar to edit the object.

·          DRAW_MODE_SHOW_PROPERTY_TOOLBAR = 2
Open only the property sheet toolbar to edit the item.

Move Mode Group – Use only one of the following values:

·          DRAW_MODE_MAGNET = 4
Sets the edit mode to move the object based on where the mouse is pointing in the 3D Window. This makes it easier to move an object or node on a vertical plane or above a 3DML layer or other terrain object.

·          DRAW_MODE_XY = 8    
Set the edit mode to move the object in the XY plane.

Left

Determines the placement of the feature's property sheet. Left position relative to Render 3D Window. The default in full property sheet mode is the last position of the full property sheet. The default in property sheet panel mode is the last positon of the panel property sheet.

Top

Determines the placement of the feature's property sheet. Top position relative to Render 3D Window. The default in full property sheet mode is the last position of the full property sheet. The default in property sheet panel mode is the last positon of the panel property sheet.

Return Value

pIFeature80

An IFeature80 representing the newly added feature. . The return object can be used to set any of the properties of the drawn object.

Exceptions

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

 

 

ExecuteGetDataSourceFeatureIdQuery

This method returns a feature based on the feature ID it was assigned by the data source. Since the query is performed on the data source, even a feature that has not yet been streamed can be returned.

JavaScript

 

ExecuteGetDataSourceFeatureIdQuery (

       FeatureID)

 

C#

 

IFeature80 ExecuteGetDataSourceFeatureIdQuery (

       string FeatureID)

 

C++

 

HRESULT ExecuteGetDataSourceFeatureIdQuery (

       BSTR FeatureID,

       IFeature80** pVal)

Parameters

FeatureID

The ID of the feature requested.

Return Value

pVal

An IFeature80 representing the feature with a specified feature ID.

Exceptions

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

GetClassification

This method returns the classification XML for a specified property of the group's features.

 

JavaScript

 

GetClassification(

       Name)

 

C#

 

string GetClassification(

       string Name)

 

C++

 

HRESULT GetClassification(

       BSTR Name,

       BSTR* pValue)

Parameters

Name

The name of the property. The parameter can be a name of any property field as it appears in the Layer property sheet in TerraExplorer (e.g., “Line Color”).

Return Value

pValue

A classification XML for the specified property. See: the SetClassification method description and see:“Feature Layers” chapter in the User Manual.

Exceptions

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

GetCurrentFeatures

Returns the features that are currently loaded when this method is called.

Note:    If a layer is being streamed, the features returned by this method only reflect the layer status at the time the method is called. The actual loaded features may change as features are added or deleted while the layer is streaming.

Note:    If this method is called on an annotation feature group (these groups can be identified using the IsAnnotation method), the IFeatures80 that they return can only be used to query the point position of annotations and to read attribute values. Any values set for an annotation IFeature80 will not persist.

 

JavaScript

 

GetCurrentFeatures

 

C#

 

IFeatures80 GetCurrentFeatures ()

 

C++

 

HRESULT GetCurrentFeatures (

       IFeatures80** pVal)

Return Value

pVal

An IFeatures80 representing the features that are currently loaded.

Exceptions

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

GetFeatureByObjectID

Returns a feature based on its (TerraExplorer-assigned) object ID.

 

JavaScript

 

GetFeatureByObjectID(

       ObjectID)

 

C#

 

IFeature80 GetFeatureByObjectID(

       string ObjectID)

 

C++

 

HRESULT GetFeatureByObjectID (

       BSTR ObjectID,

       IFeature80** pVal)

Parameters

ObjectID

The ID of the feature requested.

Return Value

pVal

An IFeature80 representing the object with a specified object ID.

Exceptions

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

GetProperty

Returns the value set for the specified property. See "SetProperty" for more information.

 

JavaScript

 

GetProperty(

       Name)

 

C#

 

dynamic GetProperty(

       string Name)

 

C++

 

HRESULT GetProperty(

       BSTR Name,

       VARIANT* pValue)

Parameters

Name

The name of the property whose value is being returned. The parameter can be a name of any property field as it appears in the Layer property sheet in TerraExplorer (e.g., “Line Color”).

Note:    This parameter must be in English even when the user interface is in a different language.

Return Value

pValue

The value assigned to the property. Pass the variable type that is expected for the specified property, e.g. for “Line Color” pass a long type value. If the property is a drop-down menu, the zero-based integer index of the order in the list is passed. See "SetProperty" for more information.

Exceptions

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

IsAnnotation

When a native feature group is loaded, TerraExplorer Pro can create a corresponding annotation object at the center of each geographic object. The annotation object can then be used to convey information relating to the geographic object, textually or graphically.

This method returns a Boolean indicating whether the feature group contains annotation features.

Note:    If a feature group is an annotation feature group, the IFeatures80 that they return can only be used to query the point position of annotations and to read attribute values. Any values set for an annotation IFeature80 will not persist.

 

JavaScript

 

IsAnnotation

 

C#

 

bool IsAnnotation()

 

C++

 

HRESULT IsAnnotation(

       VARIANT_BOOL* bAnno)

Return Value

bAnno

A Boolean indicating whether the feature group contains an annotation object.

Exceptions

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

IsClassified

This method indicates whether a classification XML was set for a specified property. This method returns TRUE if a classification XML was set, and FALSE if a value (e.g., “Text” was set to “Bus Station”) was set.

 

JavaScript

 

IsClassified(

       Name)

 

C#

 

bool IsClassified(

       string Name)

 

C++

 

HRESULT IsClassified(

       BSTR Name,

       VARIANT_BOOL* pValue)

Parameters

Name

The name of the property to be checked. This parameter can be a name of any property field as it appears in the Layer property sheet in TerraExplorer (e.g., “Line Color”).

Return Value

pValue

A Boolean indicating whether a classification XML was set for the specified property.

Exceptions

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

OpenStyleEditorDialog

Opens the Field by Attribute dialog box to control the appearance and behavior of layer features based on field attribute values. For example, you can represent the number of people living in a country attribute by the line color of the country's boundary.

 

JavaScript

 

OpenStyleEditorDialog(

       Name)

 

C#

 

void OpenStyleEditorDialog (

       string Name)

 

C++

 

HRESULT OpenStyleEditorDialog (

       [in] BSTR Name)

Parameters

Name

The name of the property whose value is to be set based on attribute value. The parameter can be a name of any property field that can be styled based on attribute value, as it appears in the Layer property sheet in TerraExplorer (e.g., “Point Color”).

Exceptions

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

 

RemoveFeature

Removes a feature from the group.

 

JavaScript

 

RemoveFeature(

       ObjectID)

 

C#

 

void RemoveFeature(

       string ObjectID)

 

C++

 

HRESULT RemoveFeature(

       BSTR ObjectID)

Parameters

ObjectID

The ID of the feature to remove.

Exceptions

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

SetClassification

This method sets a classification XML for a specified property of the group’s features. Classification XML is used for persistence of a classification which is defined in the TerraExplorer Pro GUI. When a classification is defined using the Field by Attribute dialog box, you can use GetClassification to retrieve an XML that defines this classification. SeeFeature Layers” chapter in the User Manual. Use SetProperty to set a value (e.g., set “Text” to “Bus Station”) for a specified property instead.

 

JavaScript

 

SetClassification(

       Name,

       Value)

 

C#

 

void SetClassification(

       string Name,

       string Value)

 

C++

 

HRESULT SetClassification(

       BSTR Name,

       BSTR Value)

Parameters

Name

The name of the property to be set. The parameter can be a name of any property field as it appears in the Layer property sheet in TerraExplorer (e.g., “Line Color”).

Value

The value of the property. This parameter can be a classification XML.

Exceptions

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

SetProperty

This method sets the value of a specified property of the specified group’s features. Unlike the SetClassification method, SetProperty cannot set classification values. See: SetClassification for further details.

 

JavaScript

 

SetProperty(

       Name,

       Value)

 

C#

 

void SetProperty(

       string Name,

       object Value)

 

C++

 

HRESULT SetProperty(

       BSTR Name,

       VARIANT Value)

Parameters

Name

The name of the property to set. The parameter can be any property field name as it appears in the Layer property sheet in TerraExplorer (e.g., “Line Color”).

Note:    This parameter must be in English even when the user interface is in a different language.

Value

The value to assign to the property. Pass the variable type that is expected for the specified property, e.g. for “Line Color” pass a long type value.

If the property is a drop-down menu, pass the zero-based integer index of the order in the list. For example, for “Activation Action” pass 0 for “Fly To” and 1 for “Circle Pattern”. See below for an additional example:

lock96

There are a few exceptions to this rule:

·          All Yes/No drop-down lists – Use 0 for No and 1 for Yes.

sadasda

·          Pivot Alignment” – Use 10 based index (i.e., the index origin = 10 so Top Left = 10).

·          “Text Alignment”– Use 10 based index (i.e., the index origin = 10 so Top Left = 10).

·          “Altitude Method” – Use 10-Relative to terrain, 11-Absolute, 12-On terrain, 13-Relative to pivot, 14-Relative to 3DML.

·          “Image Max Size” – Divide the value you want to set by 32. For example, to set a maximum image size of 100, pass 100/32.

·          “Line Pattern” – Use the line style value (e.g. for solid line, use 0xFFFFFFFF). See ILineStyle. Pattern.

Exceptions

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