Spatial Analysis Lab (SAL)

Extracting GRID values to a Point Feature Class

 

Back to the   GIS Tutorials & Help Page...                         Back to the   SAL Home Page...

 

 

To extract values from a GRID to a point layer you will need:

          A GRID theme (a DEM or slope or rainfall or whatever�)

          A Point theme (shapefile or Geodatabase Feature Class)

                   Note that this command does not work with Coverages

          The Spatial Analyst extension (which we have)

 

The basic process:

          1. Add your Points file and your GRID to ArcMap

          2. Turn on the Spatial Analyst extension

                   Choose Extensions� from the Tools menu

                   Check the box next to Spatial Analyst

          3. Open ArcToolbox

                   Icon or choose ArcToolbox from the Window menu

                   Spatial Analyst Tools / Extraction / Extract Values to Points

                   Enter the names of your Point theme, GRID and output file

              OR:

              Open the ArcGIS Command Line window

                   Icon or choose Command Line from the Window menu

                    In the command line enter:

                   ExtractValuesToPoints <pointlayer> <grid> <output_points.shp>

                   (using the names of your layers and an output file accordingly)

                  

Watch out for where ArcMap wants to put the output file... You can either enter a full path (i.e., C:\temp\output.shp) or you can first set your Environments Settings (right click on the main ArcToolbox and choose General Settings) so your Current Workspace is where you want it (C:\temp or wherever).

 

If you want your output file to be a Geodatabase Feature Class you�ll need to have (or create) a Geodatabase first.

 

This should create a new point Shapefile or Geodatabase Feature Class with all of the original point attributes plus the value of the grid. The grid value will be in a field named RASTERVALU.

 

If you run this same process again (e.g. with the output points file and a different GRID) the tool will write over the first values in the RASTERVALU field. Thus, if you want to run this with more than one GRID you will have to transfer the data from the RASTERVALE field to a new field before you run the tool again on a new GRID.

          Open the Attribute table for the output_points file

          Create a new field (setting the type and size appropriately)

                   Choose Add Field� from the Options menu

                   Choose Double or Long as the field Type

                   Set the Precision (number of digits possible)

                             and/or the Precision and the Scale (number of decimal places)

          Calculate the values from RASTERVALU to the new field

                   Right-click on the Field heading of your newly created field

                   Choose Calculate Values�

                   If you are not in an edit session, click Yes to ignore the warning

                   In the Field Calculator dialog box double click on RASTERVALU

                             (this should add [RASTERVALU] to the lower box

                   Click OK

          Optionally, you can now delete the RASTERVALU field

                   Right-click on RASTERVALU field heading

                   Choose Delete Field

 

 

If you have other attribute fields in your original GRID attribute table that you want to include in the output points file you will need to do a tabular join between the new output points attribute table and the original GRID attribute table

          From the Table of Contents

          Right click on the output_points layer

          Choose Joins and Relates

          Choose Join�

          Choose Join attribute from a table

          For the field to base the join on, choose RASTERVALU

          Choose your original GRID for the table to join to

          Choose Value as the field to join to

          Click OK

          Open the output_points attribute table to verify the results

 

IF the join fails (your output_points attribute table contains null values for the joined fields), try this work-around

          Open the GRID attribute table

          Make sure no records are selected

          From the Options menu, choose Export�

          Enter a name and location for the new table       

          From the Table of Contents

          Right Click on the output_points layer

          Choose Joins and Relates

          Choose Remove Join(s)

          Choose Remove All Joins

          Repeat the Join as above, but join to the newly exported copy of the GRID�s

                   attribute table

 

To make the joined attributes a permanent part of the output_points attribute table you can export the entire points file to a new points file

          Make sure no records are selected

          From the Table of Contents

          Right click on the output_points layer

          Choose Data

          Choose Export Data

          Enter a name and location for the new file

         

 

Back to the   GIS Tutorials & Help Page...                         Back to the   SAL Home Page...

ISIA | HML | SAL | Website (stefan) | Lab Manager (Dave Knutson)