POST
|
I'd just use IF statements. Row objects have the fields as attributes, so you can use row.FIELD to clarify your code. inFeatures = os.getcwd() + '\\''myMDB.mdb\\myFC'
row = None
uc = arcpy.UpdateCursor(inFeatures):
for row in uc
if row.STATUS == 0:
row.HAZ_STATUS = "No Violations"
# if row.OTHERFIELD == X:
# row.HAZ_OTHER = 'Some Text'
uc.updateRow(row)
del uc, row
... View more
08-02-2012
04:46 AM
|
0
|
0
|
173
|
POST
|
Does your code add an underscore if you name the field something else? 'Public' sounds like a keyword. Considering you're setting domains there might be some conflict there, but that's just speculation on my part.
... View more
06-05-2012
10:53 AM
|
0
|
0
|
1014
|
POST
|
Are you running this within the Python Window? The 'current' keyword might be giving you trouble, I don't think you can call it from a script. mxd = arcpy.mapping.MapDocument("CURRENT")
... View more
06-05-2012
08:25 AM
|
0
|
0
|
333
|
POST
|
Matt, I was going to recommend the USGS's Hydro1K North America dataset, which has a slope raster derived from DEM data. The documentation may still be helpful, because it explains most of the processing steps. The data is at the 1 kilometer cell size, and may be too coarse for your needs. The count field contains the number of cells found within the polygons, if you have a counts in the 1-2 range this may explain why you are missing a few values. The reason you are missing stats for a few polygons is that those individual polygons may not contain a raster cell center. You could try using the resample tool to reduce the cell size. - John
... View more
05-24-2012
07:03 AM
|
0
|
0
|
957
|
POST
|
Not an ESRI solution, but I've removed the internal pyramids of a TIFF using the tiffsplit tool in the OSGeo4W shell (During install, include the libtiff package).
... View more
05-17-2012
06:33 AM
|
0
|
0
|
806
|
POST
|
Have you tried creating tables on disk from the the table views? # Make a tableview of impervious surfaces from the query.
query = """"Material" IN ('concrete', 'asphalt', 'wood', 'rubber', 'artificial', 'greenasphalt', 'blueasphalt','redasphalt')"""
arcpy.MakeTableView_management("Surfaces\\allSurfaces", "impsurfaces", query)
# Create a .dbf table in current workspace from the table view.
arcpy.CopyRows_management("impsurfaces", "impsurfaces.dbf")
# Make a table view containing all surfaces.
arcpy.MakeTableView_management("Surfaces\\allSurfaces", "surfacetotals")
arcpy.CopyRows_management("surfacetotals", "surfacetotals.dbf")
# Summarize to get total imp surface by property
arcpy.Statistics_analysis("impsurfaces.dbf", "Sewer", [["Shape.area", "SUM"]], "Property")
# Summarize to get total park area by property
arcpy.Statistics_analysis("surfacetotals.dbf", "Parksizes", [["Shape.area", "SUM"]], "Property")
#join the tables so we can do some calculations.
arcpy.JoinField_management("Sewer", "Property", "Parksizes", "Property", "SUM_Shape_area")
... View more
05-17-2012
05:54 AM
|
0
|
0
|
485
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|