Buffer snap agent


Purpose
This sample demonstrates how to create a snapping agent based on a buffer around the points of the current editable point feature class. In this sample, a snapped vertex of a feature will be located no closer than 1000 map units from the point that is closest to the cursor. For electrical datasets, it is common to snap primary lines to the boundary of the symbol representing a pole. Use this snapping agent with an appropriate buffer distance (based on the radius of the pole symbol).

How to use

See How to use ArcGIS samples for help on running the sample.

  1. Start the sample application. The golf.shp shapefile in the sample data is loaded into the Map control.
  2. Zoom in to a golf course feature on the map.
  3. Use the Editor menu on the toolbar to start an edit session. The editing controls on the toolbar are enabled.
  4. Enable the Buffer Snap Agent command, then activate the Sketch tool.
  5. Hover over an existing feature. The editing circle snaps to a buffer around the feature.

If you installed the samples feature, you will find the files associated with this sample in <Your Developer Kit install location>\DeveloperKit10.4\Java\Samples\ArcObjects.

editing/EditingApplication.java Entry point for the sample. It initializes the interop, sets up the user interface (UI), and ensures licensing is valid.
editing/BufferSnapAgent.java Contains the code to implement a custom snap agent that snaps to a buffered distance around a feature.
editing/EnableSnappingCommand.java Contains the code to implement a command that enables and disables the custom snap agent.




Development licensing Deployment licensing
Engine Developer Kit Engine
ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced