|
POST
|
Use the Make Raster Layer function, don't create arcpy.mapping.Layer objects directly from raster datasets. It will add them to the TOC with the correct symbology.
... View more
10-16-2013
03:13 PM
|
0
|
0
|
1146
|
|
POST
|
# Delete the extraction folder
arcpy.Delete_management(srcExtractDir)
"""If the name is 'COF_ATMs':"""
elif name == "COF_ATMs":
"""Establish the Target Name"""
TargetName = "COF_ATMs" Should be:
# Delete the extraction folder
arcpy.Delete_management(srcExtractDir)
"""If the name is 'COF_ATMs':"""
elif name == "COF_ATMs":
"""Establish the Target Name"""
TargetName = "COF_ATMs" Also, why are you using """Strings as comments like this?"""
... View more
10-15-2013
12:43 PM
|
0
|
0
|
886
|
|
POST
|
import arcpy,os
from arcpy import env
path = r'H:\Python\Python\XX_pruebas'
lstFiles = []
for root, dirs, files in os.walk(path):
arcpy.env.workspace = root
files = arcpy.ListRasters("*", "JPG")
for fichero in files:
(nombreFichero, extension) = os.path.splitext(fichero)
if(extension == ".jpg"):
lstFiles.append(os.path.join(root, fichero))
print (lstFiles)
... View more
10-13-2013
03:13 PM
|
0
|
0
|
1000
|
|
POST
|
import os import arcpy shapeFileName = r"c:\some\output.shp" outFeature = os.path.join(r"c:\new\folder", os.path.basename(shapeFileName)) arcpy.CopyFeatures_management(shapefileName, outFeature)
... View more
10-11-2013
09:00 AM
|
0
|
0
|
2181
|
|
POST
|
You can use the copy tool, and then the delete tool on the old file. Though it would make more sense just to write the shapefile to the final destination to start with.
... View more
10-11-2013
08:29 AM
|
0
|
0
|
2181
|
|
POST
|
That looks like KML to me. There's a GP tool for that.
... View more
10-10-2013
12:13 PM
|
0
|
0
|
431
|
|
POST
|
Things like coordArray = arcpy.Array should really be coordArray = arcpy.Array(), note the parens at the end.
... View more
10-08-2013
10:40 AM
|
0
|
0
|
748
|
|
POST
|
tkMessageBox.showinfo("Process Completed","Member(s) " + ", ".join(str(ID) for ID in valueList) + " could not be located.")
... View more
09-27-2013
09:25 AM
|
0
|
0
|
638
|
|
POST
|
You may want to ask this on the ArcObjects or Geodatabase forum, this is an implementation-specific detail for each workspace type. Arcpy simply builds on the geodatabase's cursor model for accessing data. If you're using arcpy, the way to get transactions is using the arcpy.da.Editor object.
... View more
09-26-2013
08:51 AM
|
0
|
0
|
431
|
|
POST
|
The initial arcpy.da solution I provided should have worked if it had been correctly copied. The updateRow() call needs the list of values to be in a [list, like, this]. Either do this: with arcpy.da.UpdateCursor(PlanningProjectTracking, ["PROJECTNAME","STATUS","SUBMITTALDATE","DEVELOPEMENTTYPE","PLANNER","EDITDATE"], whereClause) as Ucursor:
for row in Ucursor:
Ucursor.updateRow([ProjectName,ProjStatus,SubmitDate,DevelopeType,PlannerName,today])
or Ucursor = arcpy.UpdateCursor(PlanningProjectTracking, whereClause)
for row in Ucursor:
for fieldname, value in (('PROJECTNAME', ProjectName),
('STATUS', ProjStatus),
('SUBMITTALDATE', SubmitDate),
('DEVELOPEMENTTYPE', DevelopeType),
('PLANNER', PlannerName),
('EDITDATE', today)):
row.setValue(fieldname, value)
Ucursor.updateRow(row) You do not need to specify all the arguments in the cursor. If a parameter is marked as optional in the documentation, you can omit it.
... View more
09-23-2013
03:53 PM
|
0
|
0
|
3852
|
|
POST
|
Ucursor = arcpy.UpdateCursor(PlanningProjectTracking, whereClause, "", ["PROJECTNAME","STATUS","SUBMITTALDATE","DEVELOPEMENTTYPE","PLANNER","EDITDATE"])for row in Ucursor:
for fieldname, value in [('PROJECTNAME', ProjectName), ('STATUS', ProjStatus), ('SUBMITTALDATE', SubmitDate), ('DEVELOPEMENTTYPE', DevelopeType), ('PLANNER', PlannerName), ('EDITDATE', today)]:
row.setValue(fieldname, value)
Ucursor.updateRow(row)
... View more
09-23-2013
01:14 PM
|
0
|
0
|
3852
|
|
POST
|
arcpy.da.UpdateCursor and arcpy.UpdateCursor are two different things, your script looks like it's creating an arcpy.da.UpdateCursor but treating it like an arcpy.UpdateCursor. You may be able to get away with your original script just by doing this: Ucursor = arcpy.UpdateCursor(PlanningProjectTracking, whereClause, ["PROJECTNAME","STATUS","SUBMITTALDATE","DEVELOPEMENTTYPE","PLANNER","EDITDATE"])
... View more
09-23-2013
08:14 AM
|
0
|
0
|
3852
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-26-2012 02:46 AM | |
| 2 | 01-06-2011 08:22 AM | |
| 1 | 03-25-2014 12:18 PM | |
| 1 | 08-12-2014 09:36 AM | |
| 1 | 03-31-2010 08:56 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:22 AM
|