Calling Script
--start Here --
arcpy.AddMessage(sqlQuery)
outRaster=arcpy.env.scratchGDB+os.path.sep+"heatMap"
#outRaster=arcpy.GetParameterAsText(3)
arcpy.MakeFeatureLayer_management(inFeatures,"inFeatures1",sqlQuery)
arcpy.AddMessage("feature Count:"+str(arcpy.GetCount_management("inFeatures1")))
descFeatures=arcpy.Describe("inFeatures1")
result=arcpy.GetCount_management("inFeatures1")
count = int(result.getOutput(0))
arcpy.env.mask=descFeatures.extent
arcpy.AddMessage(str(count))
#TODO: test For Selection
if count==0:
arcpy.AddMessage("Error")
arcpy.SetParameter(6,"")
else:
arcpy.AddMessage("Continue")
#TODO: process Kerenl Density
processStart=datetime.datetime.now()
arcpy.AddMessage("***generate Kernel Density Surface")
arcpy.gp.KernelDensity_sa("inFeatures1", modelFld, outRaster, "", searchReadius, "SQUARE_MAP_UNITS")
arcpy.AddMessage(str(datetime.datetime.now()-processStart))
#TODO: check In License
arcpy.AddMessage("***check In Spatial Analyst")
arcpy.CheckInExtension("spatial")
#TODO: set Output
arcpy.AddMessage("***set The Output Layer")
arcpy.SetParameter(6,outRaster)
Complete Messaging
Job Messages:
esriJobMessageTypeInformative: Submitted.
esriJobMessageTypeInformative: Executing...
esriJobMessageTypeInformative: Executing (MED_KDInterpolate_POC_withparameters): MEDKDInterpolatePOCwithparameters "Corinthian,Philip V" hok # # # Estimated_catch__gwt_ C:\Users\services\AppData\Local\Temp\med\medkdinterpolatepoc_demo_gpserver\je2f1a43da2ef49bc9585d464cf91e4c4\scratch\scratch.gdb\heatMap
esriJobMessageTypeInformative: Start Time: Thu Oct 18 08:44:54 2012
esriJobMessageTypeInformative: Executing (MEDKDInterpolatePOCwithparameters): MEDKDInterpolatePOCwithparameters "Corinthian,Philip V" hok # # # Estimated_catch__gwt_ C:\Users\services\AppData\Local\Temp\med\medkdinterpolatepoc_demo_gpserver\je2f1a43da2ef49bc9585d464cf91e4c4\scratch\scratch.gdb\heatMap
esriJobMessageTypeInformative: Start Time: Thu Oct 18 08:44:54 2012
esriJobMessageTypeInformative: Running script MEDKDInterpolatePOCwithparameters...
esriJobMessageTypeInformative: *** Kernel Density Generator with Parameters ***
esriJobMessageTypeInformative: ***check Out Spatial Analyst
esriJobMessageTypeInformative: "Vessel_Name" IN ('Corinthian', 'Philip V') AND "Species" IN ('hok')
esriJobMessageTypeInformative: feature Count:0
esriJobMessageTypeInformative: 0
esriJobMessageTypeInformative: Error
esriJobMessageTypeInformative: completed
esriJobMessageTypeInformative: 0:00:04.962000
esriJobMessageTypeInformative: Completed script MEDKDInterpolatePOCwithparameters...
esriJobMessageTypeInformative: Succeeded at Thu Oct 18 08:45:00 2012 (Elapsed Time: 6.00 seconds)
esriJobMessageTypeInformative: Succeeded at Thu Oct 18 08:45:00 2012 (Elapsed Time: 6.00 seconds)
esriJobMessageTypeError: Invalid return value: C:\Users\services\AppData\Local\Temp\med\medkdinterpolatepoc_demo_gpserver\je2f1a43da2ef49bc9585d464cf91e4c4\scratch\scratch.gdb\heatMap
esriJobMessageTypeError: Failed.