# What is best way to get the highest point (z-axis) in a polydata?

**URL:** https://discourse.vtk.org/t/what-is-best-way-to-get-the-highest-point-z-axis-in-a-polydata/1833
**Category:** Development
**Created:** [September 27, 2019, 1:02pm UTC](https://discourse.vtk.org/t/what-is-best-way-to-get-the-highest-point-z-axis-in-a-polydata/1833 "2019-09-27T13:02:15Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![banesullivan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/banesullivan/32/7143_2.png) [@banesullivan](https://discourse.vtk.org/u/banesullivan)
#### Post date: [October 11, 2019, 8:08pm UTC](https://discourse.vtk.org/t/what-is-best-way-to-get-the-highest-point-z-axis-in-a-polydata/1833/5 "2019-10-11T20:08:23Z")

</div>

If you’re looking for an easy way to do this in Python with VTK, check out [PyVista](http://docs.pyvista.org) which makes using VTK a bit more Pythonic. For example, here I load an existing `vtkPolyData` object of a large point cloud (3392091 points) and find the vertex with the highest Z value in like no time at all:

```auto
import pyvista as pv
from pyvista import examples

# This is vtkPolyData
poly = examples.download_lidar()

idx = np.argmax(poly.points[:,2])
print(idx)

```

---

_[View the full topic](https://discourse.vtk.org/t/what-is-best-way-to-get-the-highest-point-z-axis-in-a-polydata/1833)._
