com.esri.arcgis.carto
Interface IFeatureLayerDefinition

All Superinterfaces:
Serializable
All Known Implementing Classes:
CadAnnotationLayer, CadastralFabricSubLayer, CadFeatureLayer, CoverageAnnotationLayer, DimensionLayer, FDOGraphicsLayer, FeatureLayer, GdbRasterCatalogLayer, IFeatureLayerDefinitionProxy, ImageServerLayer, TemporalFeatureLayer

public interface IFeatureLayerDefinition
extends Serializable

Provides access to members that define a subset of the features from the underlying feature class.

Superseded By

IFeatureLayerDefinition2

Remarks

Use this interface to set a definition query on a layer so that only the features that meet the specified criteria are displayed. Use DefinitionExpression to access the definition query.
Also, you can use CreateSelectionLayer to create a new FeatureLayer based on an existing FeatureLayer's selected features. In the ArcMap user documentation and interface this new layer is called a selection layer.

You can use RelationshipClass to access the the relationship class, if one exists, that defines the relationship between the layer and the table that is joined to it. This same object can be accessed through IDisplayRelationshipClass::RelationshipClass. IDisplayRelationshipClass can be more convenient because it has multiple additionl methods and properties for working with layer joins.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


Method Summary
 IFeatureLayer createSelectionLayer(String layerName, boolean useCurrentSelection, String joinTableNames, String expression)
          Creates a new feature layer from the existing layer based on the current selection and the specified query expression.
 String getDefinitionExpression()
          Definition query expression for the existing layer.
 ISelectionSet getDefinitionSelectionSet()
          The selection set that defines the subset of features in a selection layer.
 IRelationshipClass getRelationshipClass()
          The current relationship class used to display related fields.
 void setDefinitionExpression(String expression)
          Definition query expression for the existing layer.
 void setRelationshipClassByRef(IRelationshipClass relClass)
          The current relationship class used to display related fields.
 

Method Detail

getDefinitionExpression

String getDefinitionExpression()
                               throws IOException,
                                      AutomationException
Definition query expression for the existing layer.

Description

Use the DefinitionExpression property to read or set the definition query for an existing layer just like you would in the Definition Query tab of the layer's properties dialog.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The expression
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDefinitionExpression

void setDefinitionExpression(String expression)
                             throws IOException,
                                    AutomationException
Definition query expression for the existing layer.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
expression - The expression (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDefinitionSelectionSet

ISelectionSet getDefinitionSelectionSet()
                                        throws IOException,
                                               AutomationException
The selection set that defines the subset of features in a selection layer.

Remarks

You can use the DefintionSelectionSet property to get the selection set that was used to define the new layer created by the IFeatureLayerDefintion::CreateSelectionLayer method. Note, before calling CreateSelectionLayer, the selection set returned by DefintionSelectionSet will be Nothing. Therefore, you can only use this property after you have called the CreateSelectionLayer method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.geodatabase.ISelectionSet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createSelectionLayer

IFeatureLayer createSelectionLayer(String layerName,
                                   boolean useCurrentSelection,
                                   String joinTableNames,
                                   String expression)
                                   throws IOException,
                                          AutomationException
Creates a new feature layer from the existing layer based on the current selection and the specified query expression.

Description

CreateSelectionLayer creates a new FeatureLayer from an existing FeatureLayer.
LayerName defines the new layer's name.
Set useCurrentSelection = TRUE here if you want to use the currently selected features on the existing layer.
joinTableNames may contain the name of related table(s) separated by commas. The existing join(s) will then be passed on to the new layer.
The DefinitionExpression parameter can be used to set a definition expression on the newly created layer but currently this will be defined at the feature class rather than at the layer level and will not show up in the UI. If you want to set a definition query on the newly created layer, it is best to use IFeatureLayerDefinition again to set the definition query after the layer has been created.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
layerName - The layerName (in)
useCurrentSelection - The useCurrentSelection (in)
joinTableNames - The joinTableNames (in)
expression - The expression (in)
Returns:
A reference to a com.esri.arcgis.carto.IFeatureLayer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getRelationshipClass

IRelationshipClass getRelationshipClass()
                                        throws IOException,
                                               AutomationException
The current relationship class used to display related fields.

Remarks

RelClass must be a defined relationship class on the base feature class.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.geodatabase.IRelationshipClass
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setRelationshipClassByRef

void setRelationshipClassByRef(IRelationshipClass relClass)
                               throws IOException,
                                      AutomationException
The current relationship class used to display related fields.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
relClass - A reference to a com.esri.arcgis.geodatabase.IRelationshipClass (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.