|
POST
|
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). The key is just get CopyFeatures to work standalone. Even in the interactive window in pythonwin. I think the problem is your files beginning with a numeric digit. As a conservative strategy never name folders, files or featureclasses starting with a digit. You are not allowed to start field names with a digit in most databases. Also, to make life easy avoid spaces in folders and file names as well. This avoids having to quote everything and use r"path to a strange world" for everything. Although windows and Unix allows spaces, it causes endless problems in ArcGIS and other packages if you have names, variables and anything that is not meant to be a number starting with a number or including spaces.
... View more
06-10-2010
02:55 AM
|
0
|
0
|
1821
|
|
POST
|
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). The key is just get CopyFeatures to work standalone. Even in the interactive window in pythonwin. I think the problem is your files beginning with a numeric digit. As a conservative strategy never name folders, files or featureclasses starting with a digit. You are not allowed to start field names with a digit in most databases. Also, to make life easy avoid spaces in folders and file names as well. This avoids having to quote everything and use r"path to a strange world" for everything. Although windows and Unix allows spaces, it causes endless problems in ArcGIS and other packages if you have names, variables and anything that is not meant to be a number starting with a number.
... View more
06-10-2010
02:53 AM
|
0
|
0
|
1821
|
|
POST
|
After a bit of practice I have now completely replicated a DSMapBook application, plus a lot more. So rest easy all you DSMapBook enthusiasts. Some of the functions are still being worked on and renamed after the Pre-release, so there is a bit more to come. The basic idea is that the "mapbook" is the output document, not the project MXD. So you can load a PDF title page first, then export a series of PDF maps, each with its own MXD with different styles and page layouts, and then the trailing pages. Finally close the output document. Being able to assemble the pages from PDF individual pages avoids having to post process individual maps. There are additional tools to create strip map and grid indexes, and calculate adjacent sheet names, convergence and other settings needed for a series. Programming using the high level functions is a much easier than hacking the VB6 code for me because I have avoided using VB. At the same time the available tools are much more powerful that DSMapBook ever was. Especially the dynamic text to allow custom dynamic labels, images apart from being able to switch different layers on for each map. Not the same options form, you have to write a Python script for some things but in the end much more powerful and extendable.
... View more
06-08-2010
08:32 PM
|
0
|
0
|
3353
|
|
POST
|
The proper answer is YES, at 10.0 there is a new set of tools called "Data Driven Pages" that have the equivalent utilities that were available in DS MapBook menu: Strip Map Index Features makes a strip map Grid Map Index Features makes a grid of sheets Calculate Adjacent Fields (containing adjacent sheet names ) ... and three more relating to UTM zones, convergence and central meridians
... View more
06-08-2010
07:57 PM
|
0
|
0
|
1937
|
|
POST
|
I don't have enough information about your sources, paths and error messages to see what is going wrong.
... View more
06-08-2010
01:11 AM
|
0
|
0
|
1821
|
|
POST
|
Is there a geoprocessing tool that is equivalent to going to the options button on a table and selecting "Related Tables"? If not has anyone written a script that accomplishes the same? Thanks, Jeff Ward Try the keyfile toolbox and script. http://arcscripts.esri.com/details.asp?dbid=16286
... View more
06-03-2010
07:44 PM
|
0
|
0
|
341
|
|
POST
|
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 AddJoin only takes Layers and Views not featureclasses and tables, odd message but that is likely the reason. Here is my edited version as I think you want to do. Might have to edit it a bit more ################################################## ########################
#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
... View more
06-03-2010
07:38 PM
|
0
|
0
|
1820
|
|
POST
|
I've actually tried VB and Python (and every punctuation mark I could think of) and neither works. I ran out of things to try and ended up just doing this in ArcMap. I think the Calculate_Field tool is buggy or something because it works sometimes and othertimes it doesn't. It is more likely that you have data that causes a crash in the expression. If you use the field calculator you do not have the opportunity to trap data errors in a try/except block and its impossible to see what record caused it. Since the CalculateField simply wraps the expression in a cursor, it is much much better to use your own cursor in a script and do the expression inside a try/except block. CalculateField is more useful in interactive processes or models.
... View more
06-03-2010
06:22 AM
|
0
|
0
|
892
|
|
POST
|
fperks;16230 wrote: Heres an easy way to make arcpy non iterable objects usable in a for each loop.
for each in iter(lambda: <your object>.next(), None):
This basically iterates through getting the next element until the termination condition of the element being None is met. Thanks very much. Wonderfully Pythonic!
... View more
06-01-2010
04:27 AM
|
0
|
0
|
425
|
|
POST
|
I haven't really seen any bugs regarding comtypes and ArcObjects, except one: it doesn't wrap the esriSystem.Array object since there's a name clash with ctypes Array. I'd be curious as to what version of comtypes you've been using and what problems you've been seeing. I did notice that in arcpy the Array object is not iterable. I had to use the .next() function. Should I expect it to be iterable?
while row:
feat = row.getValue(shapefield)
qInterior = False
for partNum in range(feat.partCount) :
part = feat.getPart(partNum)
qInterior = False
for ptNum in range(part.count):
pt = part.next()
if pt != None:
arrayOuter.add(pt)
else :
qInterior = True
break # ignore donut vertices
arrayObj.add(arrayOuter)
arrayOuter.RemoveAll()
... View more
05-30-2010
07:09 PM
|
0
|
0
|
425
|
|
POST
|
Yes, its a real pain! Thefull list is in a couple of PDF files buried in the documentation folder in the ArcGIS install location. I have a little text file on my desktop that I can open and cut-and-paste the required transform string.
... View more
05-20-2010
03:17 AM
|
0
|
0
|
540
|
|
POST
|
I see that in one context the domain is included in the spatial reference object. However it is not included in the spatial reference projection file. So I was looking in the wrong place. Unless I looked up the geoprocessing diagram I would not have noticed that it was included. The issue of gp.Merge creating a different domain is still a problem. We are not supposed to have to set these with high precision geodatabases any more. Surely that is a bug?
... View more
05-17-2010
03:44 PM
|
0
|
0
|
468
|
|
POST
|
If the spatial reference of featureclasses are not identical to a dataset then you cannot load them. You get an error message. So you can change the spatial reference and try again. Nope. So export out and compare. Identical. The problem is actually in the DOMAIN values. Since these are now so large a default set is created in "high precision" geodatabases I have ignored these until now.... (Not to be confused with attribute domains) The trouble is that you cannot change the spatial domain once set even it the change would be irrelevant to the data content. Different tools create different default extents depending on the target geodatabase. A cut/paste copy will fail if the domains between the dataset and featureclass differ. The MERGE tool creates a slightly different spatial domain from other tools if merging from coverages to a 9.3 file geodatabase base layer. Then the output featureclass cannot be copied into a default dataset. If the target is a defaultly defined dataset (instead of the top-level geodatabase) then the domain of the featureclass is different and correctly defined to allow the merge to be completed. Suggested bugfixes: Get the error message updated to mention the domain difference if that is the case, instead of blaming the spatial reference. Maybe allow the domain to be altered on copy? Or have a special tool to fix the domain? I hope this is of use to everyone else puzzling about the misleading error message.
... View more
05-16-2010
04:06 PM
|
0
|
3
|
830
|
|
POST
|
When I do a Describe on a field in a featureclass to be able to create a foreign key in a new table you would think that the terms would match those required in AddField but they don't and the alternatives are not accepted in the tool. 'SmallInteger' has to change to 'SHORT' and so on. The only way is to make up a special dictionary as a workaround eg dFixTypeHack = {'SmallInteger": 'SHORT',..}
... View more
05-02-2010
09:28 PM
|
0
|
6
|
2867
|
|
POST
|
ArcGIS 10 puts its own copy of Python26 in a subdirectory of Python26/ArcGIS10.0 (!) When you install your own Python26 it does not copy the link for ArcGIS python extensions move Desktop10.pth and the numpy folder back to C:/Python26/Lib/site-packages and all will be standard and well. You can then delete the whole ArcGIS10.0 folder so that you only have one version of 2.6 installed
... View more
04-29-2010
04:46 PM
|
0
|
0
|
2755
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-26-2025 03:48 PM | |
| 1 | 05-08-2025 02:07 PM | |
| 1 | 05-07-2025 05:13 PM | |
| 3 | 04-04-2025 03:16 PM | |
| 2 | 05-07-2025 05:21 PM |
| Online Status |
Offline
|
| Date Last Visited |
10-20-2025
06:39 PM
|