Hi all,
I have a quick question this time:
How can you check if something is a hosted feature using python?
Use case: my script only works on local Feature Classes, and will throw an error if you use a hosted feature. I would like to check that it's not hosted so it can be skipped if it is hosted.
Thanks!
Solved! Go to Solution.
If you do a Describe on the feature class, a hosted feature catalog path should start with 'https'.
fc = 'https://services2.arcgis.com/dJOijx2lWTlGQBDJ/arcgis/rest/services/CW_3872/FeatureServer'
arcpy.Describe(fc).catalogPath
'https://services2.arcgis.com/dJOijx2lWTlGQBDJ/arcgis/rest/services/CW_3872/FeatureServer'
If you do a Describe on the feature class, a hosted feature catalog path should start with 'https'.
fc = 'https://services2.arcgis.com/dJOijx2lWTlGQBDJ/arcgis/rest/services/CW_3872/FeatureServer'
arcpy.Describe(fc).catalogPath
'https://services2.arcgis.com/dJOijx2lWTlGQBDJ/arcgis/rest/services/CW_3872/FeatureServer'