<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Nodata areas in the raster created by conversion tool &amp;quot;Polygon to Raster&amp;quot; in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125870#M26056</link>
    <description>&lt;P&gt;It keeps failing when done manually (aka, no code)&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have thousands of tiny polygons less than a fraction of a m^2, I cleaned those out and it still fails.&lt;/P&gt;&lt;P&gt;I would work with the polygon file to find out what the problem is.&amp;nbsp; Do it in ArcToolbox, I got a warning about the spatial index, try recreating the spatial indices after removing polygons less than your desired cell size&lt;/P&gt;</description>
    <pubDate>Tue, 14 Dec 2021 15:12:34 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-12-14T15:12:34Z</dc:date>
    <item>
      <title>Nodata areas in the raster created by conversion tool "Polygon to Raster"</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125763#M26050</link>
      <description>&lt;P&gt;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".&lt;BR /&gt;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&amp;nbsp; input polygon coverage (any "nodata" pixels ...)&lt;BR /&gt;The extent of the feature class is little bit grater that the output extent I have set.&lt;BR /&gt;I have also performed a "Check geometry" before to execute the tool.&lt;/P&gt;&lt;P&gt;Here is the python code that reproduces the wrong result:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;import arcpy&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;import os&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;arcpy.env.overwriteOutput = True&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;GDB_locale = r'C:\TEMP\rcwh0\scratch.gdb'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;clu_fc = r'C:\TEMP\rcwh0\scratch.gdb\rcwh0'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;mca_ras = os.path.join(GDB_locale, "mca_ras")&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;out_cellsize = 2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;desc = arcpy.Describe(clu_fc)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;xmin = desc.extent.XMin&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;xmax = desc.extent.XMax&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ymin = desc.extent.YMin&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ymax = desc.extent.YMax&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;print "Extent of %s \nxmin: %s \nxmax: %s \nymin: %s \nymax: %s" % (clu_fc, xmin, xmax, ymin, ymax)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;arcpy.env.extent = "359900 5059900 370100 5070100"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;xmin = arcpy.env.extent.XMin&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;xmax = arcpy.env.extent.XMax&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ymin = arcpy.env.extent.YMin&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ymax = arcpy.env.extent.YMax&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;print "Env extent \nxmin: %s \nxmax: %s \nymin: %s \nymax: %s" % (xmin, xmax, ymin, ymax)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;arcpy.PolygonToRaster_conversion(clu_fc, "CODE_H", mca_ras, "MAXIMUM_COMBINED_AREA", "NONE", out_cellsize)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I get the same wrong raster regardless the cell assignement parameter&amp;nbsp; value set in the tool.&lt;/P&gt;&lt;P&gt;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)&lt;BR /&gt;&lt;BR /&gt;This trouble was experienced in ArcMap 10.8.1&lt;/P&gt;</description>
      <pubDate>Tue, 14 Dec 2021 10:28:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125763#M26050</guid>
      <dc:creator>GiuseppeGentili</dc:creator>
      <dc:date>2021-12-14T10:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: Nodata areas in the raster created by conversion tool "Polygon to Raster"</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125772#M26051</link>
      <description>&lt;P&gt;Try the code variant using a "with" statement&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/using-environment-settings.htm" target="_blank"&gt;Using environment settings in Python—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and use&amp;nbsp;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_blank"&gt;Code formatting ... the Community Version - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;so there are line numbers in your code people can reference&lt;/P&gt;</description>
      <pubDate>Tue, 14 Dec 2021 11:00:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125772#M26051</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-14T11:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Nodata areas in the raster created by conversion tool "Polygon to Raster"</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125782#M26052</link>
      <description>&lt;P&gt;Unfortunately the "with" variant does not fix the trouble.&amp;nbsp;&lt;BR /&gt;I have got the same bad raster.&lt;/P&gt;&lt;P&gt;Here is the code with the variant:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with arcpy.EnvManager(cellSize=2, 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)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 14 Dec 2021 11:28:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125782#M26052</guid>
      <dc:creator>GiuseppeGentili</dc:creator>
      <dc:date>2021-12-14T11:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Nodata areas in the raster created by conversion tool "Polygon to Raster"</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125783#M26053</link>
      <description>&lt;P&gt;out_cellsize is defined elsewhere? or use&lt;/P&gt;&lt;P&gt;out_cellsize=cellSize&amp;nbsp; from your "with" statement&lt;/P&gt;&lt;P&gt;What happens when you change the&amp;nbsp;Cell assignment type to the default&lt;/P&gt;&lt;P&gt;and try a *.tif in a folder as output&lt;/P&gt;</description>
      <pubDate>Tue, 14 Dec 2021 11:36:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125783#M26053</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-14T11:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Nodata areas in the raster created by conversion tool "Polygon to Raster"</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125787#M26054</link>
      <description>&lt;P&gt;Yes, out_cellsize is set before the "with" statement.&amp;nbsp;&lt;BR /&gt;Unfortunately, also the tif file shows the same trouble. I have attached it as zip file.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Dec 2021 12:07:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125787#M26054</guid>
      <dc:creator>GiuseppeGentili</dc:creator>
      <dc:date>2021-12-14T12:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Nodata areas in the raster created by conversion tool "Polygon to Raster"</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125870#M26056</link>
      <description>&lt;P&gt;It keeps failing when done manually (aka, no code)&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have thousands of tiny polygons less than a fraction of a m^2, I cleaned those out and it still fails.&lt;/P&gt;&lt;P&gt;I would work with the polygon file to find out what the problem is.&amp;nbsp; Do it in ArcToolbox, I got a warning about the spatial index, try recreating the spatial indices after removing polygons less than your desired cell size&lt;/P&gt;</description>
      <pubDate>Tue, 14 Dec 2021 15:12:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125870#M26056</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-14T15:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Nodata areas in the raster created by conversion tool "Polygon to Raster"</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125911#M26057</link>
      <description>&lt;P&gt;I have added a spatial index to the polygon feature class, having left the setting grid sizes to 0,0,0&amp;nbsp;&lt;BR /&gt;Anyway, the converted raster again shows the nodata areas.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without removing any tiny polygons, I have &lt;U&gt;reduced the extent&lt;/U&gt; by the value of one cell size.&lt;BR /&gt;The conversion worked well !!&lt;/P&gt;&lt;P&gt;There aren't any tiny polygons along the "nodata" area, so I think that the tiny polygons are not responsible of this trouble. I have successfully converted other polygon coverages having thousands of tiny polygons as well.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Dec 2021 15:44:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125911#M26057</guid>
      <dc:creator>GiuseppeGentili</dc:creator>
      <dc:date>2021-12-14T15:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: Nodata areas in the raster created by conversion tool "Polygon to Raster"</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125991#M26058</link>
      <description>&lt;P&gt;I've logged an issue for the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Steve&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Dec 2021 18:10:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1125991#M26058</guid>
      <dc:creator>SteveLynch</dc:creator>
      <dc:date>2021-12-14T18:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Nodata areas in the raster created by conversion tool "Polygon to Raster"</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1126255#M26060</link>
      <description>&lt;P&gt;Many thanks for your support. I'll look forward to your good news.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 14:26:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/nodata-areas-in-the-raster-created-by-conversion/m-p/1126255#M26060</guid>
      <dc:creator>GiuseppeGentili</dc:creator>
      <dc:date>2021-12-15T14:26:48Z</dc:date>
    </item>
  </channel>
</rss>

