Select to view content in your preferred language

Load features into an existing feature classe with Python

5437
5
06-23-2011 02:31 AM
MaëlREBOUX
Emerging Contributor
Hello.

I'm dissapointed because I can't find any example of a script wich is able to :
1. take the records of an existing feature class (in a GeoDB file)
2. put them in an existing feature classe (in a GeoDB file too)

With the interface it is the same to right-clic > Load > Load Data command.
Precision : I don't want to overwrite the target feature class !

Thanks for your help.
Tags (2)
0 Kudos
5 Replies
JakeSkinner
Esri Esteemed Contributor
You can use the arcpy.Append_management command to do this.
0 Kudos
MikeMacRae
Frequent Contributor
The append works great. I've also had to use a combination Search/Insert/Update cursor to get data from one table to another. That might be an option depending on your end result.
0 Kudos
LindaMcCafferty
Emerging Contributor
You can use the arcpy.Append_management command to do this.


I'm trying to append feature classes together using C# but am running into an error  (see attached).  My code is:

                object[] InLayers = new object[1];
                InLayers[0] = "ROW_points2polygons; ROW_linePolygons; AreaFeatures";
                object[] OutLayer = new object[1];
                OutLayer[0] = "c:\\ROW_Scrub.gdb" + "\\" + "ROW_Appended";

                System.Type SystemTypeGp = System.Type.GetTypeFromProgID("esriGeoprocessing.GpDispatch.1");
                System.Object objDispatch = Activator.CreateInstance(SystemTypeGp);
                SystemTypeGp.InvokeMember("Toolbox", BindingFlags.SetProperty, null, objDispatch,
                    new object[] { @"C:\Program Files\ArcGIS\ArcToolbox\Toolboxes\Data Management Tools.tbx" });

                SystemTypeGp.InvokeMember("Append", System.Reflection.BindingFlags.Public, null, OutLayer, InLayers);

Can you tell me what is meant by BindingFlags and Binders? 

Most of the examples that I find are written using Python. 
Thanks for any help you can provide.
0 Kudos
RyanMooney
Emerging Contributor
How can the append tool be used to add a query to the records so that only specific records are copied from one Gdb to another... ??
0 Kudos
RhettZufelt
MVP Notable Contributor
�?�Map layers can be used as Input Datasets. If a layer has a selection, only the selected records (features or table rows) are used by the Append tool.



http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000050000000

R_
0 Kudos