Sure. Basically you need to:
-
set up a new Notebook in DataBricks
-
import ArcGIS library (unless you’ve already installed it in your cluster)
dbutils.library.installPyPI("arcgis","1.6.2")
-
log in to ArcGIS Online and get the layer you want to update (or create a new one if needed)
#connect to GIS
from arcgis.gis import GIS
from arcgis.features import FeatureLayerCollection
gis = GIS(url,user,passwd)
item = gis.content.get(uuid)
flayer_collection = FeatureLayerCollection.fromitem(item)
-
Then use HTTP request to get data from Kobo:
import requests
from requests.auth import HTTPBasicAuth
response = requests.get(url, auth=HTTPBasicAuth(user, pwd))
-
Save the response into a CSV
-
Call the overwrite()
method from AGOL to update the layer:
flayer_collection.manager.overwrite('file.csv')
Note: your CSV file from KoBo must match data schema of your feature layer in ArcGIS Online. If this is not the case, you need to manipulate the data before overwriting.
Hope that helps!