I would like to upload local GeoJSON files with Python automatically to ArcGIS Online. Now I have to upload them one for one, which takes quite some time. So I looked into the ArcGIS API for Python.
I saw two ways you can upload data to ArcGIS online:
- With help of the spatially enabled dataframe, but this seems to be only working with shapefiles or an ESRI database and not GeoJSON files or a Geopandas dataframe
- Using the add() method on a ContentManager instance, with this method you can upload a pandas DataFrame or a csv file to ArcGIS Online. However, I cannot figure out how you can upload a polygon feature layer. All the examples are with points.
Can someone provide me with a simple example of how to upload GeoJSON (polygons) or GeoPandas DataFrame to ArcGIS Online with Python?