jeffpickles

Moving Buffer Model to GP Service - Want to Use Selected Features

Discussion created by jeffpickles on Feb 10, 2011
Latest reply on May 6, 2011 by jeffpickles
I've created a simple Buffer model and published it as a geoprocessing service in ArcServer. It works well on the webapp, but only if the end-user creates a feature in the map. I'd like to be able to use selected features from a map layer as the input, but that option does not show up anywhere.

How can I make this happen?

The model graphic is attached below.

The exported Python code is:
# Import arcpy module
import arcpy

# Script arguments
Feature_to_Buffer = arcpy.GetParameterAsText(0)
if Feature_to_Buffer == '#' or not Feature_to_Buffer:
    Feature_to_Buffer = "in_memory\\{2EFC172F-AB9C-4846-904D-599448DA57BF}" # provide a default value if unspecified

Distance = arcpy.GetParameterAsText(1)
if Distance == '#' or not Distance:
    Distance = "500 Feet" # provide a default value if unspecified

Output_Buffers = arcpy.GetParameterAsText(2)
if Output_Buffers == '#' or not Output_Buffers:
    Output_Buffers = "%scratchworkspace%\\TEMP1.shp" # provide a default value if unspecified

# Local variables:

# Process: Buffer
arcpy.Buffer_analysis(Feature_to_Buffer, Output_Buffers, Distance, "FULL", "ROUND", "NONE", "")

The input is listed as a Feature Set data type. Output is in an accessible scratch workspace. I published the service as a TBX.

Attachments

Outcomes