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.
Solved! Go to Solution.
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
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
It worked. Thanks, Dan.
glad it worked out