Python Script Geoprocessing Service ERROR 000732: Input Features: Dataset

المشرف العام

Administrator
طاقم الإدارة
I am able to run my script and publish it to the server, but when i run it from the server I am getting this error:

Traceback (most recent call last): File "D:\arcgisserver\directories\arcgissystem\arcgisinput\Reporting\AdminReport.GPServer\extracted\v101\adminreport\adminReport.py", line 49, in arcpy.MakeFeatureLayer_management(parcelFeatures,g_ESRI_variable_1) File "c:\program files\arcgis\server\arcpy\arcpy\management.py", line 6509, in MakeFeatureLayer raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Features: Dataset D:\arcgisserver\directories\arcgissystem\arcgisinput\Reporting\AdminReport.GPServer\extracted\v101\Public_Data.gdb\Administrative\Parcels_2013 does not exist or is not supported Failed to execute (MakeFeatureLayer). Failed to execute (Script). Failed to execute (Script)

I am under the assumption there is an issue with the relative path names? I am unsure. Here is my code:

# ---------------------------------------------------------------------------# Description: Geoprocessing Service for Administrative Report.## This tool Inputs a parcel FID From a user and returns# attributes of the FID from the following data layers: # HL Region, HL Conformance Status, and HL Centers# Return Type is PJSON. # ---------------------------------------------------------------------------# Import modulesimport arcpyfrom arcpy import envimport osimport sys# Set Relative PathsscriptPath = sys.path[0]thisFolder = os.path.normpath(os.path.dirname(scriptPath))env.overwriteOutput = TrueparcelFeatures = os.path.join(thisFolder, "Public_Data.gdb", "Administrative" + os.path.sep + "Parcels_2013")capFeatures = os.path.join(thisFolder, "Public_Data.gdb", "Administrative" + os.path.sep + "Conformance_Approved_Petitions")regionFeatures = os.path.join(thisFolder, "Public_Data.gdb", "Administrative" + os.path.sep + "Preservation_And_Planning_Area")centerFeatures = os.path.join(thisFolder, "Public_Data.gdb", "Administrative" + os.path.sep + "HL_Designated_Centers")parcelFID = arcpy.GetParameterAsText(0)#Definition Query of Parcel Layerarcpy.MakeFeatureLayer_management(parcelFeatures,"parcel_lyr")parcelLyr = arcpy.mapping.Layer("parcel_lyr")parcelLyr.name = "parcel"parcelLyr.definitionQuery = "OBJECTID = " + parcelFID# Set In Memory variables interCAP = arcpy.CreateScratchName("interCAP", "", "featureclass", "in_memory") # Intersect CAParcpy.Intersect_analysis([parcelLyr ,capFeatures], interCAP, "ALL", "", "INPUT")capCount = arcpy.GetCount_management(interCAP)print(str(capCount) + " Feature(s) Found")if capCount > 0: # Set in_memory variable disCAP = arcpy.CreateScratchName("disCAP", "", "featureclass", "in_memory") # Dissolve CAP arcpy.Dissolve_management(interCAP, disCAP, ["FID_Parcels_2013","REGION", "Approval"], "", "MULTI_PART", "DISSOLVE_LINES")arcpy.Delete_management(interCAP)print("Processing Highlands Planning Area...")#Definition Query of Planning Areaarcpy.MakeFeatureLayer_management(regionFeatures,"planning_lyr")planningLyr = arcpy.mapping.Layer("planning_lyr")planningLyr.name = "planning"planningLyr.definitionQuery = '"REGION" = ' + "'Highlands Planning Area'"# Set in_memory variableinterPlanning = arcpy.CreateScratchName("interPlanning", "", "featureclass", "in_memory") # Intersect Regionarcpy.Intersect_analysis([parcelLyr ,planningLyr], interPlanning, "ALL", "", "INPUT")planningCount = arcpy.GetCount_management(interPlanning)print(str(planningCount) + " Feature(s) Found")if planningCount > 0: # Set in_memory variable disPlanning = arcpy.CreateScratchName("disPlanning", "", "featureclass", "in_memory") # Dissolve Region arcpy.Dissolve_management(interPlanning, disPlanning, ["FID_Parcels_2013","REGION", "acres"], "", "MULTI_PART", "DISSOLVE_LINES") # Calculate Region Acres arcpy.CalculateField_management(disPlanning, "acres", "!shape.area@acres!", "PYTHON_9.3", "")arcpy.Delete_management(interPlanning)print("Processing Highlands Preservation Area...")#Definition Query of Planning Areaarcpy.MakeFeatureLayer_management(regionFeatures,"pres_lyr")presLyr = arcpy.mapping.Layer("pres_lyr")presLyr.name = "preservation"presLyr.definitionQuery = '"REGION" = ' + "'Highlands Preservation Area'"# Set in_memory variableinterPres = arcpy.CreateScratchName("interPres", "", "featureclass", "in_memory") # Intersect Regionarcpy.Intersect_analysis([parcelLyr ,presLyr], interPres, "ALL", "", "INPUT")presCount = arcpy.GetCount_management(interPres)print(str(presCount) + " Feature(s) Found")if planningCount > 0: # Set in_memory variable disPres = arcpy.CreateScratchName("disPres", "", "featureclass", "in_memory") # Dissolve Region arcpy.Dissolve_management(interPres, disPres, ["FID_Parcels_2013","REGION", "acres"], "", "MULTI_PART", "DISSOLVE_LINES") # Calculate Region Acres arcpy.CalculateField_management(disPres, "acres", "!shape.area@acres!", "PYTHON_9.3", "")arcpy.Delete_management(interPres)print("Processing Highlands Centers...")# Set In Memory variableinterCenter = arcpy.CreateScratchName("interCenters", "", "featureclass", "in_memory") # Intersect Centerarcpy.Intersect_analysis([parcelLyr ,centerFeatures], interCenter, "ALL", "", "INPUT")centerCount = arcpy.GetCount_management(interCenter)print(str(centerCount) + " Feature(s) Found")if centerCount > 0: # Set In Memory variable disCenter = arcpy.CreateScratchName("disCenter", "", "featureclass", "in_memory") # Dissolve Center arcpy.Dissolve_management(interCenter, disCenter, ["FID_Parcels_2013","Zone", "Muni_Name"], "", "MULTI_PART", "DISSOLVE_LINES") arcpy.Delete_management(interCenter)#Get Field Valuesdef getObjectID(): with arcpy.da.UpdateCursor(parcelLyr, "OBJECTID") as cursor: for row in cursor: return(row[0])objectID = getObjectID()print(objectID)def getPlanAcres(): with arcpy.da.UpdateCursor(disPlanning, "acres") as cursor: for row in cursor: return(row[0])planAcres = getPlanAcres()print(planAcres)def getPresAcres(): with arcpy.da.UpdateCursor(disPres, "acres") as cursor: for row in cursor: return(row[0])presAcres = getPresAcres()print(presAcres)def getConfRegion(): with arcpy.da.UpdateCursor(disCAP, "REGION") as cursor: for row in cursor: return(row[0])confRegion = getConfRegion()print(confRegion)def getConfDate(): with arcpy.da.UpdateCursor(disCAP, "Approval") as cursor: for row in cursor: return(row[0])confDate = getConfDate()print(confDate)def getCenterZone(): with arcpy.da.UpdateCursor(disCenter, "Zone") as cursor: for row in cursor: return(row[0])centerZone = getCenterZone()print(centerZone)def getCenterMuni(): with arcpy.da.UpdateCursor(disCenter, "Muni_Name") as cursor: for row in cursor: return(row[0])centerMuni = getCenterMuni()print(centerMuni)#create Tableprint("Creating Table...")tempTable = arcpy.CreateTable_management("in_memory", "tempTable")arcpy.AddField_management(tempTable, "Parcel_FID", "LONG")arcpy.AddField_management(tempTable, "Plan_Acres", "DOUBLE")arcpy.AddField_management(tempTable, "Pres_Acres", "DOUBLE")arcpy.AddField_management(tempTable, "Conf_Region", "TEXT", field_length=30)arcpy.AddField_management(tempTable, "Conf_Date", "TEXT", field_length=30)arcpy.AddField_management(tempTable, "Center_Zone", "TEXT", field_length=30)arcpy.AddField_management(tempTable, "Center_Muni", "TEXT", field_length=30)#calculate values for each fieldcursor = arcpy.InsertCursor(tempTable)row = cursor.newRow()row.setValue("Parcel_FID", objectID)row.setValue("Plan_Acres", planAcres)row.setValue("Pres_Acres", presAcres)row.setValue("Conf_Region", confRegion)row.setValue("Conf_Date", confDate)row.setValue("Center_Zone", centerZone)row.setValue("Center_Muni", centerMuni)cursor.insertRow(row)del rowrecordSet = arcpy.RecordSet(tempTable)outputTable = arcpy.Describe(recordSet)arcpy.SetParameter(1, outputTable.pjson)print(outputTable.pjson)#Clean uparcpy.Delete_management(disCenter)arcpy.Delete_management(disPlanning)arcpy.Delete_management(disPres)arcpy.Delete_management(disCAP)arcpy.Delete_management(parcelLyr)print("Success?")

أكثر...
 
أعلى