SeanKMcGinnis / PegaImport

0 stars 0 forks source link

Update for FeatureLayer does not work #1

Open alexei55 opened 6 years ago

alexei55 commented 6 years ago

In the Publish block, else... item_search[0].update(None, pega_temp) updates the GeoJSON in AGOL But that does not trigger a re-publish of the FeatureLayer with new data... I tried: pega_fl = item_search[0].publish() but that will fail if FL already exists

What's the correct way to trigger the FL to update?

alexei55 commented 6 years ago

So I can do this: #### Publish the Item to AGOL\ if len(item_search) == 0: pega_item = gis.content.add({ 'title': 'Pega Cases', 'tags': 'Pega, Demo, Test', 'type': 'GeoJson', 'typeKeywords': 'Coordinates Type, CRS, Feature, FeatureCollection, GeoJSON, Geometry, GeometryCollection' }, pega_temp) pega_fl = pega_item.publish() else: if(debug): print("Handle item update") item_search[0].update(None, pega_temp) fl_search = gis.content.search(query_string, 'Feature Layer') print(len(fl_search)) fl_search[0].delete() pega_fl = item_search[0].publish()

but that would mean each update will delete/recreate the FL. I would lose any configuration for symbols/colors/etc.