AnsweredAssumed Answered

Just Trying to Copy a Feature Service to a Local Geodatabase

Question asked by rtcphilip on Aug 12, 2019
Latest reply on Aug 16, 2019 by rtcphilip

I will preface this post, in saying that I am new to script workflows in Python, and I believe that this process is probably very simple to accomplish but keep getting an error.  

 

All I am trying to do is export/copy a feature service it to a local geodatabase where I can work on it locally.  

 

I have provided the code below. I keep getting an "Object: Error in executing tool" for the last line where I am trying to copy the feature. 

 

from arcgis.gis import GIS
from arcgis.features.use_proximity import create_buffers

import arcpy

#########################################################################################

GDB_Name = input("Name Geodatabase")

Folder_Input = input("Provide Folder Path of Project")

Item_ID = input("Provide item ID")


#########################################################################################

gis = GIS("http://arcgis.com", "XXXXXXXX", "XXXXXXXXXXX")

search_results = gis.content.search('{}'.format(Item_ID))

Trail_Data = search_results[0]

WorkspaceGDB = arcpy.CreateFileGDB_management(Folder_Input, '{}.gdb'.format(GDB_Name))
print("GDB created")

arcpy.env.workspace = r'{}'.format(WorkspaceGDB)

arcpy.CopyFeatures(Trail_Data, "Area_Trail_Data")

Outcomes