In this topic
- Editor library
- Accessing customizations
- Working in an edit workspace and edit session
- Creating and editing features
- Working with attributes
- Snapping
- Edit events
Editor library
ArcGIS editing functionality in the ArcGIS for Desktop is delivered through the Editor library. This library supports the editing of simple features, network features, annotations, and topological features, as well as attributes for these features. It provides a rich user interface (UI) that includes the collection of editor commands, tools, and feature templates, as well as an application programming interface (API).
Other relevant libraries
When developing editing customizations, you'll usually incorporate concepts and functionality from other libraries. Some of the more important libraries are described as follows:
- Geodatabase library—Provides access to the underlying feature classes, tables, and rows (features). The Geodatabase library maintains the versioning environment in ArcSDE geodatabases and the relationships between tables. This library contains a lower level editing API that exposes workspaces and edit sessions, which are mapped to equivalents in the Editor library. Desktop developers should use the Editor library to access and maintain workspaces and edit sessions when working with editing customizations.
- Geometry library—Provides access to the top level geometry objects such as points, polylines, and polygons. Creating and maintaining features with the editor means you will be working with these objects out of necessity, even if you're only working with the edit sketch. Geometries also encompass the concept of the spatial reference and coordinate systems, essentially defining where features are.
- Framework library—Provides extensibility for the editor, allowing you to host your customizations in menus, commands, tools, and extensions.
Accessing customizations
Determining how your customizations are exposed to the end user is usually the first decision you need to make. The editing framework can be customized to add your own commands, tools, extensions, shape constructors, edit tasks, and object inspectors. The type of customization to use is largely based on how the end user will interact with it.
Many customizations can be built and deployed as add-ins, while others require development of custom components. For general information on add-ins, see Building add-ins for ArcGIS for Desktop. For general information on components, see Extending ArcObjects.
For more information on developing customizations using add-ins, see Customizing the editor framework using add-ins.
For more information on developing customizations using components, see Editor framework customizations.
Developing and deploying your customizations as add-ins is the preferred method.
The following table shows the various editor customization types and their supported customization methods:
Customization type |
Add-in |
Component |
Yes |
Yes | |
|
Yes |
Yes |
Yes |
Yes | |
|
Yes |
Yes |
Yes |
Yes | |
No |
Yes | |
No |
Yes | |
No |
Yes | |
Snap agents |
No |
Yes |
Edit sketch extensions |
No |
Yes |
Commands
Edit commands are usually buttons or menu items on toolbars in the UI. Their functions typically work with a selected set, a whole layer, or manipulate the editing environment in some way. Commands do not interact with the display, so if you require that the user draw a sketch, select features, or define an area, you need to write a tool instead. The Move, Buffer, and Clip commands are examples of edit commands.
The items on the Editing menu, the Sketch Tool context menu, and the Edit Sketch context menu are also implemented as commands. Most of these commands perform an edit operation, but a few, such as Snapping, open other controls.
Tools
Tools are located on toolbars and allow the user to interact with the display in some manner. Custom tools can be used to define areas, create a sketch with the shape constructors, or select features for an edit operation. The Cut Polygon and Reshape Features tools on the Editor toolbar are examples of edit tools.
Construction tools—such as the Point, Line, Polygon, and Circle tools—are used to create features in the template environment.
Extensions
Editor extensions are similar to standard application extensions but activate when the edit session starts. For more information on extensions, see Creating an application extension and Customizing the editor framework using components.
The most common editor extension is one that responds automatically to editor events such as creating or modifying a feature in an edit session, typically for validation purposes. These extensions include code to listen and respond to specific events.
The other type of editor extension delivers a collection of commands and tools that expose or utilize common functionality. The topology editor is an example of an extension of this type.
Shape constructors
Shape constructors determine how the next vertex in an edit sketch will be created using the current construction tool. For example, with the Line or Polygon construction tool active, you can create straight line, curved, trace, or mid-point segments to construct your feature. The Point tool allows you to create points via the point shape constructor. Some tools, such as the Rectangle and Circle tools, have their shape construction built-in and do not use the standard shape constructors on the Editor toolbar.
Tasks
Edit tasks can be found on the Edit Task drop-down menu when working with the non-template UI. Edit tasks work with the edit target layer and the sketch tools to perform an operation. You generally do not need to develop edit tasks unless the user will be working in the non-template environment.
Object inspectors
The editor Attributes window contains two panels: one panel lists the features in the focus map that are selected and editable, the other panel contains an object inspector. ArcMap contains a standard object inspector, the feature inspector, that enables attribute editing.
For a feature class that resides in a geodatabase, you can replace the default object inspector with a custom inspector. Custom object inspectors can be assigned to specific feature classes. Selecting a feature in the feature panel of the Attributes window activates the associated object inspector in the other panel.
Working in an edit workspace and edit session
Once you have decided how the customization will be delivered to the end user, you can begin developing the customization. All editing customizations reference the editor and work within an edit workspace and edit session. A workspace is a container of spatial and non-spatial datasets, such as feature classes, raster datasets, and tables. The following are the three types of workspaces:
- File system workspace—Shapefiles in a folder are an example.
- Local geodatabase workspace—Personal and file geodatabases are examples.
- Remote geodatabase workspace—An ArcSDE geodatabase stored in a relational database management system (RDBMS), such as Oracle, DB2, SQL Server, or Informix, is an example.
Your map can contain layers from many different workspaces; however, when you start editing, you can only edit layers from one workspace at a time. If your customization assumes the user will initiate the edit session from the desktop UI, the customization should only be available while editing. Alternatively, if you programmatically start an edit session, you are responsible for working in the correct workspace. See Managing edit sessions and edit operations for information and code samples.
Creating and editing features
The topics Creating features in the editor and Updating geometry of existing features describe how to use the editor to create and edit features, respectively.
Working with attributes
You commonly work with attributes after creating or modifying existing features. Updating attributes of existing features describes the process of working with feature class fields, updating attribute values, and storing them with the feature during an edit session. Using feature templates describes how to populate default values for features.
Snapping
Snapping is often used in conjunction with custom tools that supply geometry or feedback for a customization. For example, your tool creates a line feedback as it moves and you want the points at the mouse clicks to snap. If you're using the edit sketch to provide the geometry for your customization, snapping is already built into the sketch tool and will occur according to the current snap environment.
The snapping environment options are as follows:
- The editor snapping environment enables snapping in your customizations and gives you finer control over what type of geometry to snap to on a feature (edge, vertex, or line).
- The ArcGIS snapping environment offers a simpler snapping API for your tools and is available to Desktop and Engine developers outside the editor.
The ArcGIS snapping environment is recommended.
Edit events
The editor broadcasts editing events that you can use in your customizations, including when the editor creates or modifies features, starts or stops an edit session, and when you work with the edit sketch. You can subscribe to these events to (for example) create customizations that validate features, include feature logging, or populate external tables. Working with editing events describes the edit events and the best practices to work with them.
See Also:
Customizing the editor framework using add-insEditor framework customizations
Development licensing | Deployment licensing |
---|---|
ArcGIS for Desktop Basic | ArcGIS for Desktop Basic |
ArcGIS for Desktop Standard | ArcGIS for Desktop Standard |
ArcGIS for Desktop Advanced | ArcGIS for Desktop Advanced |