I have an ArcMap 10 project with multiple layer groups. One layer is a raster DEM, another layer group is a bunch of vector shapefiles (including points, lines and polygons). The client wants all vector data to contain Z values.

Populating the attribute tables for the vector data with X and Y values is easy enough but how do I populate the Z values?

Is there a way that I can use Field Calculator to "grab" the height values from the DEM layer for each vector feature?

I should add that we don't have a licence for the 3D Analyst or Spatial Analyst extensions.

  • can't be done in ArcGIS without 3D analyst (or spatial analyst). Even if you had access to 3D Analyst, you can only do that for points and polylines provided these are elevation contours of the same elevation values. Interpolate Shape tool will crate 3D features but these will have varying elevation. You just can't easily convert that info into Z values attributes unless the features have perfectly flat elevations. Converting everything to points then interpolating Shape and calculating XYZ would work. Feb 1, 2019 at 21:42

7 Answers 7


In ArcGIS Desktop, I've only ever done this with point vectors—I'm not sure how you'd do it with polygons or line features. Unfortunately you do need Spatial Analyst, though. There's a tool at Spatial Analyst Tools\Extraction\Extract Multi Values to Points and Extract Values to Points. Extract Multi Values to Points is better because it lets you rename the z field name that you are extracting your values to—Extract Values to Points doesn't let you do this. I have trouble doing this in ArcMap (the tool crashes), but it works fine in ArcCatalog.

The (free) Hawths Analysis Tools extension for ArcMap had an Intersect Point Tool but development of the extension was discontinued a couple of years ago. It's been superseded by the Geospatial Modelling Environment, which I've never used.

SAGA-GIS (freeware standalone software) has two functions at Shapes - Grid\Add Grid Values to Points and Shapes - Grid\Add Grid Values to Shapes that can probably do what you want. This is the description of the Add Grid Values to Shapes tool:

Spatial Join: Retrieves information from the selected grids at the positions of the shapes of the selected shapes layer and adds it to the resulting shapes layer. For points this is similar to 'Add Grid Values to Points' module. For lines and polygons average values will be calculated from interfering grid cells. For polygons the 'Grid Statistics for Polygons' module offers more advanced options.

SAGA is your best bet, in my opinion.

  • 2
    Geospatial Modeling Environment has the following tools which may do the trick: 1) isectpolyrst (Intersect Polygons With Raster) 2) isectlinerst (Intersect Lines With Raster) 3) isectpntrst (Intersect Points With Raster). These tools can be a bit tempermental at times, however they will get the job done.
    – Aaron
    Jun 27, 2012 at 2:57
  • Note that Geospatial Modeling Environment is only compatible with ArcGIS 10.3 and below
    – Tung
    Oct 18, 2019 at 19:09

I haven't tried this for polygons but it works really well for points. In Arcmap 10 if you have access to a 3d analyst tool you can search for the Tool Interpolate Shape Then you select your raster file and your vector layer adjust the z values if you want elevations in feet and your DEM is in meters and let that run. Once it is complete you then search for the tool ADD XY and select your newly created layer and it will then calculate your X, Y,Z values in that layers attribute table.


The ESRI tool you would be looking to use is the "Add Z Information". Perhaps you can get a trial and see if the tool would be of further use for you. If getting the 3D Analyst extension is not an option, the only thing that comes to mind (other than a programming solution) is popping your data out of ESRI and using one of the free options such as SAGA-GIS / qGIS their "Add Grid Value to Shapes" or "Grid Statistics for Polygons" isn't as flexible as ESRI's but does the same thing if you're looking for the average height along the polygon / line.


maybe you could use gdallocationinfo to retrive all the Z values by passing it the X,Y values. once you have the Z values use the feild calculator to add the Z value to the points that make up each feature. There would be some scripting involved but in theory this should work.


Depending on your units or required resolution, you could always export the DEM raster into a polygon shapefile, straight from the toolbox, and then do a spatial join - this is easiest for points. If you need Z values for lines or polygons, you would obviously need defined segments or subdivisions of polygons at each change in elevation as reported by the vectorized DEM grid. That can be done via standard geoprocessing tools and spatial joins, but you need to pay close attention to your resolution requirements and the amount of processing that a large dataset will consume.


I recommend getting a 3D Analyst license and using Add Surface Information. Or, use Interpolate Shape followed by Add Z Information, which allows some features to return NA values without crashing the entire program. Otherwise, there are two proven free methods that require more legwork. It is possible to implement these from within QGIS, so that you don't have to leave your comfy GIS environs.


I know how to do this for points. Lines and polygons are different because they cross multiple grid cells of the DEM. You can make points along the lines or something like that and extract values for those. In Arc, you'll need spatial analyst to get the values, but you can get them through Qgis (free), though not as useful. You'll need to be skilled at working with excel files and converting them back and forth from shapefiles. The Qgis will generate a shapefile that has only the extracted point elevations, so you'll need to copy and paste that into your original table as an excel file (with the X,Y values, so you can make it back int a shapefile with "display x,y data"). You'll need to keep track of your projections to make sure to pick the right one when converting back to shapefile.

  • When answering a question, please be specific instead of pointing to different directions. e.g. the user needs an answer in ArcGIS (not QGIS). Sep 22, 2015 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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