# vtkLASReader()

**URL:** https://discourse.vtk.org/t/vtklasreader/438
**Category:** Support
**Created:** [March 10, 2019, 8:08pm UTC](https://discourse.vtk.org/t/vtklasreader/438 "2019-03-10T20:08:59Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![clairecita](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/77aa72/32.png) [@clairecita](https://discourse.vtk.org/u/clairecita)
#### Post date: [March 10, 2019, 8:08pm UTC](https://discourse.vtk.org/t/vtklasreader/438/1 "2019-03-10T20:08:59Z")

</div>

Hi,  
I saw somewhere that vtk has a reader for .las files (lidar data) (vtkLASReader) but when I try to use it it says that there is no such attribute. What am I missing ?

---

<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: [March 10, 2019, 10:30pm UTC](https://discourse.vtk.org/t/vtklasreader/438/2 "2019-03-10T22:30:36Z")

</div>

Can you share your data?

You can also try vtkPDALReader which should be more complete.

Dan

---

<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: [March 17, 2019, 5:20am UTC](https://discourse.vtk.org/t/vtklasreader/438/3 "2019-03-17T05:20:35Z")

</div>

FYI: Here is a function using [`laspy`](https://github.com/laspy/laspy) and [`vtki`](http://docs.vtki.org) to read LAS point clouds I made.

The `vtkLASReader` is only available if VTK is compiled with an option for it (not sure about the details). I’ve been working with a lot of point clouds lately and I needed to use the VTK module available on PyPI so I made this snippet.

Note that `vtki` is simply a helper module for VTK - the returned `poly` object is an instance of `vtk.vtkPolyData`

```python
from laspy.file import File
import numpy as np
import vtki

def read_las(filename):
    """Reads a LAS lidar point cloud to vtkPolyData"""
    inFile = File(filename, mode='r')
    I = inFile.Classification == 2
    points = np.c_[inFile.X, inFile.Y, inFile.Z][I]
    inFile.close()
    poly = vtki.PolyData(points)
    poly.point_arrays['intensity'] = inFile.Intensity[I]
    poly.point_arrays['classification'] = inFile.Classification[I]
    poly.set_active_scalar('intensity')
    return poly

```

---

<div class="post-metadata">

### Author: ![clairecita](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/77aa72/32.png) [@clairecita](https://discourse.vtk.org/u/clairecita)
#### Post date: [March 18, 2019, 11:53am UTC](https://discourse.vtk.org/t/vtklasreader/438/4 "2019-03-18T11:53:17Z")

</div>

Hi,  
Thank you for your answers. I decided to use your script Bane, it works perfectly.

---

<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: [March 19, 2019, 12:24am UTC](https://discourse.vtk.org/t/vtklasreader/438/5 "2019-03-19T00:24:06Z")

</div>

Glad to hear, @clairecita! Would you please mark that comment as the solution to close this thread

Also, this might be of interest to you when I merge it into `vtki`: [https://github.com/vtkiorg/vtki/pull/128](https://github.com/vtkiorg/vtki/pull/128)

---

<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: [March 19, 2019, 12:47am UTC](https://discourse.vtk.org/t/vtklasreader/438/6 "2019-03-19T00:47:02Z")

</div>

And this thread as well [Eye-Dome Lighting: vtkEDLShading (example request)](https://discourse.vtk.org/t/eye-dome-lighting-vtkedlshading-example-request/508/4)
