Cartographic representations


In this topic


Defining RepresentationClass

RepresentationClass is a feature class enabled with cartographic representation capabilities that are useful for symbolizing features in the geodatabase and editing the appearance of individual features on your maps. A representation class is also called a feature class representation. The representation information is stored in the geodatabase and can be overridden for individual features in places where graphic conflict arises or fine-tuning of symbology is required.
The workspace extension for managing representation classes is called RepresentationWorkspaceExtension. In the IRepresentationWorkspaceExtension interface, the method CreateRepresentationClass can be used to create new representation classes.
Creating feature class representations on a feature class results in the addition of two new fields: RuleID (fieldtype long to store RepresentationRule ID value) and Override (fieldtype binary large object [BLOB] to store feature-specific override information). A reference to a new or existing RepresentationRules object, which is a collection of rules used to represent features, must be present to create a new representation class. These representation rules are managed at the metadata level. See the following code example:
[Java]
static IRepresentationWorkspaceExtension getRepWSExt(IWorkspace pWorkspace)throws
    Exception{
    IWorkspaceExtensionManager extensionManager = new
        IWorkspaceExtensionManagerProxy(pWorkspace);
    IUID uid = new UID();
    uid.setValue("{FD05270A-8E0B-4823-9DEE-F149347C32B6}");
    return (IRepresentationWorkspaceExtension)extensionManager.findExtension(uid);
}

static IRepresentationClass createRepClass(IFeatureClass featureClass)throws
    Exception{
    IDataset idataset = new IDatasetProxy(featureClass);
    IWorkspace workspace = idataset.getWorkspace();
    IRepresentationWorkspaceExtension representationExtension = getRepWSExt
        (workspace);
    IRepresentationRules rules = new RepresentationRules();
    return representationExtension.createRepresentationClass(featureClass,
        featureClass.getAliasName() + "_Rep", "My_RuleID", "My_Override", false,
        rules, null);
}
A feature class can have multiple representation classes associated with it, giving you the ability to produce multiple maps from a single geodatabase. The representation class, however, is always associated with a single feature class to which it belongs.

What are representation rules and basic symbols?

Every representation class consists of a set of representation rules that govern the symbology for its feature representations. A regular RepresentationRule consists of multiple layers of basic symbols. These symbols are BasicMarkerSymbol, BasicLineSymbol, and BasicFillSymbol for drawing markers, line strokes, and polygon fill patterns, respectively. 
More complex symbology can be achieved by including one or more geometric effects in a representation rule. A GeometricEffect is a dynamic process that alters geometry at draw time. It can also change geometry type. For example, point, line, or polygon geometries can be processed through a GeometricEffectBuffer to produce buffer polygons around them. 
Use the IRepresentationRuleInit interface to convert a standard ArcGIS symbol to a basic symbol that can be used by a representation rule object to represent features in a representation class.

Marker placements

BasicMarkerSymbol is used to draw marker symbols and has marker, size, and angle as its graphic attributes. These properties can be managed using the IGraphicAttributes interface. The attributes are listed in the esriGraphicAttribute enumeration and are prefixed with esriGAMarker, such as esriGAMarkerSize. All BasicMarkerSymbol classes implement the IBasicMarkerSymbol interface, which has a single property, MarkerPlacement, on it.
A MarkerPlacement class is a marker placement style for placing markers. You can place either single or multiple markers depending on what MarkerPlacement you choose. For example, MarkerPlacementOnPoint places a single marker over a point, while MarkerPlacementAlongLine places multiple markers along a line.
The default marker placement for any basic marker symbol is OnPoint. Use the IMarkerPlacement interface to create and manipulate the properties of placement styles. The esriMarkerPlacementAttributes enumeration lists graphic attributes for all marker placements where each attribute is prefixed with esriGA(name)(attribute), such as esriGAInsidePolygonGridAngle, where InsidePolygon is the marker placement style and GridAngle is its graphic attribute. See the following code example:
[Java]
IBasicMarkerSymbol marker = new BasicMarkerSymbol();
IGraphicAttributes attributes = (IGraphicAttributes)marker;
attributes.setValue(1, createMarker());
attributes.setValue(2, 5);
attributes.setValue(3, 30);

static IRepresentationMarker createMarker()throws Exception{
    IRepresentationMarker marker = new RepresentationMarker();
    IRepresentationGraphics graphics = (IRepresentationGraphics)marker;
    IGeometry geometry = new Polygon();
    ISegmentCollection segCollection = (ISegmentCollection)geometry;
    IEnvelope env = new Envelope();
    env.putCoords( - 0.5,  - 0.5, 0.5, 0.5);
    segCollection.setRectangle(env);
    IFillPattern fillPattern = new SolidColorPattern();
    IRgbColor color = new RgbColor();
    color.setRed(0);
    color.setGreen(0);
    color.setBlue(250);
    IGraphicAttributes attributes = (IGraphicAttributes)fillPattern;
    attributes.setValue(0, color); //color
    IBasicFillSymbol basicFill = new BasicFillSymbol();
    basicFill.setFillPatternByRef(fillPattern);
    IRepresentationRule rule = new RepresentationRule();
    rule.insertLayer(0, (IBasicSymbol)basicFill);
    graphics.add(geometry, rule); //Add graphics to marker
    return marker;
}
BasicLineSymbol is used to draw stroke symbols. All BasicLineSymbol classes implement the IBasicLineSymbol interface, which has a single property, Stroke. LineStroke has width, caps, joins, and color for its graphic attributes. These attributes can be manipulated using the IGraphicAttributes interface. Use the ILineStroke interface to create and manipulate the properties of a new stroke symbol such as esriGraphicAttributeesriGAStroke.
BasicFillSymbol is used to draw fill symbols. All BasicFillSymbol classes implement the IBasicFillSymbol interface, which has a single property, FillPattern. There are three types of fill patterns: GradientPattern, LinePattern, and SolidColorPattern.
Graphic attributes of fill pattern classes
The following table shows the graphic attributes of each of these fill pattern classes:
Fill pattern class
Graphic attributes
GradientPattern
Algorithm
Angle
Color 1
Color 2
Intervals
Style
Percentage
LinePattern
Angle
Color
Offset
Step
Width
SolidColorPattern
Color
These attributes can be manipulated using the IGraphicAttributes interface. The attributes are listed in the esriGraphicAttribute enumeration and are prefixed with esriGA (fill pattern type), for example, esriGASolidColorPatternColor. Use the IFillPattern interface to create and manipulate the properties of a new fill pattern symbol.
GraphicAttributes are attributes used to define graphic properties for all MarkerPlacements, GeometricEffects, BasicMarkerSymbol, LineStroke, GradientPattern, LinePattern, and SolidColorPattern objects. A RepresentationClass also has a single graphic attribute for controlling its visibility property. All graphic attributes are enumerated into esriGraphicAttributes, esriGeometricEffectAttributes, and esriMarkerPlacementAttributes enumerations.
You must implement IMarkerPlacement, IGraphicAttributes, and IPersistVariant interfaces to create custom MarkerPlacements and IGeometricEffect, IGraphicAttributes, and IPersistVariant interfaces to create custom GeometricEffects.

Feature representations and overrides

Each feature in a feature class representation will be associated with a feature representation that is a cartographic depiction of the geographic feature. Use the GetRepresentation method on the IRepresentationClass interface to reference feature representations with respect to various map contexts.
Representations can be displayed using information from any of the following options:
Use the IRepresentation interface to manage the properties of a feature representation such as creating or modifying its shape overrides. Use the IOverride interface to manage the attribute overrides present for a feature representation. This interface cannot be used to set new attribute overrides. To set new attribute overrides, use the IRepresentation.Value property with the correct set of GraphicAttributes and the index of the attribute you want to alter.

Creating feature class representations

Creating feature class representations on a feature class results in the addition of two new fields: RuleID (fieldtype long to store RepresentationRule ID value) and Override (fieldtype BLOB to store feature-specific override information). A reference to a new or existing RepresentationRules object, which is a collection of rules used to represent features, must be present to create a new representation class. These representation rules are managed at the metadata level.
Creating a new feature class or modifying representation rules of an existing representation class requires exclusive schema lock. As a result, for Spatial Database Engine (SDE) databases, only the owner of the database can create new feature class representations or modify rules of existing representation classes.
Deleting a representation class results in the deletion of RuleID and Override fields except when the feature class is in a DB2 ArcSDE geodatabase.






Development licensingDeployment licensing
ArcGIS for Desktop BasicArcGIS for Desktop Basic
ArcGIS for Desktop StandardArcGIS for Desktop Standard
ArcGIS for Desktop AdvancedArcGIS for Desktop Advanced