I3DMLFeatureLayer80

I3DMLFeatureLayer80 supplies the properties and methods for interacting with the 3DML’s feature layers. It enables you to access information about the data source a 3DML’s feature layer is based on, perform actions (e.g. set message, tooltip, tint) on the feature layer, as well as execute spatial queries.

A 3DML represented by IMeshLayer80 can be loaded from file using the ICreator80.CreateMeshLayerFromFile method or from SkylineGlobe Server using the ICreator80. CreateMeshLayerFromSGS method.

 

 

Properties

 

DataSourceInfo

An IDataSourceInfo80 that gives the client access to information about the data source a 3DML’s feature layer is based on.

FeatureProperties

An I3DMLFeatureProperties80 that sets the value of a specified property of the specified layer’s features.  

ID

Gets the ID of the feature layer. (Inherited from ITerraExplorerObject80)

ObjectType

Gets an enum that identifies the type of the object. (Inherited from ITerraExplorerObject80)

Position

An IPosition80 representing the layer’s position on the terrain.

SaveInFlyFile

Gets and sets a Boolean that determines whether the feature layer is saved in the Fly file. (Inherited from ITerraExplorerObject80)

SelectedFeatures

An IFeatures80 that provides access to the feature layer’s currently selected features.

TreeItem

An ITreeItem80 describing the representation of the feature layer in the Project Tree.

 

Methods

 

ExecuteGetDataSourceFeatureIdQuery

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

ExecuteQuery

Returns a list of features that intersect with a selection area's geometry having a specified attribute value.

ExecuteSpatialQuery

Returns an IFeatures80 representing all the features that intersect with a selection area geometry according to the specified intersection type and renders all data in the 3D Window.

GetClientData

Gets an array of text strings assigned to each object global namespace. (Inherited from ITerraExplorerObject80)

GetParam

Reserved. Currently not used. (Inherited from ITerraExplorerObject80)

 

 

 

SaveAs

Saves layer changes to a file with a specified name.

SetClientData

Sets an array of text strings assigned to each object global namespace. (Inherited from ITerraExplorerObject80)

SetParam

Reserved. Currently not used. (Inherited from ITerraExplorerObject80)

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#

 

IFeatures80 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.

 

ExecuteQuery

This method returns all the features in a layer that match the attribute query. When a combined attribute and spatial query is required, an AreaFilter parameter can be defined that filters the returned features by a selection area geometry in addition to the attribute value.

Note:    In Javascript, if you do not want to use an area filter, you can call ICreator80. GeometryCreator.CreatePolygonGeometry(null)) to create a null IGeometry object.

Note:    When only a spatial query is required, “ExecuteSpatialQuery” can be called instead. Note that in addition to combining the spatial query with an attribute query, ExecuteQuery also offers the advantages of performing the query without rendering and of splitting the request into chunks (multiple “sub-queries”, each on a defined subset of the features). ExecuteSpatialQuery, on the other has the advantage of rendering all the data in the 3D Window. SeeExecuteSpatialQuery” for more information.

 

JavaScript

 

ExecuteQuery(

       AttributeFilter,

       NumOfFeatures,

       FromDataSourceFeatureId,

       AreaFilter) 

 

C#

 

IFeatures80 ExecuteQuery(

       string AttributeFilter,

       int NumOfFeatures = -1,

       string FromDataSourceFeatureId = "",

       IGeometry* AreaFilter)

 

C++

 

HRESULT ExecuteQuery(

       BSTR AttributeFilter,

       long NumOfFeatures,

       BSTR FromDataSourceFeatureId,

       IGeometry* AreaFilter,

       IFeatures80** pITerraExplorerObject)

Parameters

AttributeFilter

Any valid SQL WHERE clause that filters the layer’s features, thereby designating which of the layer’s features should be queried.

NumOfFeatures

The maximum number of features to query.

FromDataSourceFeatureId

The ID of the first feature that should be queried. When splitting a large query into multiple chunks (“sub-queries”),the FromDataSourceFeatureId for each subsequent call to ExecuteQuery should be set equal to the last feature ID of the previous call.

AreaFilter

An IGeometry representing the polygon, multipolygon, or linear ring that designates which part of the layer should be selected (only layer features that are spatially related to the polygon/ multipolygon/ linear ring will be selected).

Note:    In Javascript, if you do not want to use an area filter, you can call ICreator80. GeometryCreator.CreatePolygonGeometry(null)) to create a null IGeometry object.

Return Value

pIFeatures

An IFeatures80, containing all the features in the layer that have a specified attribute value. and intersect with the selection area geometry according to the attribute filter and area filter that were set.

Exceptions

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

ExecuteSpatialQuery

This method returns all the features that intersect with a selection area geometry according to the specified intersection type and renders all data in the 3D Window. If rendering of the data is not desirable for the spatial query, the ExecuteQuery method can be used instead. Note that in addition to combining the spatial query with an attribute query, ExecuteQuery also offers the advantages of performing the query without rendering and of splitting the request into chunks (multiple “sub-queries”, each on a defined subset of the features). ExecuteSpatialQuery, on the other has the advantage of rendering all the data in the 3D Window. SeeExecuteQuery” for more information.

 

JavaScript

 

ExecuteSpatialQuery(

       pIGeometry,

       IntersectionType)

 

C#

 

IFeatures80 ExecuteSpatialQuery(

       IGeometry pIGeometry,

       IntersectionType IntersectionType = IntersectionType.IT_INTERSECT)

 

C++

 

HRESULT ExecuteSpatialQuery(

       IGeometry* pIGeometry,

       IntersectionType IntersectionType,

       IFeatures80** pIFeatures)

Parameters

pIGeometry

§   A valid IGeometry derived object.

IntersectionType

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

·          IT_NONE = 0

·          IT_INTERSECT = 1
Select all features that geometrically intersect with the selection area.

·          IT_WITHIN = 2
Select only features whose entire geometry falls within the selection area drawn.

Return Value

pIFeatures

An IFeatures80, containing all the features that intersect with the selection area geometry according to the IGeometry properties set.

Exceptions

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

 

SaveAs

Saves the layer changes to a file with a specified name. Before saving, the layer can be filtered based on attribute and area filters. For security reasons the file is saved to a predefined “Skyline\TerraExplorer” folder in the “Application Data” space of the current user. The full path of the saved file is provided in the method’s return value. You can also use %APPDATA% in Windows Explorer to locate the path on your computer.

Note:    In Javascript, if you do not want to use an area filter, you can call ICreator80. GeometryCreator.CreatePolygonGeometry(null)) to create a null IGeometry object.

Note:    If the folder contains a file by the same name, the existing file is overwritten without a prompt.

Note:    The Application Data folder path changes between different users and different Windows operating systems. To find the path used by your client look at the %APPDATA% environment variable.

 

JavaScript

 

SaveAs(

       FileName,

       AttributeFilter,

       AreaFilter)

 

C#

 

string SaveAs(

       string FileName,

       string AttributeFilter,

       IGeometry AreaFilter)

 

C++

 

HRESULT SaveAs (

       BSTR FileName,

       BSTR AttributeFilter,

       IGeometry* AreaFilter,

       BSTR* OutFilePath)

Parameters

FileName

The name for the layer file. The layer can be saved as a shapefile (.shp), GeoPackage, GeoDatabase, PDF or SQLite (.sqlite).

·          When saving as a shapefile, the connection string must include the following parameters:

"FileName=NameOfShapeFile.shp;TEPlugName=OGR"

·          When saving as an Excel file, the connection string must include the following parameters:

"FileName=NameOfExcelFile.xlsx;TEPlugName=OGR"

Note:    Only point layers can be saved to Microsoft Excel.

·          When saving as an SQLite file, the connection string must include the following parameters:

"FileName=NameofFile;TEPlugName=OGR;LayerName=newlayername"

·          When saving as a GeoPackage, the connection string must include the following parameters:

"FileName=NameOfGeoPackageFile.gpkg;TEPlugName=OGR;LayerName=newlayername"

·          When saving as a GeoDatabase, the connection string must include the following parameters:

"FileName=NameOfGeoDatabaseFile.gdb;TEPlugName=OGR;LayerName=newlayername"

·          When saving as a Geospatial PDF, the connection string must include the following parameters:

"FileName=NameOfGeospatialPDFFile.pdf;TEPlugName=OGR;LayerName=newlayername"

Note:    A file name with a full path cannot be used here.

AttributeFilter

Any valid SQL WHERE clause that filters the layer’s features, thereby designating which of the layer’s features should be saved. If this parameter is set to “Selected Features”, all currently selected features are saved.

AreaFilter

An IGeometry representing the polygon or multipolygon that designates which part of the layer should be saved (only layer features that are spatially related to the polygon/ multipolygon will be saved).

Note:    In Javascript, if you do not want to use an area filter, you can call ICreator80. GeometryCreator.CreatePolygonGeometry(null)) to create a null IGeometry object.

Return Value

OutFilePath

A full path of the layer file being created.

Exceptions

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