Hi Everybody,
I've encountered some inexplicable result when I'm running daily/weekly python scripts to updated hosted feature layers in ArcGIS Online where the feature storage size seems to balloon in size after each truncate and append option. The hosted feature layer started a few weeks ago at like 60mb of feature storage, but it's now 1.5gbs and I'm at a loss at what's happening.
The layer is sync and edit enabled.
Basically we have two methods of updating feature layers.
1. Is where we call rest endpoint directly and perform arcpy delate rows and append. And it seems to work and the end user doesn't seem to notice any issues.
HFL URL = "[URL]"
arcpy.DeleteRows_management(HFL URL)
arcpy.Append_management(Local FC Source, HFL URL,"NO_TEST")
2. The other method, we zip up a file geodatabase, upload it to AGO and perform a truncate and append (from the fgdb) to the feature layer.
Below are the steps after the zipped fgdb gets uploaded to AGO.
flc.manager.update_definition({"capabilities": "Create,Delete,Query,Update,Editing,Sync", "syncEnabled": False})
featLyr.manager.truncate()
flc.manager.update_definition({"capabilities": "Create,Delete,Query,Update,Editing,Sync", "syncEnabled": True})
featLyr.append(item_id=fgd_item.id,
upload_format="filegdb",
upsert=False,
field_mappings=[])
We also have scripts that just item.publish(overwrite=True), but it's a little more finicky I've found to use than the truncate and append, until now. But I've not noticed feature layers exploding in storage space.
I almost feel like there should be like there's an adds and deletes table that needs to be compressed or something in AGO.
Has anyone encountered this issue or have any insights?
Thank you,
Thomas