Z-Coordinate Interpolation

2141
18
Jump to solution
11-18-2013 11:36 PM
StefanVollnhofer
New Contributor III
Hey there!
I've imported the surveypoints from an ascii file (add xy data -> export as shape -> import) and got the points now with x y and z coordinates in my map as shape-file.
How can i interpolate z-coordinates to new points now? I've selected the field "contains z coordinates" in the feature class?

Thanks!
0 Kudos
18 Replies
StefanVollnhofer
New Contributor III
I've uploaded a sample of my mdb file to uploaded.to:

http://ul.to/0dynvo2x

password is "esri"

I have tried it now to locate the copy of the feature class within and outside the feature dataset but it didn't word for me. Thanks for your patience 😉
0 Kudos
JakeSkinner
Esri Esteemed Contributor
Hi Stefan,

I could not access this database.  It seems to be corrupted.  Can you copy the feature class to a File Geodatabase and send that?
0 Kudos
StefanVollnhofer
New Contributor III
Ok, it worked for me but here is the copied gdb file
0 Kudos
JakeSkinner
Esri Esteemed Contributor
Looks like the issue was with the NULL values in your field, and the query in the MakeFeatureLayer function was slightly off.  Try the following:

shp = "WaEinbauten"
 
with arcpy.da.SearchCursor(shp, ["GelaendeH"]) as cursor:
    for row in cursor:
        if not vertexElevation > 0:
            vertexElevation = 0
        else:
            vertexElevation = row[0]
        arcpy.MakeFeatureLayer_management(shp, "pts_lyr", "GelaendeH = " + str(vertexElevation))
        arcpy.Adjust3DZ_management("pts_lyr", "NO_REVERSE", vertexElevation)
0 Kudos
StefanVollnhofer
New Contributor III
The script now works (running for a while), but don't update any z-values... <null> values are still in the row.

This script will set the <null> values only to "0" right? Or does it interpolate the other values? I dont want to update the given z-values (because they were taken by a survey) but only the <null> values to be interpolated.
0 Kudos
StefanVollnhofer
New Contributor III
should it not be something like:

for row in cursor:
        if not vertexElevation > 0:     
       vertexElevation = something with interpolate z-values of the next 10 neighbours or all points in the area of 10 metres (thats the question)


without an else i would say because i want the rows with values to stay the same, but only the <null> values to be interpolated.
any further ideas? thank you, for you informations so long
0 Kudos
JakeSkinner
Esri Esteemed Contributor
Hi Stefan,

I misunderstood what you were looking to accomplish before.  You are looking to populate the elevation values that are NULL by interpolating the elevation values from the surrounding points.  Is that correct?

You can do this by performing the following:

1.  Select all elevation values that are not NULL (i.e. NOT GelaendeH IS NULL)
2.  Run the IDW tool on the selection.  Before executing the tool, click on the Environments button > Processing Extent > set the Extent to the point feature class
3.  Run the Interpolate Shape tool on the point feature class using the output raster from the IDW tool.  A new feature class will be created
4.  With the new feature class, select all elevation values that are NULL (i.e. GelaendeH IS NULL)
5.  Open the attribute table > Right-click on the GelaendeH field > Calculate Geometry > Z coordinate of point
0 Kudos
StefanVollnhofer
New Contributor III
Hey JSkinn3!

Seems really good to me, I'll try this after christmas in the office, thank you so far!!
0 Kudos
StefanVollnhofer
New Contributor III
Okay, this is now exactly what I was looking for!!!! Thank you very much for your help and patience!!! Saved me a lot of time and work!!
0 Kudos