Updating a Feature Service with a GP Service

07-21-2015 06:01 AM
Occasional Contributor

I want to write a tool in python and publish it as a geoprocessing service.  I want the tool to import a dataset (excel spreadsheet or kml file) and update an existing editable feature service.  I'm pretty sure I can use some python libraries to parse the data and put it into json and make a post call to the rest api.

However, is there another way?  Does ESRI have any sort of built in functionality for this?  Seems like there should be.


0 Kudos
1 Reply
Esri Frequent Contributor

Are you appending new features to the feature service, or updating existing features?  If you're appending new features, (maybe the excel spreadsheet has spatial information, like X/Y fields), then you can create the features and use the append tool to append the new features to the datasets included in the feature service.  If you're updating existing features, you can use an UpdateCursor​.  You can find the features you need to find within the feature service using the attributes within the excel sheet and then use an Update Cursor to update the feature attributes.  You can either update the datasets in your SDE database or use the editing functions through Rest, (ApplyEdits, AddFeatures, etc) to update the feature service in a Rest call.

0 Kudos