<?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 How to Insert data into an Existing feature class? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-insert-data-into-an-existing-feature-class/m-p/243204#M18892</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does anyone here know how to insert rows of data into an existing feature class from either a geodatabase table or a .lyr file?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All of the code I can find wants to copy data into a new feature class instead of populating an existing one. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All help is tremendously appreciated. Thanks in advance!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jul 2012 15:21:44 GMT</pubDate>
    <dc:creator>MatthewGerbrandt</dc:creator>
    <dc:date>2012-07-27T15:21:44Z</dc:date>
    <item>
      <title>How to Insert data into an Existing feature class?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-insert-data-into-an-existing-feature-class/m-p/243204#M18892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does anyone here know how to insert rows of data into an existing feature class from either a geodatabase table or a .lyr file?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All of the code I can find wants to copy data into a new feature class instead of populating an existing one. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All help is tremendously appreciated. Thanks in advance!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2012 15:21:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-insert-data-into-an-existing-feature-class/m-p/243204#M18892</guid>
      <dc:creator>MatthewGerbrandt</dc:creator>
      <dc:date>2012-07-27T15:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to Insert data into an Existing feature class?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-insert-data-into-an-existing-feature-class/m-p/243205#M18893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;if you have two datasets with the same data structure (i.e. field names, sizes, types) then what you are looking for is the Append function (arpy.Append_management) I think.&amp;nbsp; You can use Append when the two feature classes have the same data but differently named fields too but then you have to deal with field mappings which is a bit of a PITA done outside a GUI.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2012 15:46:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-insert-data-into-an-existing-feature-class/m-p/243205#M18893</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2012-07-27T15:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to Insert data into an Existing feature class?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-insert-data-into-an-existing-feature-class/m-p/243206#M18894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you, Christopher. Unfortunatley, I'm not working with the same data types. I need to go into a FeatureClass from either a geodatabase table or a layer (.lyr) file.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2012 15:57:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-insert-data-into-an-existing-feature-class/m-p/243206#M18894</guid>
      <dc:creator>MatthewGerbrandt</dc:creator>
      <dc:date>2012-07-27T15:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to Insert data into an Existing feature class?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-insert-data-into-an-existing-feature-class/m-p/243207#M18895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Roughly, you have to do something like this where you are reading from one table and writing to the other using search and insert cursors. You must have same number of records in both tables. If it is a feature class OID's should match. Never tried table to table though. This is just an example. You might have to tweak it to make it work for your situation -&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Open a search cursor on a feature class / table to read from
&amp;nbsp;&amp;nbsp;&amp;nbsp; scur = arcpy.SearchCursor(read_fc)
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Open an insert cursor on the fc / table to write to
&amp;nbsp;&amp;nbsp;&amp;nbsp; icur = arcpy.InsertCursor(write_fc)

&amp;nbsp;&amp;nbsp;&amp;nbsp; for srow in scur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; irow = icur.newRow()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; irow.shape = srow.shape
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; irow.setValue(to_field1, srow.getValue(from_field1))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; irow.setValue(to_field2, srow.getValue(from_field2))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; icur.insertRow(irow)
&amp;nbsp;&amp;nbsp;&amp;nbsp; del irow, icur, srow, scur
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:09:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-insert-data-into-an-existing-feature-class/m-p/243207#M18895</guid>
      <dc:creator>SolomonPulapkura</dc:creator>
      <dc:date>2021-12-11T12:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to Insert data into an Existing feature class?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-insert-data-into-an-existing-feature-class/m-p/243208#M18896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thank you, Christopher. Unfortunatley, I'm not working with the same data types. I need to go into a FeatureClass from either a geodatabase table or a layer (.lyr) file.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to clarify this a little bit - what is your 'source' data that you are using and what is the 'target' that you want to put those features into?&amp;nbsp; The term 'featureclass' is sort of a generic reference to a data type that hold spatial data - this can be either a shapefile or a featureclass within a geodatabase.&amp;nbsp; Also, a .lyr file is simply an on disk representation of a gdb featureclass or a shapefile, it doesn't actually contain data, rather it holds all the properties needed for arcmap to render the data it refrences cartographically.&amp;nbsp; I still think 'append' is the tool you need.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Jul 2012 11:54:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-insert-data-into-an-existing-feature-class/m-p/243208#M18896</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2012-07-29T11:54:46Z</dc:date>
    </item>
  </channel>
</rss>

