Query terrain data to get elevation

855
2
Jump to solution
08-03-2021 06:27 PM
YinghongLi1
Occasional Contributor

I need to query terrain dataset to get elevation.  However i have not found any sample code i can use.  In ArcObject,  3D Analyst has to be enabled.  I'd like to know how to do this in ArcGIS Pro. 

Thanks for help.

0 Kudos
1 Solution

Accepted Solutions
AdamDavis
Occasional Contributor

Hi,

You can use GetZsFromSurfaceAsync BUT it needs the surface to be loaded into a map in the current project.

There does not seem to be a generic Surface API like in Desktop ISurface where you can load a surface programmatically (not in the current document/project) and do stuff to it like use .Z to get the Z value.

Unbelievably, given we are YEARS into Pro being a product there are almost no API's for extensions.

ArcGIS Pro 2.8 API Reference Guide - ArcGIS Pro 2.8 API Reference Guide

and there seems absolutely no appetite to put them in. You are left with using GP tools which are wholly unsuitable for development purposes (just like using GP tools for FC/field creation until DDL turned up in 2.8).

Adam

The OverlayGroundSurface sample in the "ArcGIS Pro SDK Community Samples" GitHub Repo is using GetZsFromSurfaceAsync.

View solution in original post

2 Replies
AdamDavis
Occasional Contributor

Hi,

You can use GetZsFromSurfaceAsync BUT it needs the surface to be loaded into a map in the current project.

There does not seem to be a generic Surface API like in Desktop ISurface where you can load a surface programmatically (not in the current document/project) and do stuff to it like use .Z to get the Z value.

Unbelievably, given we are YEARS into Pro being a product there are almost no API's for extensions.

ArcGIS Pro 2.8 API Reference Guide - ArcGIS Pro 2.8 API Reference Guide

and there seems absolutely no appetite to put them in. You are left with using GP tools which are wholly unsuitable for development purposes (just like using GP tools for FC/field creation until DDL turned up in 2.8).

Adam

The OverlayGroundSurface sample in the "ArcGIS Pro SDK Community Samples" GitHub Repo is using GetZsFromSurfaceAsync.

YinghongLi1
Occasional Contributor

Thanks!

I have not tested it this.  I did notice that there is nothing found related to terrain.  Too bad.  may need to put this in the new update list....

0 Kudos