Hi,
I am trying to create a python toolbox in arcgis pro to convert polygon to raster. The polygon is supplied as feature layer in the parameters, and I used both arcpy.GetParameterAsText(1) and arcpy.GetParameter(1) to call this polygon to execute the conversion, but it is not working. I get an error - Polygon doesn't exist or is not supported. Could anyone provide a solution to it?
Thanks in advance.
You have double quotes around your first parameeter "Polygon", it shouldn't them since you want to refer to the variable not a text string.
Other points. You should allow the user to specify the 'output' workspace or filename (another parameter) rather than hardcoding it.
Also it is usually preferable to use *.tif files as an output, but the user may want another form. As it stands it will become a gdb raster
glad it worked out
It worked. Thanks, Dan.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.