ArcGIS Hub Data to fgdb

331
4
06-15-2020 06:33 PM
forestknutsen1
MVP Regular Contributor

I want to download data from the city's ArcGIS Hub with python and save it in a fgdb to then be loaded into sde. I have started with this tutorial - ArcGIS Hub. While I can get the feature layer with python I am having a hard time understanding how to save it to a gdb. (I have used arcpy a fair bit but I am new to this arcgis API)

from arcgis.features import FeatureLayer

shoreliness_url = \
    'https://services2.arcgis.com/Ce3DhLRthdwbHlfF/arcgis/rest/services/Shorelines_Hosted/FeatureServer/0'
shoreliness = FeatureLayer(shoreliness_url)
# ???

Suggestions?

Tags (1)
0 Kudos
4 Replies
JoshuaBixby
MVP Esteemed Contributor

Sorry for the non-helpful comment, but I saw ArcGIS Hub and all I could think about was

0 Kudos
forestknutsen1
MVP Regular Contributor

lol - you are not exactly filling me with confidence....

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

My issues are with the back-end configuration and management for organizations, particularly around caching.  I won't get into the details here, but Hub had a perfectly workable, user-defined/initiated caching scheme that Esri threw out the window a while back because, well, I don't know exactly.  Every "explanation" I have heard simply becomes white noise once I get a sense the product team think they know my needs better than myself. 

0 Kudos
DanPatterson
MVP Esteemed Contributor
url = "https://services2.arcgis.com/Ce3DhLRthdwbHlfF/arcgis/rest/services/Shorelines_Hosted/FeatureServer/0"

from arcgis.features import FeatureLayer

shoreliness = FeatureLayer(url)

for f in shoreliness.properties.fields:
    print(f['name'])
    
OBJECTID
PRJCTID
FID_MARINE_SELECT
SHORETYPE
MAPSOURCE
MAPACURACY
MAPDATE
QCSTATUS
NOTES
GLOBALID
MARINE_ID
HGUID
MAPAUTH
Shape__Length

hmmmm something amiss with your setup?

ArcGIS Pro 2.6 Beta 1 (sorry, no 2.5)

arcgis module installed in the base installation (ie, no clone)

numpy, pandas and the rest are already installed.  

I didn't install geopandas, so I can't help you with the geometry


... sort of retired...
0 Kudos