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 can 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: specify that the tools are stored in a map; specify the path to the USA_Data_ClipTools.mxd; and 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 Developer Kit install location>\Samples\ServerNET. This folder contains ArcGIS_ClipShip_Geoprocessing CSharp and VBNet folders.
- Open the folder of the language you are going to use (that is, CSharp or VBNet) and copy the ArcGIS_ClipShip_Geoprocessing_<language> folder to c:\inetpub\wwwroot. The <language> variable can be CSharp or VBNet.
- Open the IIS Manager from the 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 appears.
- Click the Directory tab, click the Create button in the Application Settings section, then click OK to close the Properties dialog box.
- Start Visual Studio 2010 and open the solution located in the c:\inetpub\wwwroot\ArcGIS_ClipShip_Geoprocessing_CSharp folder.
- In the 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 add a buffer distance.
- Select 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 a Web ADF feature graphics layer or a map image associated with a map resource. If Download Results was selected, a dialog box appears 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