Extract Z values of a raster layer to a point shapefile

Last Published: April 25, 2020


Instructions provided describe how to extract Z values from a raster surface and write them into a point shapefile attribute table with the field calculator.

In ArcGIS 9.0, the Spatial Analyst Geoprocessing Toolbox has a tool called Extract Values to Points, which produces the same output.


  1. Add the point shapefile and the surface to a map, making certain the point featureclass is listed first in the table of contents.

    The point shapefile and raster must share the same coordinate system.

  2. Add a numeric field to the point attribute table.
  3. Right-click the new field heading > Calculate Values. Check the Advanced box.
  4. In the pre-logic script edit box enter:

    Dim pDoc As IMxDocument
    Dim pMap As IMap
    Dim pRLayer As IRasterLayer
    Dim pIdentify As IIdentify
    Dim pIDArray As IArray
    Dim pRIDObj As IRasterIdentifyObj
    Dim pPoint As IPoint
    Dim iPixelValue As Integer

    Set pDoc = ThisDocument
    Set pMap = pDoc.FocusMap
    Set pRLayer = pMap.Layer(1)
    Set pIdentify = pRLayer
    Set pPoint = New Point
    'Get point
    Set pNewPoint = [Shape]
    Set pIDArray = pIdentify.Identify(pNewPoint)
    If Not pIDArray Is Nothing Then
    Set pRIDObj = pIDArray.Element(0)
    'Get the value of the RasterIdentifyObject and add it to the field
    iPixelValue = pRIDObj.Name
    End If

  5. In the '<new fieldname> =' box enter:


  6. Click OK and the raster Z values are added to the attribute field.

Article ID:000006748

  • ArcMap 8 x
  • ArcMap 9 x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options