[GIS] Accepting shape as input parameter in web application that calls ArcGIS geoprocessing service

arcgis-10.1arcgis-serverfeature-setgeoprocessing-service

I am writing a geoprocessing script that will need to accept a shape as an input parameter. This shape will be obtained by a user drawing the shape in a web application. The web application will execute the geoprocessing service, providing the coordinate string of the shape as an input parameter.

In the geoprocessing script tool's definition, I would assume that this input parameter would be of type FeatureSet and that within the script you would use arcpy.GetParameter to access this input parameter. Where I know that the input parameter will always be exactly one feature (string of coordinates), is there a better alternative than using a FeatureSet as the input parameter type?

Best Answer

If your users will be "digitizing" shapes, then you'll want to use the FeatureSet parameter. This parameter is meant to take simple input features (usually drawn as you've described).

inFS = arcpy.GetParameterAsText(0)

arcpy.Buffer_analysis(inFS, "output", "100 Miles")
Related Question