This question pertains to
arcgis.gis in Python, for working with hosted Feature Layers in ArcGIS Enterprise.
I'm using the enrich_data function to calculate a buffer polygon from my input (hosted) point layer, then add population statistics to the resulting polygon - this is working well. I'm not specifying an
output_name, so the result is an in-memory FeatureCollection.
Now I wish to append the resulting polygon to an existing polygon layer which is hosted in ArcGIS Enterprise, but I can't figure out how to send the Feature Collection to the existing layer.
I tried the FeatureLayer
edit_features command, which has an
adds option which expects as input:
adds: FeatureSet/List. The array of features to be added
I can obtain the FeatureSet from
FeatureCollection.layer.featureSet but this fails in the
edit_features.add command with the below error message, which is unclear to me:
self._mapping[key] hints that there is an issue with the field mapping between the input and output polygons, but I can't see any options to remap the field names.
TL;DR - how can I append an in-memory FeatureCollection of polygons to a hosted Feature Layer in ArcGIS Enterprise?