Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Hot answers tagged

14

Your PointsXYZIC is now a numpy array. Which means you can use numpy indexing to filter the data you're interested in. For example you can use an index of booleans to determine which points to grab. #the values we're classifying against unclassified = 1 ground = 2 #create an array of booleans filter_array = np.any( [ PointsXYZIC[:, 4] == ...


11

Set the scaling and offset when reprojecting to WGS84, e.g.: las2las --a_srs EPSG:26911 --t_srs EPSG:4326 -i file1.las -o output.las --scaling 1e-7 1e-7 0.01 --offset <something close to your data's longitudes>,<something close to your data's latitudes>,0 Explanation You've been caught by a limitation/feature of the las file format. Internally,...


9

libLAS can indeed be used commercially. So can Martin Isenburg's LASlib, which is LGPL, and speaking as the author of libLAS, faster and more completely supported than libLAS. Both are indeed C++ libraries, however, and there isn't too much in the ASPRS LAS space for native .NET. I'm also the primary author of PDAL, and PDAL can also read ASPRS LAS data, ...


8

It depends on what version of the LAS specification you are using. If it is 1.3 or less, then the specs define georeferencing information using pre-defined (see specs) variable length records (VLRs) using the same format as the GeoTIFF: Georeferencing for the LAS format will use the same robust mechanism that was developed for the GeoTIFF standard. ...


8

libLAS was developed to provide read/write support for LAS and it was modeled on LAStools which at the time was not released under an open source license. In the subsequent years, many parts of LAStools were released under an open source license which negated the need for a parallel effort in libLAS. The library portion of this is called LASlib. Yes, I agree ...


8

The answer by Howard Butler pretty much sums it up. Some more background. When I created the first LAStools and the LASlib library that the tools are build upon I was a postdoc at UC Berkeley and merely needed to prepare LAS files as input for my research on Streaming Delaunay (or Streaming TIN) processing. Because the code seemed useful on its own I zipped ...


5

Use laspy to read LAS files and easily return the data as numpy arrays you can interact with. laspy is pure python, is almost as fast as libLAS, has more features than the libLAS Python bindings, and is much easier to deploy.


5

GRASS has a documentation section on LiDAR in their wiki. Give it a read; you can use libLAS to import LiDAR data into GRASS, and then use many of the GRASS tools once it's in there.


4

You might want to check out the Point Cloud Library. According to their site: The Point Cloud Library (PCL) is a standalone, large scale, open project for 2D/3D image and point cloud processing. PCL is released under the terms of the BSD license, and thus free for commercial and research use. We are financially supported by Open Perception, ...


4

Use Point Cloud VIZ 2.1 where you will be able to import and export the lidar. Exporting the lidar has 2 options. The bare earth option, or all points options. Once exported you can import the *.vrt file in QGIS. The data will come as a geotiff where you will be able to manipulate further (contour, shade, etc.)


4

There is a LAS toolbox for QGIS. However, a better alternative for Linux/Unix systems is the open-source library SPDLib. SPDLib can process the LAS files (discrete-return and full-waveform), and create DTM/DSM's from the point cloud. To view the point cloud, the .las file must be converted to an SPD file (using the spdtranslate function), which can then be ...


4

Problem solved. Did a make clean (that is what I omitted before), then again $ "-g -Wall" ./configure --with-liblas=/usr/local/bin/liblas-config, followed by make and sudo make install. Works now!


4

Once you open your writer, you don't need to modify your header at all. The header is written when you create your writer. Change your first call to header.SetPointRecordsCount() to the correct number of points (3) and remove your later calls to header.SetPointRecordsCount(), writer.SetHeader(), and writer.WriteHeader(). Here's your original code, modified ...


4

If you want to write a lasfile with SRS information, you must create your liblas::Writer using a liblas::Header that has a defined SRS. Change your code to this: ofstream ofs; liblas::Header header; liblas::SpatialReference srs; srs.SetFromUserInput("EPSG:4326"); header.SetSRS(srs); header.SetPointRecordsCount(1); ofs.open("test.las", ios::out | ios::binary)...


3

las2las flightline_002.las --a_srs EPSG:32632 doesn't modify flightline_002.las. Rather, it creates a new file called output.las with the spatial reference information. output.las is the default value of the -o [ --output ] option available in las2las. To specify the new filename, use the following construction: las2las --a_srs EPSG:32632 flightline_002....


3

I found my answer in the liblas.header documentation. It states the following: "The scale factors in [x, y, z] for the point data. libLAS uses the scale factors plus the :obj:liblas.header.Header.offset values to store the point coordinates as integers in the file. The scale factor fields contain a double floating point value that is used to ...


3

To be honest, I think the easiest way would be to shell out to lasinfo with the --xml argument, and then use ElementTree or some such to pluck out what you need from the XML. You can reach all this stuff from the Python bindings too, but it's a bit of a mess. In short, open the file, fetch the header, and fetch the srs, and then ask for the wkt of the srs....


3

Additional alternatives to visualize LiDAR point data or LiDAR DEMs within QGIS were also reported in the following posts: Visualizing a LiDAR point cloud in 3D with GRASS? - (GRASS; raster). Importing LiDAR .txt in QGIS for map conversion - (QGIS; point .txt). Importing a .las file into QGIS 2.0.1? - (QGIS; point .shp) Creating DEM from LAS file without ...


2

you can use liblas commercially. Read the license terms. You can use for free, as long you provide proper reference and I think its the best tool to process las data. or LP360 is a plugin for ArcGIS which you can buy. I believe it has some trial period also. So you can try this before you buy it. Hope it helps. N


2

Just saw the source code was updated 5 hrs ago. After an inquiry, it appears that they found the issue I was asking about. They have updated the code to correct the problem. p.point_source_id now returns source id instead of user_data.


2

I think you just have to install liblas from the Commandline_Utilities in the osgeo4w installer: Once that's done, it should be available via the osgeo4w terminal:


2

I believe you have a typo inside your code. Instead of class, it should be classes. See here (manpages.ubuntu.com). Try this: las2las --input merged.las --output ground.las --keep-classes 2


2

You may use las2ogr (las utility application), but your GDAL libraries must be built with libLAS. Convert las file to txt using las2txt (las utility application) and use ogr2ogr converting CSV file to DXF Convert las file to txt using las2txt (las utility application) and load it to QGIS as a delimited text file and save as DXF


2

This is a working solution with laspy: import numpy as np import laspy from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt # reading las file and copy points input_las = laspy.file.File("test.las", mode="r") point_records = input_las.points.copy() # getting scaling and offset parameters las_scaleX = input_las.header.scale[0] ...


1

libLAS is deprecated and not maintained. It has been replaced by PDAL. LAStools is not fully open source and (mostly) supports only the LAS format. For the most part it has been created and maintained by a single individual. PDAL is fully open source and supports many point cloud formats, both on input and output. PDAL is modular. It works on OSX, *nix ...


1

My error was misunderstanding the offset and scale functionality in liblas. When defining an offset and a scale the adaptation of the points is performed inside the liblas::Point::SetCoordinates function. The trick is to set the offset and scale in the header of the writer but still give the SetCoordinates function the original values. Also the scale ...


1

The way I see liblas installed from brew, it does not include flags WITH_LASZIP or WITH_STATIC_LASZIP on build. See: https://github.com/Homebrew/homebrew-core/blob/master/Formula/liblas.rb


1

As you are using OSX, you should try the Home Brew from which you can easily get libLas by doing the following command in your terminal window. brew install liblas


1

It is quite difficult to help you without do some checks on the input file. Try to write a complete command even it seems useless: ./las2las -v in.las output.las -offset 0 0 0 --t_srs EPSG:32610 --scale 0.0000001 0.0000001 0.0000001 --a_srs EPSG:2992


1

QGIS does not currently have a really good way to visualize point cloud data (i.e. as of 2018). Instead, I would recommend the excellent, open source plas.io web app. plas.io allows you to visualize the point cloud data with the ability to adjust particle size, point density, intensity, color, and a host of other features. For example, the screenshot shows ...


Only top voted, non community-wiki answers of a minimum length are eligible