PolygonToRaster with string value field in standalone script

444
1
10-23-2019 11:08 AM
RebekahZehnder
New Contributor II

I'm trying to convert a polygon feature class to raster using a standalone python script.  According to ArcGIS help for the tool

If the input field contains string values, the output raster will contain an integer value field and a string field.

This is what happens if I run the tool directly in ArcMap or in a script tool in ArcMap.  When I run it in a standalone script, though, the output raster contains only an integer field (leaving me no way to link back to the fields in the feature class or even know what the values represent).

Anybody know why this is happening or have a good workaround?  I suppose I could add an integer field to the polygon fc to use as the value field and then join to the resulting raster, but I would rather get the expected behavior when using a string field.

0 Kudos
1 Reply
RebekahZehnder
New Contributor II

Update:

When I was running the standalone script initially, I had ArcMap open.  I deleted the output raster before re-running the script, but it must have still been hanging on to something.  Closing ArcMap solved the problem.  Changing the output raster filename in the script also solved it.

0 Kudos