Is there a way to append/POST queried features from a AGOL hosted layer to a ArcGIS server feature service using ArcGIS python api? If so, have would I go about doing so?
Right now I'm able to access both feature services and query the features I want. However, I cannot figure how to get them from the hosted feature layer into the local feature service. Any help would be great thanks.
Solved! Go to Solution.
I was able to keep attributes along with geometry by using the ".as_dict" with the features module...
#loops through features and updates the processed attribute
for f in snowplow_fset.features:
sp_edit = f
sp_edit.attributes['Processed']=8
update_result = snowplow.edit_features(updates=[sp_edit])
update_result
t = sp_edit.as_dict
#appends select features to local feature service
add_result = fs_layers.edit_features(adds = [t])
add_result
I was able to figure it out. ***this may not be best practice but it worked, newbie here...***
However, it does not carry over the attribute information. Any help on that would be great. Thanks.
#loops through features and updates the processed attribute
for f in snowplow_fset.features:
sp_edit = f
sp_edit.attributes['Processed']=8
update_result = snowplow.edit_features(updates=[sp_edit])
update_result
t=(update_result)
#appends select features to local feature service
add_result = fs_layers.edit_features(adds = [t])
add_result
I was able to keep attributes along with geometry by using the ".as_dict" with the features module...
#loops through features and updates the processed attribute
for f in snowplow_fset.features:
sp_edit = f
sp_edit.attributes['Processed']=8
update_result = snowplow.edit_features(updates=[sp_edit])
update_result
t = sp_edit.as_dict
#appends select features to local feature service
add_result = fs_layers.edit_features(adds = [t])
add_result