ArcGIS Server Banner

GP Service step-by-step: Buffer points

GP Service step-by-step: Buffer points

Release 9.3 E-mail This TopicPrintable VersionGive Us feedback
Note: This topic was updated for 9.3.1.


Folder BufferPoints
Purpose Creates polygons around points
Services BufferService (geoprocessing service)
Geoprocessing tasks Buffer Points
Inputs User digitizes a point
Outputs Polygon
Data None
Extensions None
Of note The most basic service of all the examples

Corresponding Folder

C:\arcgis\ArcTutor\GP Service Examples\BufferPoints contains the completed model and data. After completing all the steps described below, you will have duplicated the contents of this folder.

Data preparation

Create a toolshare folder

  1. Start ArcCatalog.
  2. Create a new folder named BufferPts in a location of your choice, as follows:
  3. In the catalog tree, right-click BufferPts, point to New, then click Folder.
  4. Name the folder ToolData.
  5. In the catalog tree, right-click ToolData, point to New, then click File Geodatabase.
  6. Name the file geodatabase Schema.gdb.
  7. Using the same steps, create a folder within BufferPts named Scratch. Within Scratch, create a new file geodatabase named Scratch.gdb.

Create the toolbox

In the catalog tree, right-click BufferPts, point to New, then click Toolbox. Name the toolbox BufferService.

Create schema feature class

You will need a point feature class to use as a schema for the feature set variable you will use in the model described below.

  1. In BufferPts/ToolData/Schema.gdb, right-click, point to New, and click Feature Class.
  2. Name the feature class Points.
  3. The feature type is Points.
  4. Click Next.
  5. For a coordinate system, choose Geographic Coordinate Systems > World > WGS 1984. (Although you can choose Unknown as the coordinate system, it is not good practice to do so.)
  6. Click Next.
  7. Accept the default XY Tolerance and click Next.
  8. Accept the default Configuration keyword and click Next.
  9. Click Finish (the feature class does not contain any user-defined attributes).

Completed working folder

Create the model

With the steps below, you will create a new geoprocessing model to buffer point features.

  1. Right-click BufferService (the toolbox you created above), point to New, then click Model. This opens the ModelBuilder window.
  2. In this step, you will be adding the Buffer tool. Click Add Add Data or Tools on the ModelBuilder toolbar. In the Add Data dialog box, navigate to Toolboxes > System Toolboxes > Analysis Tools > Proximity as illustrated below. Click Buffer, then click Add. (An alternative to this method is to drag and drop the Buffer tool from the ArcToolbox window onto the ModelBuilder canvas.)
  3. Adding the Buffer tool

  4. The ModelBuilder canvas should now appear as follows:
  5. Model with Buffer process

  6. When using ModelBuilder, you often need to move and resize elements (tools and variables). In the illustration above, the output variable is actually named Output Feature Class, but the name is truncated because of the size of the variable. To resize, click the output variable then click and drag one of the small blue selection squares. Now your model should look as follows:
  7. After resizing the output variable

  8. Right-click Buffer, point to Make Variable > From Parameter, then click Input Features, as illustrated below.
  9. Making a variable from a tool parameter

    The model should now look as illustrated below.

    Input features as a variable

  10. Right-click Input Features and click Properties. In the Input Features Properties dialog box, click the Data Type tab.
  11. In the Select data type drop–down list, illustrated below, choose Feature Set. In the Import schema and symbology from text box, enter BufferPts/ToolData/Schema.gdb/Points, the point feature class you created in the above steps.
  12. Data type properties

  13. Click OK. The Input Features variable will now be a blue color.
  14. Right-click Buffer, point to Make Variable > From Parameter, then click Distance [value or field].
  15. A new model variable is created. You may need to click and drag the variable so that it is not on top of the Input Features variable and resize it to show the complete variable name. The model should now appear as illustrated below.
  16. Model with distance variable

  17. Right-click the Distance [value or field] variable and click Rename. Rename the variable to Distance.
  18. Right-click Distance, click Properties. In the Distance Properties dialog box, click the Data Type tab.
  19. In the Select data type drop–down list, choose Linear Unit.
  20. Click OK.
  21. Double-click Distance (or right-click and click Open). Set the distance to 1,000 meters. The Distance variable will now be a blue color, and the Output Feature variable will be a green color. This signifies that all required inputs to Buffer have been provided.
  22. Right-click the Output Feature Class variable (the output of Buffer) and click Rename. Rename the variable to Output Polygons.
  23. Double-click Output Polygons and enter %scratchworkspace%\BufferedPoints.shp, as illustrated below.
  24. Output location

  25. Click OK.
  26. Right-click Input Features and click Model Parameter. P (for Parameter) will appear next to the variable.
  27. Right-click Distance and click Model Parameter. P (for Parameter) will appear next to the variable.
  28. Right-click Output Polygons and click Model Parameter. P (for Parameter) will appear next to the variable.
  29. The model should now appear similar to the illustration below.
  30. Completed model

  31. In the main ModelBuilder menu, click Model, then click Model Properties.
  32. The illustration below shows these settings.

    Model Properties

  33. Click OK.
  34. In the main ModelBuilder menu, click Model and click Save. Then click Model again and click Close.

Test the model

In the next series of steps, you will test your model using ArcMap—always a good idea before publishing a service.

  1. Open ArcMap and add data to create a map.
  2. In the ArcMap standard toolbar, click the Tools menu, then click Options.
  3. In the Options dialog box, click the Geoprocessing tab.
  4. Show the ArcToolbox window by clicking Show/Hide ArcToolbox Window Show/Hide ArcToolbox Window.
  5. Right-click in the ArcToolbox window, then click Add Toolbox.
  6. Navigate to your toolshare folder and choose the BufferService toolbox you created above.
  7. BufferService will now appear in the ArcToolbox window. Expand BufferService to display its contents (the Buffer Points tool), as illustrated below.
  8. ArcToolbox window with the BufferService toolbox added

  9. Double-click Buffer Points. (Optionally, you can right-click Buffer Points and click Open). This will open the Buffer Points tool dialog, as illustrated below. (The illustration uses c:\arcgis\ArcTutor\Map\airport.mxd as the map.)
  10. Buffer Point tool dialog

  11. Click Add feature Add feature to add a point feature to buffer. You can add more than one feature.
  12. Learn more about using the feature set control to add features

  13. Optionally, change the Distance parameter.
  14. Click OK.
  15. The progress dialog will appear. When the tool finishes execution, a new layer named BufferedPoints will be added to the ArcMap table of contents.
  16. Exit ArcMap. You do not need to save your changes.

Publish the service

In order to publish a toolbox to ArcGIS Server, you must have administrator access to ArcGIS Server, as illustrated below. To connect to a server, expand the GIS Servers entry in the ArcCatalog tree and click Add ArcGIS Server. The illustration below shows a connection to a server named cogitator. Your server administrator—the person in charge of setting up and maintaining accounts for your ArcGIS Server installation—is responsible for setting up an account for you and granting you administrator privileges.

Administrator access

Once you have established an administrator connection to ArcGIS Server, you are ready to publish your toolbox.

  1. In ArcCatalog, right-click BufferServices and click Publish to ArcGIS Server.
  2. In the Publish to ArcGIS Server dialog box, choose the server you wish to publish to. Name the service BufferServices (this is the default name—the same as the name of the toolbox).
  3. Click Next.
  4. Click Finish.

Learn more about publishing geoprocessing services

Use the service

In the next series of steps, you will use your service in ArcMap.

  1. Open ArcMap and add data to create a map
  2. Show the ArcToolbox window by clicking Show/Hide ArcToolbox Window Show/Hide ArcToolbox Window.
  3. Right-click in the ArcToolbox window, then click Add Toolbox.
  4. In the Look in drop–down list, choose GIS Services. This will list all available servers.
  5. Double-click the server containing the service you published.
  6. Click BufferService, then click Open.
  7. BufferService will now appear in the ArcToolbox window. Expand BufferService to display its contents (the Buffer Points tool).
  8. Double-click Buffer Points. (Optionally, you can right-click Buffer Points and click Open). This will open the Buffer Points task dialog, as illustrated below. Note that unlike the Buffer Points tool dialog (shown above) when you tested your model, this dialog does not show the Output Polygons parameter. This is because ArcGIS Server will write the output polygons to a location on the server (defined by %scratchworkspace%) and there is no need for you to specify an output location.
  9. BufferPoint task dialog box

  10. Click Add feature Add feature to add a point feature to buffer. You can add more than one feature.
  11. Learn more about using the feature set control to add features

  12. Optionally, change the Distance parameter.
  13. Click OK.
  14. The progress dialog will appear. Note that the task is submitted to the server as illustrated below. After the task is submitted, you can close the progress dialog.
  15. Submitting task to server

  16. It should only take a few moments for the task to complete. A new layer will be added to the ArcMap table of contents. This layer will be named Output Polygons [<time>_<date>], as illustrated below.
  17. Output Polygons layer

  18. Anytime you execute a geoprocessing tool, a result is written to the Results tab of the ArcToolbox window. Click the Results tab, expand Current Session, then expand the BufferPoints entry. Note how you can view outputs, inputs, environments, and messages for the execution of the task.
  19. Learn more about using results

  20. In the next series of steps, you will be modifying the BufferService properties and running the Buffer Points task again to see the effect of changing these properties. Therefore, you do not want to exit ArcMap.

Modifying service properties

By changing service properties, you can affect how tasks execute.

  1. In ArcCatalog, navigate to the server containing the BufferService geoprocessing service.
  2. Right-click BufferService and click Stop.
  3. Right-click BufferService and click Service Properties.
  4. Click the Parameters tab.

There are three basic parameters that you can modify that affect how the task executes. Change these parameters as discussed below, click OK, then start the service (right-click BufferService and click Start). Then run the task again in ArcMap to see the effect.

Execution type

Synchronous means that client waits until the server has finished executing the task. Asynchronous means that the client is free to do other work while the server executes the task. You should choose synchronous only for tasks that execute quickly.

BufferService has one task, Buffer Points, and this task executes quickly. Change the execution type to synchronous, restart the service, then execute Buffer Points again. With a synchronous service, the progress dialog remains open until the task executes.

Maximum Number of Records Returned by Server

The number you enter is the maximum number of records or features that can be transferred from the server to the client. A value of zero means no records can be transferred. The default is 500. After stopping the service again, change the value to zero, restart the service, and execute Buffer Points again. The task will execute and a layer will be created, but there are no features since the maximum is set to zero. If you view the result in the Result tab, Output Polygons will have <data exceeds transfer limit>.

Show Messages

Geoprocessing models write messages during the execution of model processes. These messages include warnings, errors, and informational messages. These messages can contain pathnames to data residing on your server or local area network, and you may not want the pathnames to this data to be viewed by users. By default, messages are not shown.

Check Show Messages, restart the service, then execute Buffer Points again. You should see more messages in both the progress dialog (if the service is running synchronously) and the result.

When you are developing and testing services, you almost always want to show messages.

See Also

  • Guide to the geoprocessing service examples