Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have used Interpolate shape tool in 3D Analyst (ArcGIS 9.2) in order to obtain Z-values of each segment along the stream lines.

As input features I use Riverstream.shp file and as raster surface the DEM. With right click on interpolated riverstream.shp after opening the attribute table, I created new column for X and Y coordinates. With right click on each column(for X & Y) using Calculate geometry I obtained X,Y values.

I need also to obtain elevation values (Z-values ) for stream segment as well as length of each segment in meters (with Calculate geometry there is not option to obtain Z values). I tried with Field calculator but without success.

Can anybody help me : How can I assign Z-values of stream segments. For your help thank you in advance. Subija.

share|improve this question
try zonal statistics for your stream feature – Dr. A.D.Prasad Apr 9 '12 at 3:59

Assuming you have a polyline feature class with line segments you can use the following code in the field calculator.

In the pre-logic box

Dim pPolyline as IPolyline
set pPolyline = [Shape]

In the below text box you can use one of the three following lines depending on wich Z value you want.

From point


To point


Middle point

pPolyline.FromPoint.Z + (pPolyline.ToPoint.Z - pPolyline.FromPoint.Z) / 2

If like Tomek is saying you have a point feature class, you can simply use 'Add XY Coordinates' from the arctoolbox and it will create the X, Y and Z fields.

share|improve this answer

You do not realy say what kind of feature class you have. Assuming that your POINTS are already PointsM(Z) and you want to calculate Z's in to attributes table, there are few ways of doing this in 9.3. Though I am not sure whether you use 9.3 or 9.2. There are differences. Read this ESRI forum post. It should give you an answer. Otherwise you may want to use ET Geowizard toolbox. For up to 100 features in class it is for free.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.