Hello,
I am trying to add additional points to a data layer that already exists. I need to add approximately 12 points to the existing map. What would be the best tool to use to accomplish this? I have tried to merge the files but that just deletes the existing attributes in the table that I need. Thanks
Jake,
Python might be a good choice for you. You will be able to manage the fields that you want to populate and add the new points very quickly. Something like:
# set values for any other fields you want feat.setValue("otherfield",row.otherfield) <SPAN class="n">fc</SPAN><SPAN class="o">.</SPAN><SPAN class="n">insertRow</SPAN><SPAN class="p">(</SPAN><SPAN class="n">feat</SPAN><SPAN class="p">)</SPAN> <SPAN class="c"># Delete cursor and row objects to remove locks on the data</SPAN> del fc <SPAN class="k">del</SPAN> <SPAN class="n">row</SPAN> <SPAN class="k">del</SPAN> <SPAN class="n">rows</SPAN><SPAN class="kn">import</SPAN> <SPAN class="nn">arcpy</SPAN> <SPAN class="c"># Create insert cursor</SPAN> <SPAN class="o">fc =</SPAN> <SPAN class="n">arcpy</SPAN><SPAN class="o">.</SPAN><SPAN class="n">InsertCursor</SPAN><SPAN class="p">(</SPAN><SPAN class="s">"c:/feature_class_add_points_to"</SPAN><SPAN class="p">)</SPAN> rows = arcpy.SearchCursor("c:/features_to_add") <SPAN class="c"># </SPAN> <SPAN class="k">for</SPAN> row in rows<SPAN class="p">:</SPAN> <SPAN class="n">feat</SPAN> <SPAN class="o">=</SPAN> <SPAN class="n">fc</SPAN><SPAN class="o">.</SPAN><SPAN class="n">newRow</SPAN><SPAN class="p">()</SPAN> feat.shape = row.shape
feat.setValue("otherfield",row.otherfield) <SPAN class="n">fc</SPAN><SPAN class="o">.</SPAN><SPAN class="n">insertRow</SPAN><SPAN class="p">(</SPAN><SPAN class="n">feat</SPAN><SPAN class="p">)</SPAN> <SPAN class="c"># Delete cursor and row objects to remove locks on the data</SPAN>
del fc <SPAN class="k">del</SPAN> <SPAN class="n">row</SPAN> <SPAN class="k">del</SPAN> <SPAN class="n">rows</SPAN>
Regards,
Tom
When you use the Merge tool, make sure you match up the fields you want to populate in the field mapping section. Instructions on how to use the field mappings control can be found here.
edit: technically, it sounds like you want the Append tool (adds features to an existing feature class rather than creating a new feature class), but Merge is nice to use for practice.
You could also use the data loader or object loader. More information at:
ArcGIS Help - Loading data into existing feature classes or tables
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.