# Display topographic data as latitude, longitude and elevation?

**URL:** https://discourse.vtk.org/t/display-topographic-data-as-latitude-longitude-and-elevation/6899
**Category:** Support
**Created:** [October 15, 2021, 10:28pm UTC](https://discourse.vtk.org/t/display-topographic-data-as-latitude-longitude-and-elevation/6899 "2021-10-15T22:28:45Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Tomasso](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tomasso/32/5786_2.png) [@Tomasso](https://discourse.vtk.org/u/Tomasso)
#### Post date: [October 15, 2021, 10:28pm UTC](https://discourse.vtk.org/t/display-topographic-data-as-latitude-longitude-and-elevation/6899/1 "2021-10-15T22:28:45Z")

</div>

My VTK C++ app reads [GMT grid files](https://docs.generic-mapping-tools.org/6.2/cookbook/file-formats.html#grid-files) that contain latitude/longitude (degrees) and corresponding elevation (meters) into a VtkPointArray, where x is longitude, y is latitude and z is depth. However the elevation range (z-axis) typically spans thousands of meters, while the latitude and longitude ranges span a degree or less. The resulting rendered surface is highly distorted and elongated in z, and not usable. How to properly scale z in VTK such that the rendered surface looks to scale (no vertical exaggeration), with these requirements:

- Values on the x and y (longitude and latitude) axes are in units of degrees
- Values on the z axis are in units of meters, and the values represent the actual elevation (not scaled values).

I realize that I can convert longitude and latitude to UTM (easting and northing meters) and the resulting render is much more realistic - but users need to be able to display longitude and latitude values on the axis.

Thanks for you help, as always!

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.vtk.org/user_avatar/discourse.vtk.org/danlipsa/32/390_2.png) [@danlipsa](https://discourse.vtk.org/u/danlipsa)
#### Post date: [October 16, 2021, 1:07am UTC](https://discourse.vtk.org/t/display-topographic-data-as-latitude-longitude-and-elevation/6899/2 "2021-10-16T01:07:58Z")

</div>

Display your grid in UTM and only change the X Y markings to lon lat?

---

<div class="post-metadata">

### Author: ![Tomasso](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tomasso/32/5786_2.png) [@Tomasso](https://discourse.vtk.org/u/Tomasso)
#### Post date: [October 16, 2021, 2:27am UTC](https://discourse.vtk.org/t/display-topographic-data-as-latitude-longitude-and-elevation/6899/3 "2021-10-16T02:27:59Z")

</div>

But the numbers on the axis tick marks would correspond to UTM, despite the labels reading lon/lat… Any way to “convert” the numbers on tick marks from UTM to lon/lat?

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.vtk.org/user_avatar/discourse.vtk.org/danlipsa/32/390_2.png) [@danlipsa](https://discourse.vtk.org/u/danlipsa)
#### Post date: [October 17, 2021, 8:51pm UTC](https://discourse.vtk.org/t/display-topographic-data-as-latitude-longitude-and-elevation/6899/4 "2021-10-17T20:51:36Z")

</div>

Can you use setXAxisRange (Y and Z also) for vtkCubeAxesActor?

---

<div class="post-metadata">

### Author: ![Tomasso](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tomasso/32/5786_2.png) [@Tomasso](https://discourse.vtk.org/u/Tomasso)
#### Post date: [October 18, 2021, 4:59pm UTC](https://discourse.vtk.org/t/display-topographic-data-as-latitude-longitude-and-elevation/6899/5 "2021-10-18T16:59:53Z")

</div>

Yes, that works! Thanks!
