Trying to append a feature layer using python problem

2183
8
Jump to solution
12-28-2020 11:33 AM
Labels (4)
GaryThomann
New Contributor II

I am using arcgis pro 2.7 and am trying to append data from one feature layer into another.  When I do it manually inside the program using the Append tool in Geoprocessing it works fine.  But when I try to do it with python using arcpy.geoanalytics.AppendData(layer1,layer2) I get the error message that layer1 is not a hosted layer.  Why?  I don't see how this procedure has anything to do with hosting.  Although it probably makes no difference I am using Microsoft Visual Studio Professional 2019 for writing the python code.

0 Kudos
2 Solutions

Accepted Solutions
JoeBorgione
MVP Emeritus

So neither layer1, or layer2 is hosted?  Try arcpy.append_management instead.  https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/append.htm

 

That should just about do it....

View solution in original post

GaryThomann
New Contributor II

I don't think either layer is hosted, although I really don't know what hosting is anyway.  And your solution worked, although the actual command is arcpy.management.Append().  But that was easy to change.  Thank you very much!!

View solution in original post

0 Kudos
8 Replies
JoeBorgione
MVP Emeritus

So neither layer1, or layer2 is hosted?  Try arcpy.append_management instead.  https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/append.htm

 

That should just about do it....
GaryThomann
New Contributor II

I don't think either layer is hosted, although I really don't know what hosting is anyway.  And your solution worked, although the actual command is arcpy.management.Append().  But that was easy to change.  Thank you very much!!

0 Kudos
JoeBorgione
MVP Emeritus

The syntax is a 'you say tomato', I say tomaato' sort of thing.  Hosted feature layers are geo-spatial datasets that are hosted somewhere on the internet either in AGOL or an enterprise Portal.  Sounds like you are not using either, rather you are using a geodatabse feature class.

That should just about do it....
GaryThomann
New Contributor II

No, I have not used any of the geospatial datasets that are hosted.  We use python at work and I write python macros there, but I just started using python in ArcGis Pro a couple of days ago, and progress has been a little rocky.  

0 Kudos
JoeBorgione
MVP Emeritus

There is python and then there is the arcpy library/module of python.  If you aren't real familiar with geoprocessing tools in ArcGIS, I would expect things to be 'a little rocky' for you.  Basically all arcpy provides is scripting environment with which to automate the various typical processes that you can do manually in ArcGIS.

That should just about do it....
DanPatterson
MVP Esteemed Contributor

Learn how to use the tools in ArcToolbox and if needed, then the code snippets at the end of each tool description will provide the simplest way to accomplish complex workflows. 

The rest of the arcpy module is really only needed when you get down to the environments or individual geometry level or to implement data access cursors.


... sort of retired...
DanPatterson
MVP Esteemed Contributor

arcpy.management.Append() == arcpy.Append_management()

 

If you had checked Joe's help topic link fully. 

Prefix vs post-fix notation, although the former is preferred


... sort of retired...
0 Kudos
DanPatterson
MVP Esteemed Contributor

An overview of the GeoAnalytics Desktop toolbox—ArcGIS Pro | Documentation

has the requirements and probably isn't what you were looking for as Joe points out


... sort of retired...