1-I want to batch the process. It will be very convenient not to select every filesmuself, but "tell python" where the files are located and let him selecting them.
2-When I run the script I get this message:
Failed to execute. Parameters are not valid.
The value cannot be a table
ERROR 000840: The value is not a Raster Layer.
Failed to execute (AddJoin).
I don't see where I the raster is involved in my process. The parameter for my arguments are Folder, Feature Class and Table. No raster around???
I am a little bit desperate!!
Thanks for your help
Steeve
################################################## ######################## #Join a table to a feature layer #Steeve Deschenes #Carex Canada #June 2010 ################################################## ####################### # Import system modules import sys, os, arcgisscripting # Create the Geoprocessor object gp = arcgisscripting.create() # Load required toolboxes... ## gp.AddToolbox("C:\Program Files\ArcGIS\ArcToolbox\Toolboxes\Data Management Tools.tbx") ## no need for system toolboxes # Local variables... workingfolder = sys.argv[1] source = sys.argv[2] concentration = sys.argv[3] #Set workspace gp.Workspace = workingfolder #Get a list of the feature classes in the input folder try: enumFC = gp.ListFeatureClasses() ## fcs.Reset() never actually implemented fc = enumFC.Next() i = 0 while fc : i+=1 print fc gp.MakeFeatureLayer_management (source, "source_lay") gp.MakeTableView_management ("NUMR_ECHN", "con_lay") # have to have Layers or Views for AddJoin not featureclasses or tables gp.AddJoin_management("con_lay", "NUMR_ECHN", "out_lay", "NUMR_ECHN_LOCL", "KEEP_ALL") gp.CopyFeatures_management ("out_lay", fc + "_resultat.shp") fc = enumFC.Next() except Exception, errmsg: gp.AddError(gp.GetMessages()) print errmsg,gp.GetMessages
Hi,
Sorry, I should be more explicit. I am using 9.3.1. In my geodatabase, I have a table (concentration) that I want to join a feature class (source) to. The "NUMR_ECHN" is the link for the table and NUMR_ECHN_LOCL" is the link for the feature class. I have about a hundred geodatabase located in about 20 different folders. the name of the geodatabase are 31M01_GR.mdb, 31M01_GS.mdb, 31M0-2_GR.mdb, 31M02_GS.mdb..etc.
When I run the script with the loop, I don't receive any error message but, I don't have any output either. When I run the command lines, I have this error message:
Executing: Append D:\CAREX_3\Test\Abitibi_Pontiac_A\31m\Géochimie D:\CAREX_3\Test\Abitibi_Pontiac_A\31m\Géochimie\31M01_GR.mdb\ECHANTILLON_LOCALISE_PT D:\CAREX_3\Test\Abitibi_Pontiac_A\31m\Géochimie\31M01_GR.mdb\RESULTAT_ANALYSE
Start Time: Tue Jun 08 11:45:31 2010
Running script Append...
<class 'arcgisscripting.ExecuteError'>: Failed to execute. Parameters are not valid.
ERROR 000840: The value is not a Feature Layer.
ERROR 000840: The value is not a Raster Catalog Layer.
Failed to execute (CopyFeatures).
Hi,
Sorry, I should be more explicit. I am using 9.3.1. In my geodatabase, I have a table (concentration) that I want to join a feature class (source) to. The "NUMR_ECHN" is the link for the table and NUMR_ECHN_LOCL" is the link for the feature class. I have about a hundred geodatabase located in about 20 different folders. the name of the geodatabase are 31M01_GR.mdb, 31M01_GS.mdb, 31M0-2_GR.mdb, 31M02_GS.mdb..etc.
When I run the script with the loop, I don't receive any error message but, I don't have any output either. When I run the command lines, I have this error message:
Executing: Append D:\CAREX_3\Test\Abitibi_Pontiac_A\31m\Géochimie D:\CAREX_3\Test\Abitibi_Pontiac_A\31m\Géochimie\31M01_GR.mdb\ECHANTILLON_LOCALISE_PT D:\CAREX_3\Test\Abitibi_Pontiac_A\31m\Géochimie\31M01_GR.mdb\RESULTAT_ANALYSE
Start Time: Tue Jun 08 11:45:31 2010
Running script Append...
<class 'arcgisscripting.ExecuteError'>: Failed to execute. Parameters are not valid.
ERROR 000840: The value is not a Feature Layer.
ERROR 000840: The value is not a Raster Catalog Layer.
Failed to execute (CopyFeatures).