<?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: Use SHAPE@ tokens in arcpy.da.SearchCursor with layer (.lyr) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/use-shape-tokens-in-arcpy-da-searchcursor-with/m-p/489932#M38330</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try the wildcard for all?&amp;nbsp; When I did it fails, which may be related to shape being included with the wildcard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is one of those cases where it would be good for Esri to update the documentation to reflect both their intent and expected behavior.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Sep 2018 02:14:15 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2018-09-06T02:14:15Z</dc:date>
    <item>
      <title>Use SHAPE@ tokens in arcpy.da.SearchCursor with layer (.lyr)</title>
      <link>https://community.esri.com/t5/python-questions/use-shape-tokens-in-arcpy-da-searchcursor-with/m-p/489927#M38325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to use the &lt;A href="mailto:SHAPE@JSON"&gt;SHAPE@&lt;/A&gt; or &lt;A href="mailto:SHAPE@JSON"&gt;SHAPE@JSON &lt;/A&gt;fields tokens in &lt;STRONG&gt;arcpy.da.SearchCursor&lt;/STRONG&gt; with a layer (.lyr) as the &lt;STRONG&gt;in_table &lt;/STRONG&gt;parameter with ArcGIS 10.3?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try it, I got the following error: &lt;STRONG&gt;RuntimeError: A column was specified that does not exist.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;If I use the path to the feature class as the &lt;STRONG&gt;in_table&lt;/STRONG&gt; parameter, it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2018 18:45:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/use-shape-tokens-in-arcpy-da-searchcursor-with/m-p/489927#M38325</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2018-09-04T18:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Use SHAPE@ tokens in arcpy.da.SearchCursor with layer (.lyr)</title>
      <link>https://community.esri.com/t5/python-questions/use-shape-tokens-in-arcpy-da-searchcursor-with/m-p/489928#M38326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to reproduce what you found using the SHAPE@ token, that is odd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simple&amp;nbsp;workaround is to create a layer (arcpy.mapping.Layer) using the LYR file first and then create the search cursor on it, e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;lyr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Layer&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"C:\Wherever\MyLayer.lyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SHAPE@"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; sc&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:33:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/use-shape-tokens-in-arcpy-da-searchcursor-with/m-p/489928#M38326</guid>
      <dc:creator>JamesMacKay3</dc:creator>
      <dc:date>2021-12-11T21:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Use SHAPE@ tokens in arcpy.da.SearchCursor with layer (.lyr)</title>
      <link>https://community.esri.com/t5/python-questions/use-shape-tokens-in-arcpy-da-searchcursor-with/m-p/489929#M38327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/data-access/searchcursor-class.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/data-access/searchcursor-class.htm"&gt;SearchCursor—Data Access module | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;keep mentioning featureclass or table.. with no mention of featurelayer&lt;/P&gt;&lt;P&gt;an omission? or as by design&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2018 22:25:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/use-shape-tokens-in-arcpy-da-searchcursor-with/m-p/489929#M38327</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-09-04T22:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Use SHAPE@ tokens in arcpy.da.SearchCursor with layer (.lyr)</title>
      <link>https://community.esri.com/t5/python-questions/use-shape-tokens-in-arcpy-da-searchcursor-with/m-p/489930#M38328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you trying to pass the path to a layer file directly to a Search Cursor?&amp;nbsp; If so, it doesn't work in any version of ArcMap.&amp;nbsp; What is really odd, it works in ArcGIS Pro for the layer files I tested.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The documentation states the input is: "&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', sans-serif; font-size: 14.875px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 300; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;feature class, layer, table, or table view."&amp;nbsp; &lt;/SPAN&gt;A "layer" and a "layer file" are not the same, the latter contains information sufficient to instantiate the former.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2018 22:34:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/use-shape-tokens-in-arcpy-da-searchcursor-with/m-p/489930#M38328</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-09-04T22:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Use SHAPE@ tokens in arcpy.da.SearchCursor with layer (.lyr)</title>
      <link>https://community.esri.com/t5/python-questions/use-shape-tokens-in-arcpy-da-searchcursor-with/m-p/489931#M38329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's also odd that you can open a layer file with a search cursor and retrieve attributes other than the shape - I tried pulling the OID@ token from a layer file and it was no problem, switched it to SHAPE@ and it raised an error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2018 13:20:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/use-shape-tokens-in-arcpy-da-searchcursor-with/m-p/489931#M38329</guid>
      <dc:creator>JamesMacKay3</dc:creator>
      <dc:date>2018-09-05T13:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Use SHAPE@ tokens in arcpy.da.SearchCursor with layer (.lyr)</title>
      <link>https://community.esri.com/t5/python-questions/use-shape-tokens-in-arcpy-da-searchcursor-with/m-p/489932#M38330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try the wildcard for all?&amp;nbsp; When I did it fails, which may be related to shape being included with the wildcard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is one of those cases where it would be good for Esri to update the documentation to reflect both their intent and expected behavior.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2018 02:14:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/use-shape-tokens-in-arcpy-da-searchcursor-with/m-p/489932#M38330</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-09-06T02:14:15Z</dc:date>
    </item>
  </channel>
</rss>

