Updating, Adding, and Automating Updates to Feature Layer in AGO using Python API

975
3
02-24-2022 12:26 AM
ChristopherCharles-Noriega
New Contributor II

Hello!
I am reaching out to see if anyone can provide information, resources, or tutorials that will help guide me in the right direction for a task I have taken on for my internship.

I'm new to Python API very novice. Still, I am tasked with creating a script that will update and add data to an AGO feature layer and automate updates to the layer from an API at specific time intervals (monthly) with little or no human intervention in AGO.

As I'm learning how to accomplish this task, I'm using a clone of the primary point feature layer, which will receive all the updates and TWO JSON samples of what would be received from the Service API endpoint. (which will run once a month).

The JSON samples are two types:

UPDATED features: 10 records
NEW features: 18 new records

Any advice from experts, resource recommendations, etc., would help get me started and be greatly appreciated.

0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

Did you check out the links to the right of your question?

links.png

Often they will get you started, even before you have to consult the api documentation.

API Reference for the ArcGIS API for Python — arcgis 2.0.0 documentation

which is fine if you know exactly what you are looking for


... sort of retired...
0 Kudos
jcarlson
MVP Esteemed Contributor

As Dan said, there are loads of examples already out there that probably cover this. I've even replied to some of them.

As far as advice, I cannot overstate the importance of familiarizing yourself with the pandas Python module, and Esri's spatially enabled dataframe. Not only will it make it easier to query layers and apply edits to them, but you it's also pretty good at reading in spatial features from JSON. The last time I had to do so, geopandas has been a bit easier to use when parsing JSON, so take a look at that, too.

- Josh Carlson
Kendall County GIS
DavidAnderson_1701
Occasional Contributor

Search for the answer. Google is your friend.  For example this site is easy to find https://developers.arcgis.com/python/sample-notebooks/

with this search phrase: arcgis python api samples.

ESRI has a bunch of documentation.  Plethora of you tube videos and stackexchange posts.

 

For someone us learning the API, taking hard route of reading through the documenation, using the Python dir command and the Jupyter notebook question mark (?) magic to figure it out on your own would pay off in the end.   

 

0 Kudos