Hello,
I try to create from ArcGIS Pro a Buffer GP Service that accepts as input multiple geometry type (Point, Polygon, Polyline).
I tried this script :
import arcpy
arcpy.env.overwriteOutput = True
##arcpy.addOutputsToMap = True
if __name__ == "__main__":
inputFc = arcpy.GetParameterAsText(0)
outputFc = r"C:\temp\output_buffer.shp"
## arcpy.AddMessage(inputFc)
# Create a Describe object from the feature class
desc = arcpy.Describe(inputFc)
# Print Sahpe Type
## arcpy.AddMessage("Shape Type : " + desc.shapeType)
shpType = desc.shapeType
if(shpType == "Polygon"):
arcpy.AddMessage("Shape Type : " + desc.shapeType)
arcpy.analysis.Buffer(inputFc, outputFc, "500 meters")
elif(shpType == "Point"):
arcpy.analysis.Buffer(inputFc, outputFc, "500 meters")
elif(shpType == "Polyline"):
arcpy.analysis.Buffer(inputFc, outputFc, "500 meters")
It works with ArcGIS Pro :
However, when I publish the result of the script (from ArcGIS pro) to a Web Tool (GP Service), the Geometry Type is always the same that the input geomtry used in ArcGIS Pro :
Therefore, in a WAB application, i can choose only a point feature layer as input :
I think it's not possible because "The geometry type comes from the input and output features that are used to create the result" | Source : https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/share-analysis/web-tool-setting...
Is it really not possible ?
Is there a workaround ?
Do you have any idea ?
Thank you,
Bertrand
Solved! Go to Solution.
Hi @GeeteshSingh07,
You are right.
I created a model builder :
It works in MapViewer :
However, in WAB it still not able to run against a different geometry type compared to the original geometry used to create the tool in ArcGIS Pro :
I found about a bug :
BUG-000161045 : When adding a geoprocessing service as a widget to ArcGIS Web AppBuilder, the tool does not honor the same geometry types as the geoprocessing tool
Thank you for your help,
Bertrand
@Bertrand_Laurancin, thank you for sharing the bug details.
Have a good day!