-
Notifications
You must be signed in to change notification settings - Fork 154
Samples for calcExpression #31
Comments
When you are replacing large amounts of data, you can try the apply edits function, or even replace the data source of the feature service. To do the replace data source, the workflow goes something liek this:
The workflow is documented here: http://blogs.esri.com/esri/arcgis/2014/01/24/updating-your-hosted-feature-service-for-10-2/ Hope this helps |
The layer has sync enabled and collector for arcgis users work offline. Wouldnt overwriting break unsynchronizeed replicas? Also, i realized i was attempting to calculate two fields at once. It was odd the the second field:value succeeded and arcrest ignores the first field:value object. My current workflow involves inserting new hosted features into a local sql server. I then have to update 2-5 fields on the hosted layer based on the local inserts. field calculator makes an individual update 2-5 time for up to 1000 features. ArcArcREST 1.0 had a sample with bulk updateing, but it was only updating static values. Pehaps arcREST 2.0 could have a bulk applyEdits from dictionary instead of static numbers? One last comment. I have read through the featureservice.query and layer.query and I almost understand it. However, i dont understand why a feature layer whose service is sync enabled only has the option to download as a fgdb. The fgdb name is a random string (replica string name) which makes it difficult to identify and call the single feature class as intermediate step. A query also seems to allow json as an output. I've had no luck creating a bidirectional replica when the parameter outputs locally. If the fgdb is prefered over json could there be a sample with setting the fgdb name during creation? |
Yes, overwriting will break sync, so your only option is to pull down the data, make the changes and update the features using ApplyEdits or Update. You cannot use a replica as far as I know because a GDB replica is one way. |
I'm just finishing up a script the bidirectionally syncs data between a hosted layer and a local sql table. The local source could just as easily be an excel worksheet. Instead of leveraging replicas, it simply compares 2 dicts to accomplish this. Date fields determine which source is updated. For my purposes, I only add features from hosted to the local source and update features on both sources. I'm curious if having an ArcREST sample that expands on this workflow to handle adds, removals, and updates (with or without spatial columns) would be beneficial for others? it would take a little while to generalize the functions. |
I'm trying to update some fields in a featureLayer based on a local feature class (a copy of the hosted layer).
I'm not sure how to create the input of calcExpression for many fields besides:
Is the anything within ArcREST to make calling each field name and value more efficient?
I also looked into updateFeatures but I'm not sure how that would work within my main cursor:
I am only updating 2 fields in the example but want to know if there is a better way to update multiple fields for 1000's of features.
The text was updated successfully, but these errors were encountered: