<?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 write geometry error in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293731#M22718</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Murray,&lt;/P&gt;&lt;P&gt;thanks for your replay.&lt;/P&gt;&lt;P&gt;I have also try the example 'update cursor' of Richard and the script works without error but not update the geometry field. Now my question is: the SHAPE field of FC that i would update have None value, is correct use the update or i have to use insert cursor?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Feb 2017 17:41:11 GMT</pubDate>
    <dc:creator>DEVAPP</dc:creator>
    <dc:date>2017-02-16T17:41:11Z</dc:date>
    <item>
      <title>Arcpy write geometry error</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293728#M22715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;i have develop a python script that use the cursor to read the geometry by one FC and write this geometry into temporal layer create by Make Route Event Layer.&lt;/P&gt;&lt;P&gt;The FC where i read geometry is a Multipoint and also my temporal layer is Multipoint. I have write this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field_1 = ["ID"]&lt;BR /&gt;field_2 = ["SHAPE@","SHAPE@X","SHAPE@Y","ID","SHAPE@XY"]&lt;/P&gt;&lt;P&gt;for row in arcpy.da.SearchCursor("tab_loc_lyr", field_1):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where = "ID = '" + str(row[0])+"'"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select = arcpy.SelectLayerByAttribute_management("loc", "NEW_SELECTION", where)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row_ in arcpy.da.SearchCursor(select, field_2):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; icur = arcpy.InsertCursor("event_lyr")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; irow = icur.newRow()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; irow.Shape = row_[0]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; irow.ID = row_[3]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; icur.insertRow(irow)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i try the code without insert geometry works finie but if i try also to write the geometry with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;irow.Shape = row_[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i recive this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;irow.Shape = row_[0]&lt;BR /&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\arcobjects\_base.py", line 35, in __setattr__&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return setattr(self._arc_object, attr, ao)&lt;BR /&gt;RuntimeError: ERROR 999999: Error executing function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any hep please???&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2017 16:06:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293728#M22715</guid>
      <dc:creator>DEVAPP</dc:creator>
      <dc:date>2017-02-16T16:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy write geometry error</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293729#M22716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First off, please see this post about posting code blocks in GeoNet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting?sr=search&amp;amp;searchId=9d48f2f5-f42d-415c-9ccc-672895309e54&amp;amp;searchIndex=0"&gt;https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting?sr=search&amp;amp;searchId=9d48f2f5-f42d-415c-9ccc-672895309e54&amp;amp;searchIndex=0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondly, it seems like you are making this far more complicated than you need it to.&amp;nbsp; The first search cursor is getting you each row one at a time, so why create a feature layer using the query for each row, then have to use another cursor on a new feature with a single record, why not just retrieve all the field values you need from that row with the first cursor?&amp;nbsp; Also I'm not sure your syntax for setting the values for your insert cursor are correct, row don't have any methods called Shape or ID.&amp;nbsp; You would need to use the method .setValue to assign a value to that row and you have to specify which field in the method(See the help &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-functions/insertcursor.htm"&gt;here&lt;/A&gt; for examples, also &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-classes/row.htm"&gt;here&lt;/A&gt; for documentation on row methods).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, nested cursors are quite slow(especially with geoprocessing operations are placed within them), so I recommend looking at &lt;A _jive_internal="true" href="https://community.esri.com/blogs/richard_fairhurst/2014/11/08/turbo-charging-data-manipulation-with-python-cursors-and-dictionaries"&gt;Richard Fairhurst's blog&lt;/A&gt; on using dictionaries with cursors to help make processing for operations like this much quicker.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: Fixed hyperlink to Richard's Blog post&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2017 16:46:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293729#M22716</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-02-16T16:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy write geometry error</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293730#M22717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are mixing and matching the two different types of cursors.&amp;nbsp;&amp;nbsp;Although you can technically do so, it is bound to cause readability and maintainability issues.&amp;nbsp; I would start by settling on a specific cursor type, then you can work out different methodologies/approaches.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2017 17:36:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293730#M22717</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-02-16T17:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy write geometry error</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293731#M22718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Murray,&lt;/P&gt;&lt;P&gt;thanks for your replay.&lt;/P&gt;&lt;P&gt;I have also try the example 'update cursor' of Richard and the script works without error but not update the geometry field. Now my question is: the SHAPE field of FC that i would update have None value, is correct use the update or i have to use insert cursor?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2017 17:41:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293731#M22718</guid>
      <dc:creator>DEVAPP</dc:creator>
      <dc:date>2017-02-16T17:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy write geometry error</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293732#M22719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey&amp;nbsp;do you know how you&amp;nbsp;would invoke the 'within' method? Been struggling with that one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's on the Geometry site, but, alas no good sample &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-classes/geometry.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-classes/geometry.htm"&gt;Geometry—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2017 21:47:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293732#M22719</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-07-11T21:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy write geometry error</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293733#M22720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A basic example:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; pg &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FromWKT&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; pt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FromWKT&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'POINT(5 5)'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; pt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;within&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pg&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE:&amp;nbsp; Cross posted to &lt;A href="https://community.esri.com/thread/197968" target="_blank"&gt;How to use the geometry within function in arcpy?&lt;/A&gt; .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:07:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293733#M22720</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-11T14:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy write geometry error</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293734#M22721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A href="https://community.esri.com/people/bixb0012"&gt;bixb0012&lt;/A&gt;‌&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And thanks for the blurb about cross-posting... someone told the CIO an app that was scheduled to be released in September will be done next week...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 14:13:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293734#M22721</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-07-12T14:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy write geometry error</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293735#M22722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/bixb0012"&gt;bixb0012&lt;/A&gt;‌ Also, do you know if this is compatible calling feature classes?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 14:22:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293735#M22722</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-07-12T14:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy write geometry error</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293736#M22723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The ArcPy Geometry classes are focused around individual geometries, not sets of geometries like a feature class.&amp;nbsp; If you want to work with feature classes, I suggest using the &lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/select-layer-by-location.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/select-layer-by-location.htm"&gt;Select Layer By Location—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp; geoprocessing tool.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 14:40:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293736#M22723</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-07-12T14:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy write geometry error</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293737#M22724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's what I was afraid of. The boolean return is a lot more scalable for my purposes (it's getting embedded into a pop-up and will execute around fifty of these requests). The 'within' geometry seemed like a nice alternative to SQL spatial; the 'Select by Location,' when run in batch I've found, can incur some latency.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I might try to convert the vertices to an array, save that array as a variable and use the 'within' functionality. We'll see how that works...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 14:51:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293737#M22724</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-07-12T14:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy write geometry error</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293738#M22725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use ArcPy Geometry class with the Select by Location tool.&amp;nbsp; For example, you can pass the tool an ArcPy Point as the selection feature and have the tool select all polygons in a feature class that intersect that Point object.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 16:11:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-write-geometry-error/m-p/293738#M22725</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-07-12T16:11:16Z</dc:date>
    </item>
  </channel>
</rss>

