<?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: arcpy PolygonToRaster ERROR 000918: Cannot retrieve feature class extent in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-polygontoraster-error-000918-cannot-retrieve/m-p/554630#M43359</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Someone on stackexchange GIS also suggested a schema lock issue, which turned out to be true. &amp;nbsp;I thought at first it was a problem with a da.UpdateCursor, but I used a with statement, so it should be releasing the locks. &amp;nbsp;Doing a del statement on the row and the cursor still didn't help. &amp;nbsp;In the end I was able to fix it by quickly copying the features to a new feature class and deleting it after. &amp;nbsp;Not optimal, but it works. &amp;nbsp;I think that there is some kind of schema lock applied by MultipleRingBuffer() that isn't releasing properly. &amp;nbsp;I found an old question on stackexchange that described a similar issue but it inexplicably stopped happening for them so there was no real insight to be gleaned from it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Feb 2017 18:56:49 GMT</pubDate>
    <dc:creator>IsaacBoates</dc:creator>
    <dc:date>2017-02-10T18:56:49Z</dc:date>
    <item>
      <title>arcpy PolygonToRaster ERROR 000918: Cannot retrieve feature class extent</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-polygontoraster-error-000918-cannot-retrieve/m-p/554627#M43356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to convert a polygon feature class (created intermediately as part of a larger process) to a raster, which will have the same snap settings and cell size as another input raster. However, every time i try to run it, I get this error:&lt;/P&gt;&lt;PRE&gt;ExecuteError: ERROR 000918: Cannot retrieve feature class extent.&lt;/PRE&gt;&lt;P&gt;I cannot find any help on this issue and I don't know what to do. I have already seen &lt;A href="http://gis.stackexchange.com/questions/120241/solution-to-error-000918-cannot-retrieve-feature-class-extent"&gt;this&lt;/A&gt; question and it did not help resolve the issue.&lt;/P&gt;&lt;P&gt;This is the code:&lt;/P&gt;&lt;PRE&gt;cell_size = float(GetRasterProperties(in_raster, 'CELLSIZEX').getOutput(0))&amp;nbsp; env.snapRaster = in_raster&amp;nbsp; PolygonToRaster(buffer_fc, z_field_name, stamp_raster, cellsize=cell_size)&amp;nbsp; return None&lt;/PRE&gt;&lt;P&gt;The same parameters work when I execute "Polygon To Raster" diretly from the ArcToolbox GUI.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 14:23:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-polygontoraster-error-000918-cannot-retrieve/m-p/554627#M43356</guid>
      <dc:creator>IsaacBoates</dc:creator>
      <dc:date>2017-02-10T14:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy PolygonToRaster ERROR 000918: Cannot retrieve feature class extent</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-polygontoraster-error-000918-cannot-retrieve/m-p/554628#M43357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The formatting broke the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="background-color: #472c47;"&gt;cell_size&lt;/SPAN&gt; &lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #66d9ef;"&gt;float&lt;/SPAN&gt;(GetRasterProperties(&lt;SPAN style="color: #fd971f;"&gt;in_raster&lt;/SPAN&gt;, &lt;SPAN style="color: #008080; font-weight: bold;"&gt;'CELLSIZEX'&lt;/SPAN&gt;).getOutput(&lt;SPAN style="color: #ae81ff;"&gt;0&lt;/SPAN&gt;))

env.snapRaster &lt;SPAN style="color: #f92672;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #fd971f;"&gt;in_raster&lt;/SPAN&gt;

PolygonToRaster(&lt;SPAN style="color: #fd971f;"&gt;buffer_fc&lt;/SPAN&gt;, &lt;SPAN style="color: #fd971f;"&gt;z_field_name&lt;/SPAN&gt;, &lt;SPAN style="color: #fd971f;"&gt;stamp_raster&lt;/SPAN&gt;, &lt;SPAN style="color: #ff5ba8;"&gt;cellsize&lt;/SPAN&gt;&lt;SPAN style="color: #f92672;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="background-color: #3c3c57;"&gt;cell_size&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:58:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-polygontoraster-error-000918-cannot-retrieve/m-p/554628#M43357</guid>
      <dc:creator>IsaacBoates</dc:creator>
      <dc:date>2021-12-11T23:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy PolygonToRaster ERROR 000918: Cannot retrieve feature class extent</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-polygontoraster-error-000918-cannot-retrieve/m-p/554629#M43358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the ESRI help for that error code:&amp;nbsp; &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-00901-00925-000918.htm"&gt;http://pro.arcgis.com/en/pro-app/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-00901-00925-000918.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the&amp;nbsp;help on the error code, I'd guess there is still a lock on the intermediate data after it is created, you mind posting code from where the intermediate data is created to where you run the Polygon to Raster?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also for code formatting on GeoNet &lt;A _jive_internal="true" href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting"&gt;https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 15:12:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-polygontoraster-error-000918-cannot-retrieve/m-p/554629#M43358</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-02-10T15:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy PolygonToRaster ERROR 000918: Cannot retrieve feature class extent</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-polygontoraster-error-000918-cannot-retrieve/m-p/554630#M43359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Someone on stackexchange GIS also suggested a schema lock issue, which turned out to be true. &amp;nbsp;I thought at first it was a problem with a da.UpdateCursor, but I used a with statement, so it should be releasing the locks. &amp;nbsp;Doing a del statement on the row and the cursor still didn't help. &amp;nbsp;In the end I was able to fix it by quickly copying the features to a new feature class and deleting it after. &amp;nbsp;Not optimal, but it works. &amp;nbsp;I think that there is some kind of schema lock applied by MultipleRingBuffer() that isn't releasing properly. &amp;nbsp;I found an old question on stackexchange that described a similar issue but it inexplicably stopped happening for them so there was no real insight to be gleaned from it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 18:56:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-polygontoraster-error-000918-cannot-retrieve/m-p/554630#M43359</guid>
      <dc:creator>IsaacBoates</dc:creator>
      <dc:date>2017-02-10T18:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy PolygonToRaster ERROR 000918: Cannot retrieve feature class extent</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-polygontoraster-error-000918-cannot-retrieve/m-p/554631#M43360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try the following:&lt;/P&gt;&lt;P&gt;- use CopyFeatures to create of copy of the polygon feature class&lt;/P&gt;&lt;P&gt;- use this copy in PolygonToRaster&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and which version of ArcGIS are you using?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 19:00:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-polygontoraster-error-000918-cannot-retrieve/m-p/554631#M43360</guid>
      <dc:creator>SteveLynch</dc:creator>
      <dc:date>2017-02-10T19:00:44Z</dc:date>
    </item>
  </channel>
</rss>

