Select to view content in your preferred language

problem update hosted feature in portal

4485
11
02-15-2023 06:23 AM
Labels (1)
OrrGvili
Occasional Contributor

trying to update hosted feature on ArcGIS Enterprise 10.8.1+ from local GDB 

this is the Exception
Exception: 'appendUploadFormat' must be one of the following: shapefile, geojson, csv, featureCollection, excel.

in the API  working with fgdb is option , 

this is the function i use for the update  what am i missing ? 

def append_and_update(agriplots,gdb, url,username,password):
    gis = GIS(url = url, username=username, password=password)
    layer_for_update = FeatureLayer(agriplots,gis)
    print("Uploading File Geodatabase")
    fgd_properties={'title':"Temp GDB deleted at the end", 'tags':'temp file geodatabase', 'type':'File Geodatabase'}
    gdb_item = gis.content.add(item_properties=fgd_properties, data=gdb + ".zip")
    print("updating... ")
    result = layer_for_update.append(item_id=gdb_item.id, upload_format="filegdb",source_table_name='AP_WGS84',return_messages=True)
    print(result)
    delete_result = gdb_item.delete()
    print(delete_result)
11 Replies
Iron_Mark
Regular Contributor

What a joke! So much time wasted solving all sorts of non sense issues with the File geodatabase, portal item query and so on and forth, and at the end you discover there there is the final BUG happening since more than a year ago that still hasn't been fixed...for a proprietary file format! unbelievable

0 Kudos
Adrian
by
Occasional Contributor

Two years later, working with ArcGIS Enterprise 11.5 and it's still not possible to append data to a hosted feature layer with an uploaded file geo database. My layer supports only the following formats for appending:

'csv,excel,featureCollection,featureService,geojson,imageCollection,jsonl,pbf,shapefile'

Using arcpy.Append_management would work with a local fGDB as source and a hosted feature layer as target. However, this tool is painfully slow (1 minute for appending 2'000 point features). That's why I hoped, uploading first, appending directely on the server afterwards would be faster. I was not expecting, that this is not possible.

We are still looking for a fast and stable aproach to keep our 1000+ feature services up to date in a fully automated process. Working with transfer formats like csv or geojson is not recommended, because they are not preserving the data (e.g. no support for true curves). Currently we are overwriting the whole feature service in case of any slight data changes. However, this is like using a sledgehammer to crack a nut and sometimes, it ends up with a corrupted feature service and an unspecific "job failed" error.

Off topic but somehow related is the fact, that a hosted feature layer is losing every information about its source. This makes it difficult to keep it up to date. We have to maintain a separate data structure to store the mapping beween all feature layers and feature classes. A hidden field for a business key on every layer and every portal item would be nice.

 

 

0 Kudos