Z value of a points in 2d map

4656
10
Jump to solution
05-15-2021 11:34 AM
matu89
by
New Contributor II

hey,

i draw a few points on a dem raster,

than with the help of the tool add geometry attributes i added to the attribute table X,Y and Z coordinates.

when i open the attribute table i dont get the Z value.

P.S 

in the map properties i added the correct vertical coordinate system.

the main issue for me is to get the Z value in a 2d map and not in a 3d map.

you can view the img  that describes  the issue here:

https://ibb.co/Y8L8HDq

thanks.

 

 

0 Kudos
1 Solution

Accepted Solutions
JayantaPoddar
MVP Esteemed Contributor

Rightly pointed by Dan, you can use Extract Values to Points (Spatial Analyst) tool to extract the Z Values from DEM Raster to the Points (This will create a new Feature Class).

In case you are not interested in creating an additional feature class, you may use Add Surface Information tool (Requires Spatial Analyst or 3D Analyst). This tool modifies the input Feature Class (Adds Attribute "Z").

 



Think Location

View solution in original post

0 Kudos
10 Replies
DanPatterson
MVP Esteemed Contributor

If you have the Spatial analyst extension.

Extracting cell values to point features—ArcGIS Pro | Documentation


... sort of retired...
JayantaPoddar
MVP Esteemed Contributor

Rightly pointed by Dan, you can use Extract Values to Points (Spatial Analyst) tool to extract the Z Values from DEM Raster to the Points (This will create a new Feature Class).

In case you are not interested in creating an additional feature class, you may use Add Surface Information tool (Requires Spatial Analyst or 3D Analyst). This tool modifies the input Feature Class (Adds Attribute "Z").

 



Think Location
0 Kudos
matu89
by
New Contributor II

i dont have the tool Extract Values to Points nor the tool Add Surface Information in the Basic Licence.

what tool do i have in the Basic Licence to that manner?

thanks.

0 Kudos
JayantaPoddar
MVP Esteemed Contributor

Thanks for the license information.

Here is what I think, could be a possible workaround.

1.Create Buffer from Line Feature 

2. Clip Raster Based on the buffer boundary 

3. Do a Raster to Point from the clipped raster 

4. Join the point information (Grid_code) to your original points using Spatial Join (Match Option: CLOSEST).

* The reason I am clipping the Raster, is to reduce the amount of points generated (which could have been huge, based on the spatial resolution and extent of the Raster.



Think Location
Tim_McGinnes
Occasional Contributor III

The GetCellValue tool works under a Basic license - just run it using the Field Calculator. Screenshot attached.

  • Have your DEM raster and point feature class in a map
  • Create a field to hold the Z values (Z_Calc in screenshot)
  • In the attribute table, right click on the Z_Calc field and choose Calculate Field
  • Input Table: Point feature class (dem_points in screenshot)
  • Field Name: Z value field (Z_Calc)
  • Expression: Python3
  • Z_Calc=: copy and paste below:
getcell(!SHAPE!)
  • Code Block: Copy and paste text below:
def getcell(shape):
    point = shape.getPart(0)
    result = arcpy.GetCellValue_management("DEM_E455_N7045_2018.tif", str(point.X) + " " + str(point.Y))
    cell = float(result.getOutput(0))
    return cell
  • Make sure the layer name of your DEM raster layer (from the Table of Contents) is put in there instead of mine
  • Click Apply to run

What it is doing is going through each record and running the Get Call Value tool with the X and Y of the point to get back the value of the raster cell at that point.

As a comparison, I ran the Add Surface Information tool to populate the Z field. The slight differences you see are because the Get Cell Value just gets the cell, where the Add Surface Information tool interpolates the Z value from multiple cells. Shouldn't be a problem unless your raster cell size id very large.

matu89
by
New Contributor II

Wow! that works well!

i  also tried to apply the code on a .las file and it didnt worked (got some errors in the running)

is there a way to make the code work for .las file ?

thank you.

0 Kudos
Tim_McGinnes
Occasional Contributor III

No, it will only work on feature classes. If you have the 3D Analyst extension you could use the LAS to Multipoint tool and then the Multipart to Singlepart tools to convert LAS to points. Then it will work.

If you don't have the extension then the LASTools software has a free tool called las2txt which you could use to export firstly to text and then use ArcGIS to import to points.

0 Kudos
by Anonymous User
Not applicable

You can assign Z values to features while capturing them in a 2D map by setting the appropriate elevation surface in the editing Z mode dialog.
Assuming you have added the dem raster (elevation source) to an elevation surface, set the editors Z mode to surface capture. Z aware features will be created or modified with Z values from that surface.

0 Kudos
matu89
by
New Contributor II

how do i add the raster to an elevation  surface?

 

 

0 Kudos