<?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: Update cursor and SHAPE@XY token problem in New to GIS Questions</title>
    <link>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50801#M100</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;​sigh.... python googles always on&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 May 2015 00:50:11 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2015-05-12T00:50:11Z</dc:date>
    <item>
      <title>Update cursor and SHAPE@XY token problem</title>
      <link>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50793#M92</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to Python and ArcPy.&lt;/P&gt;&lt;P&gt;I am testing the script below which is running for a point feaure class, but not for a line feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style="line-height: 1.5;"&gt;import arcpy&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;arcpy.env.workspace = r"D:\Student\PYTH\6_Geometry_objects\SanDiego.gdb"&lt;/LI&gt;&lt;LI&gt;&lt;/LI&gt;&lt;LI&gt;# Variables&lt;/LI&gt;&lt;LI&gt;featClass = "MajorAttractions2"&lt;/LI&gt;&lt;LI&gt;fields = ["SHAPE@XY"]&lt;/LI&gt;&lt;LI&gt;exp = "OBJECTID = 4"&lt;/LI&gt;&lt;LI&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="line-height: 1.5;"&gt;pnt = arcpy.Point()&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;pnt.X = 306400&lt;/LI&gt;&lt;LI&gt;pnt.Y = 4098400&lt;/LI&gt;&lt;LI&gt;&lt;/LI&gt;&lt;LI&gt;with arcpy.da.UpdateCursor(featClass, fields, exp) as cur:&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cur:&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = pnt&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cur.updateRow(row)&lt;/LI&gt;&lt;LI&gt;&lt;/LI&gt;&lt;LI&gt;print "Script completed"&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the latter case, I am getting the following error message: "exceptions.SystemError: error return without exception set&lt;SPAN style="line-height: 1.5;"&gt;" for line 16.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Thank you in advance,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Panagiotis&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 12:44:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50793#M92</guid>
      <dc:creator>PanagiotisChiotis</dc:creator>
      <dc:date>2015-05-11T12:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor and SHAPE@XY token problem</title>
      <link>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50794#M93</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ignoring the fact that you are trying to create a line from a single point (which surprisingly works), does the line feature class contain a feature at OBJECTID = 4?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 20:34:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50794#M93</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-05-11T20:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor and SHAPE@XY token problem</title>
      <link>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50795#M94</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Darren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not trying to create a line feature class, but rather shift a feature of it. Both point and line feature classes already exist. And, yes, "OBJECTID = 4" is a valid expression in both cases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Panagiotis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 22:11:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50795#M94</guid>
      <dc:creator>PanagiotisChiotis</dc:creator>
      <dc:date>2015-05-11T22:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor and SHAPE@XY token problem</title>
      <link>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50796#M95</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SHAPE@XY for a line feature will return the feature centroid. You will need to use SHAPE@ and then locate the vertex point on the polyline to update. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These pages have more detail:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Reading geometries - &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Reading_geometries/002z0000001t000000/" title="http://resources.arcgis.com/en/help/main/10.2/index.html#/Reading_geometries/002z0000001t000000/"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; &lt;/LI&gt;&lt;LI&gt;Writing geometries - &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Writing_geometries/002z0000001v000000/" title="http://resources.arcgis.com/en/help/main/10.2/index.html#/Writing_geometries/002z0000001v000000/"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; &lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 23:21:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50796#M95</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2015-05-11T23:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor and SHAPE@XY token problem</title>
      <link>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50797#M96</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;I thought you had to do it vertex by vertex, too, but this post seems to disagree: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://arcpy.wordpress.com/2012/11/15/shifting-features/" rel="nofollow" target="_blank"&gt;https://arcpy.wordpress.com/2012/11/15/shifting-features/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It shifts geometry all as one. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 23:27:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50797#M96</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-05-11T23:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor and SHAPE@XY token problem</title>
      <link>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50798#M97</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good catch - I hadn't seen that post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 23:53:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50798#M97</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2015-05-11T23:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor and SHAPE@XY token problem</title>
      <link>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50799#M98</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;OL style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;LI&gt;exp = "OBJECTID = 4"&amp;nbsp; are you sure it is a valid where clause, it looks like an assignment statement, did you try&lt;/LI&gt;&lt;LI&gt;exp = "OBJECTID == 4" &lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 00:13:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50799#M98</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-05-12T00:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor and SHAPE@XY token problem</title>
      <link>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50800#M99</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. Should be correct through SQL goggles.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 00:27:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50800#M99</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-05-12T00:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor and SHAPE@XY token problem</title>
      <link>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50801#M100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;​sigh.... python googles always on&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 00:50:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50801#M100</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-05-12T00:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor and SHAPE@XY token problem</title>
      <link>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50802#M101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You didn't catch it because documenting important functionality like that on a third-party blogging platform is, well, poor taste.&amp;nbsp; It would be nice and a bit more enterprise-y if the ArcGIS Python development team did more blogging within an Esri domain, say GeoNet maybe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 02:54:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50802#M101</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-05-12T02:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor and SHAPE@XY token problem</title>
      <link>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50803#M102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The "SHAPE@XY" token doesn't return an ArcPy Point object, it returns "a tuple of the feature's centroid x,y coordinates."&amp;nbsp; Line 15 of your code replaces a Python tuple with an ArcPy Point object, which is what I am guessing is causing the error on Line 16.&amp;nbsp; Does the code work if you update Line 15 to:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14314002781896201" data-renderedposition="0_0_0_0" jivemacro_uid="_14314002781896201"&gt;&lt;P&gt;row[0] = (306400, 4098400)&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 03:11:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50803#M102</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-05-12T03:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor and SHAPE@XY token problem</title>
      <link>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50804#M103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Joshua,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right, I was thinking that the tuple of a feature's centroid X&amp;amp;Y coordinates could be replaced by a Point object (which stores coordinate pairs of &lt;SPAN style="line-height: 1.5;"&gt;X&amp;amp;Y&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt; values&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt;). And yes, &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;the code works when I updated Line 15 to:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; line-height: 1.5;"&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;row[&lt;/SPAN&gt;&lt;SPAN class="number" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: green;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;] = (&lt;/SPAN&gt;&lt;SPAN class="number" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: green;"&gt;306400&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;, &lt;/SPAN&gt;&lt;SPAN class="number" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: green;"&gt;4098400&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;However, for some funny reason, it works fine when running the script for a point feature class &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/confused.png" /&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Anyway, thanks a lot, it really cleared things up!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Panagiotis&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 10:17:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/new-to-gis-questions/update-cursor-and-shape-xy-token-problem/m-p/50804#M103</guid>
      <dc:creator>PanagiotisChiotis</dc:creator>
      <dc:date>2015-05-12T10:17:52Z</dc:date>
    </item>
  </channel>
</rss>

