|
POST
|
The best solution I have found is to copy the original OID field, and then carry on. Changing the copied OID field to the actual OID field, if necessary, would require more than the arcpy package has to offer I believe.
... View more
09-28-2011
10:12 AM
|
0
|
0
|
498
|
|
POST
|
What code is failing? Have you tried FeatureClassToFeatureClass_conversion tool? Are you using the right keyword?
... View more
09-28-2011
10:10 AM
|
0
|
0
|
503
|
|
POST
|
Background: When trying to improve speed of script, changed JoinField tool to AddJoin tool. The former was taking over 3 hours to join, the later a few seconds. Later in the script when trying to create an UpdateCursor I get an error when using the temporary join (AddJoin). Previously ran fine with permanent join (JoinField). Or when exported after temporary join. Is this normal or a bug? Does anyone know of a faster way to process joined data? Edit: Line giving error: rows = arcpy.UpdateCursor(calc_table) Error received: Traceback (most recent call last):
File "<pyshell#15>", line 1, in <module>
rows = arcpy.UpdateCursor(calc_table)
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\__init__.py", line 825, in UpdateCursor
return gp.updateCursor(*args)
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 362, in updateCursor
self._gp.UpdateCursor(*gp_fixargs(args)))
RuntimeError: ERROR 999999: Error executing function.)
... View more
09-27-2011
01:12 PM
|
0
|
2
|
727
|
|
POST
|
A while ago I recall hearing the built in select by attributes dialogue having already started querying the data when it is opened (list of fields, names, joins etc) which already takes care of some of the overhead that the arcpy.SelectLayerByAttribute_management() still has to go through. Making different selections based on changing criteria that you input will not gain you any performance using python scripts than using the built in tools, or else Esri would have coded the built in dialogue to be the same as the arcpy tool. The performance gain is in automation. Not having to query the same (or similar) data over and over and over and over again. Another method you may want to try is creating a feature layer query. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000006p000000 Using a where clause with this tool may give you the performance speed you are looking for, depending on why you need to make a selection at all.
... View more
09-27-2011
10:24 AM
|
0
|
0
|
696
|
|
POST
|
I'd wager it has something to do with the square brackets around your field name. Try \"AREA_NAME\" instead. Edit: I forgot personal GDB need those, Esri hates personal GDB so migrate while you can.
... View more
09-27-2011
06:40 AM
|
0
|
0
|
570
|
|
POST
|
Still want to know how to put the list of dataframes into a list you can select from in arcCatalog. Not sure I quite understand what you are looking for. You mean just a table of the data frame names?
... View more
09-21-2011
06:09 AM
|
0
|
0
|
2470
|
|
POST
|
I find update cursor to be faster than calculate field in most operations. Example
rows = arcpy.UpdateCursor(layer)
for row in rows:
row.values = 1
rows.updateRow(row)
For more detail see http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000003m000000
... View more
09-20-2011
05:07 AM
|
0
|
0
|
2470
|
|
POST
|
The Advanced Settings utility is located in your install\Utilities directory, depending on what OS you are using. E.g. on Windows 7 machine, ArcGIS 10.0 default install, it would be in C:\Program Files (x86)\ArcGIS\Desktop10.0\Utilities As to ArcMap and arcpy module operating differently, I have had issues in the past with exporting a PDF out of ArcMap working fine, and exporting a PDF using arcpy using the same parameters failing. I don't know if it is a memory management difference between the two, or ghosts in my machine, it just doesn't seem to be consistent.
... View more
09-19-2011
06:21 AM
|
0
|
0
|
1530
|
|
POST
|
So this is just an image, not a geotiff basemap or anything? How big is it? If it is exporting with default values, memory or something must be an issue. I would try restarting your computer so memory is fresh, then add each parameter you want to customize one at a time to see where it hits the wall. You can also try setting smaller metafile/raster buffer size in advanced arcmap setting utility, to see if that helps.
... View more
09-14-2011
12:41 PM
|
0
|
0
|
1530
|
|
POST
|
Have you tried exporting the PDF with default settings? i.e. arcpy.mapping.ExportToPDF(mxd, str(output_path))
... View more
09-14-2011
09:05 AM
|
0
|
0
|
1530
|
|
POST
|
Nevermind, didn't see some of your other comments... Try the below, your code seems a little needlessly complex for the operation you are doing. Unless I am missing something. Should be as simple as.
tableList = arcpy.ListTables()
for table in tableList:
fieldList = arcpy.ListFields(table)
for field in fieldList:
... View more
09-13-2011
10:47 AM
|
0
|
0
|
2491
|
|
POST
|
Step1 to any ESRI geoprocessing analysis: Copy all the data to a local hard drive (perferably in .shp or FGDB format), then proceed with the analysis (i.e. Don't use data directly from a network connection!). +1 no upvote button...
... View more
09-08-2011
11:01 AM
|
0
|
0
|
3749
|
|
POST
|
Yes Chris' solutions would probably be better, I was passing the list as a tuple list instead of a list list.
... View more
09-08-2011
09:11 AM
|
0
|
0
|
3749
|
|
POST
|
Something like this should work. (won't) query = 'OID in '+OIDlist
gp.SelectByAttribute(layername, "ADD_TO_SELECTION", query) This would work better. query = 'OID in '+str(OIDlist)
gp.SelectByAttribute(layername, "NEW_SELECTION", query) By the way, what version of Arc are you running?
... View more
09-08-2011
07:19 AM
|
0
|
0
|
3749
|
|
POST
|
Creating a polygon is fairly simple.
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]
extent = df.extent
array = arcpy.Array()
array.add(extent.lowerLeft)
array.add(extent.lowerRight)
array.add(extent.upperRight)
array.add(extent.upperLeft)
array.add(extent.lowerLeft)
polygon = arcpy.Polygon(array)
arcpy.CopyFeatures_management(polygon, r"C:\GIS\Default.gdb\polytest")
After that adding fields and inputting some map document properties shouldn't be hard, but I don't have an example of it handy. See http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/MapDocument/00s30000000n000000/
... View more
09-08-2011
06:12 AM
|
0
|
0
|
2470
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-17-2011 10:36 AM | |
| 1 | 08-16-2012 10:48 AM | |
| 1 | 10-31-2012 08:39 AM | |
| 1 | 07-16-2012 01:52 PM | |
| 1 | 03-15-2012 10:57 AM |
| Online Status |
Offline
|
| Date Last Visited |
08-22-2024
11:12 PM
|