How to use
Data has been provided for your use with this sample. It can be found at
<Your ArcGIS Developer Kit Install directory>/Samples/data/GP/RunClip/USA_data_ClipTools and <Your ArcGIS Developer Kit Install directory>/Samples/data/USA/USA.gdb.
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
- In the sample's data directory, publish the USA_Data_ClipTools.mxd map document as a map service named USA_Data_ClipTools. Depending on how you publish the document, a geoprocessing service of the same name may be created at the same time. If not, explicitly publish the ClipTools toolbox as a geoprocessing service named USA_Data_ClipTools. In ArcCatalog or ArcGIS Server Manager, configure the service by changing the following properties on the Parameters tab: a) specify that the tools are stored in a map, b) specify the path to the USA_Data_ClipTools.mxd, and c) set the result map service to USA_Data_ClipTools (the service created earlier).
- 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.
- In Windows Explorer, navigate to <ArcGIS install location>\DeveloperKit10.0\Samples\ServerNET. This folder contains ArcGIS_ClipShip_Geoprocessing CSharp and VBNet folders.
- Open the folder of the language you're going to use—CSharp or VBNet—and copy the ArcGIS_ClipShip_Geoprocessing_<language> folder to c:\inetpub\wwwroot. The <language> variable can be either CSharp or VBNet.
- Open the IIS Manager from Control Panel > Administrative Tools > Internet Information Services (IIS) Manager or Internet Information Services.
- In the console tree view on the left, navigate to Local Computer > Web Sites > Default Web Site, expand Default Web Site, right-click the ArcGIS_ClipShip_Geoprocessing_<language> folder, and click Properties. The Properties dialog box opens.
- Click the Directory tab, click the Create button in the Application Settings section, then click OK to close the Properties dialog box.
- Start Microsoft Visual Studio. Open the solution for the version of Visual Studio you're using. The Visual Studio version is appended to the solution file name. For example, the Visual Studio 2008 solution file is ArcGIS_ClipShip_Geoprocessing_CSharp2008.sln and is located in the c:\inetpub\wwwroot\ArcGIS_ClipShip_Geoprocessing_CSharp folder.
- In Solution Explorer, right-click Default.aspx, and select Set As Start Page.
- Save the project.
- Click the Debug drop-down menu and click Start.
At run time
- Browse to the viewer uniform resource locator (URL) (for example, http://localhost/ArcGIS_ClipShip_Geoprocessing_CSharp).
- In the toolbar above the map, click Add Lines, click the map, and create one or more lines.
- Select the buffer distance units, and enter a buffer distance.
- Check the Download Results check box to return a ZIP file for download.
- Click the Buffer And Clip button. The geoprocessing service asynchronously processes the request. An indicator (an animated graphics interchange format [GIF] image) next to the button displays until the geoprocessing request is finished. An initial JavaScript delay is set to five (5) seconds. You can change this in the CheckGeoprocessingJobStatus method in the code behind the page.
- When finished, the buffer polygons are drawn on the map as either a Web ADF feature graphics layer or a map image associated with a map resource. If Download Results was checked, a dialog box opens in the browser that allows you to download the ZIP file containing the clipped features as a shapefile. Alternatively, you can modify the code to provide a link to the download instead, which requires trusted privileges.
ArcGIS_ClipShip_Geoprocessing_CSharp\Default.aspx | Default page contains a set of tools and controls to provide input for a call to a geoprocessing service. |
ArcGIS_ClipShip_Geoprocessing_CSharp\Default.aspx.cs | Code behind the user interface (UI). Contains the code to initiate a request and process the response to and from a geoprocessing service. |
ArcGIS_ClipShip_Geoprocessing_CSharp\App_Code\PolylineTool.cs | Contains tool code used to add an ADF graphics polyline to the map for use in the call to the geoprocessing service. |
ArcGIS_ClipShip_Geoprocessing_CSharp\App_Code\Utility.cs | Class library containing helper code. |
ArcGIS_ClipShip_Geoprocessing_VBNet\Default.aspx | Default page contains a set of tools and controls to provide input for a call to a geoprocessing service. |
ArcGIS_ClipShip_Geoprocessing_VBNet\Default.aspx.vb | Code behind the user interface (UI). Contains the code to initiate a request and process the response to and from a geoprocessing service. |
ArcGIS_ClipShip_Geoprocessing_VBNet\App_Code\PolylineTool.vb | Contains tool code used to add an ADF graphics polyline to the map for use in the call to the geoprocessing service. |
ArcGIS_ClipShip_Geoprocessing_VBNet\App_Code\Utility.vb | Class library containing helper code. |
Download the files for all languages