<?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: eading geometry through Search Cursor ... runtime error says it cannot open file! in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/eading-geometry-through-search-cursor-runtime/m-p/1251022#M66640</link>
    <description>&lt;P&gt;Hmmm... the path to the file is correct, and the file is there! This is what makes it very strange...!!&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jan 2023 20:51:20 GMT</pubDate>
    <dc:creator>Seyed-MahdySadraddini</dc:creator>
    <dc:date>2023-01-24T20:51:20Z</dc:date>
    <item>
      <title>eading geometry through Search Cursor ... runtime error says it cannot open file!</title>
      <link>https://community.esri.com/t5/python-questions/eading-geometry-through-search-cursor-runtime/m-p/1250996#M66634</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am trying to read and use the geometries of a polygon layer, row by row, using Search Cursor. I am getting a very strange runtime error, but I cannot figure out the source of this error! My first time getting this runtime error!&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Documents\ArcGIS\Projects\Census\Redistribute_Home.py", line 75, in &amp;lt;module&amp;gt;&lt;BR /&gt;with arcpy.da.SearchCursor(from_shape, ['SHAPE@', 'FIRST_city', 'FIRST_ccid', 'FIRST_NUMBER_OF_DIVISIONS']) as search:&lt;BR /&gt;RuntimeError: cannot open 'ON1996_DissolveOnName'&lt;/P&gt;&lt;P&gt;First time seeing this runtime error. It says it cannot open the layer, but there isn't anything striking me to be wrong in my code!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# this is the workspace&lt;BR /&gt;arcpy.env.workspace = os.path.join(directory, gdb + '/' + fds) # gdb and fds are text strings&lt;/P&gt;&lt;P&gt;# the layer to create divisions from&lt;BR /&gt;from_shape = layer # 'ON1996_DissolveOnName' is the value of the layer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, here is the part of the code that runs into error&lt;/P&gt;&lt;P&gt;with arcpy.da.SearchCursor(from_shape, ['SHAPE@', 'FIRST_city', 'FIRST_ccid', 'FIRST_NUMBER_OF_DIVISIONS']) as search:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Another question is whether using SHAPE@ token to read the geometry for each of the&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 20:13:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/eading-geometry-through-search-cursor-runtime/m-p/1250996#M66634</guid>
      <dc:creator>Seyed-MahdySadraddini</dc:creator>
      <dc:date>2023-01-24T20:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: eading geometry through Search Cursor ... runtime error says it cannot open file!</title>
      <link>https://community.esri.com/t5/python-questions/eading-geometry-through-search-cursor-runtime/m-p/1251009#M66637</link>
      <description>&lt;P&gt;The error is telling you that it can't open&amp;nbsp;&lt;SPAN&gt;ON1996_DissolveOnName, probably because it can't find it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;are you running this in the Python window, a toolbox or as standalone script?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;ArcGIS Pro&amp;nbsp; or ArcMap?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;If you're running this in the Python Window, does the current map actually have a layer called "ON1996_DissolveOnName"?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;How do you declare the variable &lt;STRONG&gt;layer&lt;/STRONG&gt;? The full script could be helpful.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To post code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1674589814049.png" style="width: 546px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/61109iE6E36886309482F5/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_0-1674589814049.png" alt="JohannesLindner_0-1674589814049.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1674589827880.png" style="width: 477px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/61110i9AA607855960C6E3/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_1-1674589827880.png" alt="JohannesLindner_1-1674589827880.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 20:30:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/eading-geometry-through-search-cursor-runtime/m-p/1251009#M66637</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-01-24T20:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: eading geometry through Search Cursor ... runtime error says it cannot open file!</title>
      <link>https://community.esri.com/t5/python-questions/eading-geometry-through-search-cursor-runtime/m-p/1251010#M66638</link>
      <description>&lt;P&gt;Oh, also, your second question got cut short:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Another question is whether using SHAPE@ token to read the geometry for each of the&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 24 Jan 2023 20:31:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/eading-geometry-through-search-cursor-runtime/m-p/1251010#M66638</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-01-24T20:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: eading geometry through Search Cursor ... runtime error says it cannot open file!</title>
      <link>https://community.esri.com/t5/python-questions/eading-geometry-through-search-cursor-runtime/m-p/1251022#M66640</link>
      <description>&lt;P&gt;Hmmm... the path to the file is correct, and the file is there! This is what makes it very strange...!!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 20:51:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/eading-geometry-through-search-cursor-runtime/m-p/1251022#M66640</guid>
      <dc:creator>Seyed-MahdySadraddini</dc:creator>
      <dc:date>2023-01-24T20:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: eading geometry through Search Cursor ... runtime error says it cannot open file!</title>
      <link>https://community.esri.com/t5/python-questions/eading-geometry-through-search-cursor-runtime/m-p/1251023#M66641</link>
      <description>&lt;P&gt;Sorry, it is perhaps an irrelevant question now.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 20:52:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/eading-geometry-through-search-cursor-runtime/m-p/1251023#M66641</guid>
      <dc:creator>Seyed-MahdySadraddini</dc:creator>
      <dc:date>2023-01-24T20:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: eading geometry through Search Cursor ... runtime error says it cannot open file!</title>
      <link>https://community.esri.com/t5/python-questions/eading-geometry-through-search-cursor-runtime/m-p/1251039#M66642</link>
      <description>&lt;P&gt;Actually there was an error in the path... hard to see!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 21:28:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/eading-geometry-through-search-cursor-runtime/m-p/1251039#M66642</guid>
      <dc:creator>Seyed-MahdySadraddini</dc:creator>
      <dc:date>2023-01-24T21:28:41Z</dc:date>
    </item>
  </channel>
</rss>

