import arcpy from arcpy import env from arcpy.sa import* from arcpy.ga import* arcpy.env.workspace = "C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\S_Gauges.gdb" arcpy.env.overwriteOutput=True lyrpath = "C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\GA_lyrs" ptpath="C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\GA_Krig.gdb" # Check out the ArcGIS Geostatistical Analyst extension license arcpy.CheckOutExtension("GeoStats") #modelTemplate="C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\GA_Model.lyr" modelxml=("C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\EmpiricalBayesianKriging.xml") print 'listing feature classes' fcs=arcpy.ListFeatureClasses("a734184") for fc in fcs: print fc try: print 'listing fields' fields = arcpy.ListFields(fc,"Wlevel") for field in fields: print ("{0} is a type of {1} with a length of {2}".format(field.name, field.type, field.length)) zfield="Wlevel" outlyr=lyrpath+"/"+fc+"_GA.lyr" outpts=ptpath+"/"+fc+"_GA_pt" #cellsize=0.0008333333333 print'creating geostatistical layer' infc=fc + " Wlevel" arcpy.GACreateGeostatisticalLayer_ga(modelxml,infc,outlyr) print 'converting GA layer to grid' arcpy.GALayerToPoints_ga(outlyr,fc,zfield,outpts) except: print arcpy.GetMessages() print 'script complete'
>>> listing feature classes a734184 listing fields Wlevel is a type of Double with a length of 8 creating geostatistical layer converting GA layer to grid Executing: GALayerToPoints C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\GA_lyrs/a734184_GA.lyr C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\S_Gauges.gdb\a734184 Wlevel C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\GA_Krig.gdb\a734184_GA_pt ALL Start Time: Thu Apr 24 12:12:05 2014 Failed to execute. Parameters are not valid. ERROR 000732: Input geostatistical layer: Dataset C:\Users\mbs7038\Documents\New_Landsat_Imagery\For_Area_Calc\Gauges_For_AccuracyAssessment\S_Gauges\GA_lyrs/a734184_GA.lyr does not exist or is not supported Failed to execute (GALayerToPoints). Failed at Thu Apr 24 12:12:05 2014 (Elapsed Time: 0.00 seconds) script complete >>>
Solved! Go to Solution.