Select to view content in your preferred language

Using polygon in ARCGIS PRO Toolbox

783
3
Jump to solution
11-17-2022 09:20 PM
BipinPeethambaran
New Contributor II

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.

BipinPeethambaran_0-1668748994500.png

BipinPeethambaran_1-1668749012016.png

BipinPeethambaran_0-1668816654395.png

 

 

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

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


... sort of retired...

View solution in original post

0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

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


... sort of retired...
0 Kudos
BipinPeethambaran
New Contributor II

It worked. Thanks, Dan. 

0 Kudos
DanPatterson
MVP Esteemed Contributor

glad it worked out


... sort of retired...
0 Kudos