Sign up ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

Many thanks for helping a newbie out :)

share|improve this question

6 Answers 6

In ArcGIS, 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.

Hope this helps!

share|improve this answer
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 '12 at 2:57

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer
When answering a question, please be specific instead of pointing to different directions. e.g. the user needs an answer in ArcGIS (not QGIS). – Farid Cher Sep 22 at 19:46

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.