Select to view content in your preferred language

Correcting a DEM, editing Z-values, Z-values from attributes

5073
2
11-07-2011 02:48 PM
Labels (1)
PaulHuffman
Frequent Contributor
I tried to run a watershed delimitation on a small piece of 10m DEM in Central Washington State.  I was getting some strange results and when I examined the accumulation grid, I found that a seam in the DEM was causing all the flow from an adjacent drainage to get captured by my drainage. 

I set about trying to correct this DEM.  I figured I'd just go Raster to Multipoint,  create a point FC with Z values to act like little dams and channels in the surface, create a new terrain from the multipoints and the new point feature class, then terrain to raster, and rerun the watershed.

But editing the point feature class has become my problem.  When I created the points layer, I created it to contain Z-values, and I added an attribute called VALUES, and when editing, I stuck the desired corrected elevation into the VALUES attribute.  The only way I could figure out to get the corrected elevation into the Z-values while editing was by editing the vertices under Sketch Properties, and I could only do one at a time. I thought I would just "Populate Zs from attributes".  But after I got this far, it seems that "Populate Zs from attributes" is only available from Production Z Management and Production Editing,  but I think Production Editing is only available in the Nautical or Aeronautical extensions which I don't have.  Searching support I found VBA solutions to updating Z values from attributes, but that seems to be only applicable to 9.x.  I'm trying to figure out how to do this in 10.0, SP3.
Tags (2)
0 Kudos
2 Replies
RichardFairhurst
MVP Alum
I tried to run a watershed delimitation on a small piece of 10m DEM in Central Washington State.  I was getting some strange results and when I examined the accumulation grid, I found that a seam in the DEM was causing all the flow from an adjacent drainage to get captured by my drainage. 

I set about trying to correct this DEM.  I figured I'd just go Raster to Multipoint,  create a point FC with Z values to act like little dams and channels in the surface, create a new terrain from the multipoints and the new point feature class, then terrain to raster, and rerun the watershed.

But editing the point feature class has become my problem.  When I created the points layer, I created it to contain Z-values, and I added an attribute called VALUES, and when editing, I stuck the desired corrected elevation into the VALUES attribute.  The only way I could figure out to get the corrected elevation into the Z-values while editing was by editing the vertices under Sketch Properties, and I could only do one at a time. I thought I would just "Populate Zs from attributes".  But after I got this far, it seems that "Populate Zs from attributes" is only available from Production Z Management and Production Editing,  but I think Production Editing is only available in the Nautical or Aeronautical extensions which I don't have.  Searching support I found VBA solutions to updating Z values from attributes, but that seems to be only applicable to 9.x.  I'm trying to figure out how to do this in 10.0, SP3.


Based on the ArcGIS 10 Field Calculator help you can adjust the coordinates of a point by using the field calculator on the Shape field of your point class.  Here is the example given:

"For a point feature class, shift the x coordinate of each point by 100.

Parser:
Python

Expression:
shiftXCoordinate(!SHAPE!)

Code Block:
def shiftXCoordinate(shape):
   shiftValue = 100
   point = shape.getPart(0)
   point.X += shiftValue
   return point
"

Adapting this to what you need it should be something like this (where the !VALUES! field should match the name of the attribute field containing the Z values you want to assign to your points and no values of that field should be Null):

Parser:
Python

Expression:
assignZCoordinate(!SHAPE!, !VALUES!)

Code Block:
def assignZCoordinate(shape, z_Value):
   point = shape.getPart(0)
   point.Z = z_Value
   return point


I hope this helps.
PaulHuffman
Frequent Contributor
Thanks Richard.

I didn't figure out a way to easily change a group of vertexes, but I figured out how most people update DEMs.  I've been creating a new point or line feature class with a item called "value", then editing in new elevation values into this "value" item,  then running this feature class through the "Feature to Raster" tool using the "value" item as the field input,  then slipping the new cell values into the old DEM with a Con statement in Map Algebra.  In the python window the syntax is like:

demfix = Con(IsNull(Raster("newvalues")),"olddem","newvalues")
0 Kudos