Hoping to have post this message in the right section, I reports a trouble experienced in the creation of raster from polygon feature class using the conversion tool "PolygonToRaster".
If I I set the environment extent the raster that has been created by the tool reports a "blank" area whose pixels are "nodata". If no extent is set, the raster is created with the correct representation of input polygon coverage (any "nodata" pixels ...)
The extent of the feature class is little bit grater that the output extent I have set.
I have also performed a "Check geometry" before to execute the tool.
Here is the python code that reproduces the wrong result:
import arcpy
import os
arcpy.env.overwriteOutput = True
GDB_locale = r'C:\TEMP\rcwh0\scratch.gdb'
clu_fc = r'C:\TEMP\rcwh0\scratch.gdb\rcwh0'
mca_ras = os.path.join(GDB_locale, "mca_ras")
out_cellsize = 2
desc = arcpy.Describe(clu_fc)
xmin = desc.extent.XMin
xmax = desc.extent.XMax
ymin = desc.extent.YMin
ymax = desc.extent.YMax
print "Extent of %s \nxmin: %s \nxmax: %s \nymin: %s \nymax: %s" % (clu_fc, xmin, xmax, ymin, ymax)
arcpy.env.extent = "359900 5059900 370100 5070100"
xmin = arcpy.env.extent.XMin
xmax = arcpy.env.extent.XMax
ymin = arcpy.env.extent.YMin
ymax = arcpy.env.extent.YMax
print "Env extent \nxmin: %s \nxmax: %s \nymin: %s \nymax: %s" % (xmin, xmax, ymin, ymax)
arcpy.PolygonToRaster_conversion(clu_fc, "CODE_H", mca_ras, "MAXIMUM_COMBINED_AREA", "NONE", out_cellsize)
I get the same wrong raster regardless the cell assignement parameter value set in the tool.
I have attached the file GDB in which there is the polygon feature class (rcwh0) used for the conversion, and the screen shot of the wrong raster created (in red color the nodata)
This trouble was experienced in ArcMap 10.8.1