ArcGIS Select Buffer tool


Purpose
This sample illustrates how to show selected features and buffer geometry with ArcGIS for Server data sources in the Web Application Developer Framework (ADF). The Select tool works with ArcGIS for Server data sources. The value objects and proxies in the ArcGIS for Server Simple Object Access Protocol (SOAP) application programming interface (API) provided with the Web ADF will work with Local and Internet data source types.
When working with ArcGIS for Server implementation of the Web ADF Common API, value objects are used, such as the MapDescription value object returned from MapFunctionality.MapDescription. The Select tool illustrates how to use the SOAP API to render features in a layer as selected. The Buffer tool uses the ArcGIS for Server Geometry service to buffer input geometry. The resulting buffer geometry is used to select features in the active layer. To construct the most accurate buffer possible, a dynamic hotine projection centered on the buffer is created on-the-fly. The buffer geometry is projected back into the map projection using the Geometry service and drawn on the map image generated by ArcGIS for Server. The SOAP API for a map service provides custom graphics capabilities via the GraphicElement value object types and MapDescription.CustomGraphics property.

How to use

If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

At design time
  1. Verify that the Web ADF for the .NET Framework is installed and functioning properly. For information on installing and configuring the Web ADF, consult the installation guide.
  2. In Windows Explorer, navigate to <ArcGIS Developer Kit install location>\Samples\ServerNET\ArcGIS_SelectBufferTool. You will see a CSharp and VBNet folder.
  3. In Windows Explorer, open the directory referencing the language of your choice (that is, CSharp or VBNet). Copy the folder, ArcGIS_SelectBufferTool_<language>, to c:\inetpub\wwwroot. The <language> variable can be CSharp or VBNet.
  4. Open the IIS Manager from Control Panel, Administrative Tools, Internet Information Services (IIS) Manager, or Internet Information Services.
  5. In the console tree view on the left, navigate to Local Computer, Web Sites, Default Web Site.
  6. Expand Default Web Site, right-click the ArcGIS_SelectBufferTool_<language> folder, and click Properties.
  7. On the Directory tab, click the Create button in the Application Settings section of this panel. Click OK to close the Properties dialog box.
  8. Start Visual Studio 2010 open the solution located in the c:\inetpub\wwwroot\ArcGIS_SelectBufferTool_CSharp folder.
  9. In the Solution Explorer, right-click Default.aspx and select Set As Start Page.
  10. Open the Default.aspx page in design view. Open the properties window for the MapResourceManager control. Click the ellipsis next to the ResourceItems property. The ResourceItem Collection Editor dialog box appears.
  11. Add or change the MapResourceItem associated with an ArcGIS for Server map service.
  12. To change the Geometry service uniform resource locator (URL) used in the Buffer tool, open the CustomTools code file and change the geometryServiceUrl property. By default, the value is http://tasks.arcgisonline.com/arcgis/services/Geometry/GeometryServer.
  13. Save the project.
  14. In Visual Studio, click the Debug drop-down menu and choose Start.

At run time
  1. Browse to the viewer's URL (for example, http://localhost/ArcGIS_SelectBufferTool_CSharp) or start the Web application in Visual Studio 2010.
  2. Select an active layer from the drop-down list. Use the Select tool and drag a rectangle on the map to select features in the active layer. Selected features show in yellow.
  3. Clear graphics and optionally select another active layer from the drop-down list. Define a buffer distance and units. Changing the units convert the buffer distance accordingly. Use the Buffer tool to digitize a polygon on the map. The polygon will be rendered with a solid cyan fill. The buffer around the polygon will be rendered with a red diagonal fill and solid black border. Features in the active layer that intersect the polygon and buffer will be selected and displayed using a yellow fill.

ArcGIS_SelectBufferTool_CSharp\Default.aspx User interface (UI) for the Web application.
ArcGIS_SelectBufferTool_CSharp\Default.aspx.cs The code behind the UI.
ArcGIS_SelectBufferTool_CSharp\App_Code\CustomTools.cs Class library containing custom Buffer and Select tool implementations.
ArcGIS_SelectBufferTool_CSharp\App_Code\Utility.cs Basic utility classes.
Download the C# files
ArcGIS_SelectBufferTool_VBNet\Default.aspx User interface (UI) for the Web application.
ArcGIS_SelectBufferTool_VBNet\Default.aspx.vb The code behind the UI.
ArcGIS_SelectBufferTool_VBNet\App_Code\CustomTools.vb Class library containing custom Buffer and Select tool implementations.
ArcGIS_SelectBufferTool_VBNet\App_Code\Utility.vb Basic utility classes.
Download the VB.NET files

Download the files for all languages