ArcGIS Select Buffer Tool


Purpose This sample illustrates how to show selected features and buffer geometry with ArcGIS Server data sources in the Web ADF. The select tool is designed to work with ArcGIS Server data sources. The value objects and proxies in the ArcGIS Server SOAP API provided with the Web ADF will work with both Local and Internet data source types. When working with ArcGIS 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 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 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 install location>\DeveloperKit10.0\Samples\ServerNET\ArcGIS_SelectBufferTool. You will see both a CSharp and a VBNet folder.
  3. In Windows Explorer, open the directory referencing the language of your choice: CSharp or VBNet. Copy the folder, ArcGIS_SelectBufferTool_<language>, to c:\inetpub\wwwroot. The <language> variable may be either 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 then 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 dismiss the Properties dialog.
  8. Launch Microsoft Visual Studio (2008 or 2010). Open the solution for the version of the Visual Studio you are using. The Visual Studio version is appended to the solution file name. For example, the Visual Studio 2008 solution file is ArcGIS_SelectBufferTool_CSharp2008.sln and 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 should display.
  11. Add or change the MapResourceItem associated with an ArcGIS Server map service.
  12. To change the Geometry service 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 viewer's URL (for example, http://localhost/ArcGIS_SelectBufferTool_CSharp) -or- start the Web application within Visual Studio 2008.
  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 should be displayed in yellow.
  3. Clear graphics and optionally select another active layer from the drop down list. Define a buffer distance and units. Note, change the units will 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 for the Web application.
ArcGIS_SelectBufferTool_CSharp\Default.aspx.cs The code behind the user interface.
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 for the Web application.
ArcGIS_SelectBufferTool_VBNet\Default.aspx.vb The code behind the user interface.
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