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

Hot answers tagged

5

Use the rgdal package and showP4: Your string: > ps [1] "COMPD_CS[\"Projected\", PROJCS[\"UTM_10N\", GEOGCS [ \"WGS84\", DATUM [ \"WGS84\", SPHEROID [\"WGS 84\", 6378137.000, 298.257223563 ], TOWGS84 [ 0.000, 0.000, 0.000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000 ] ], PRIMEM [ \"Greenwich\", 0.000000 ], UNIT [ \"metres\", 1.00000000] ], ...


5

If you are trying to create a 2.5D digital terrain model (a height field) from a point cloud then there might be two possible problems. Multiple points in the cloud at the same location don't add any information to the data, so are dropped. Multiple points with the same XY location but different Z location (height) are inconsistent with the idea of a planar ...


4

lidR should not throw an error for that, at read time. It is invalid but not corrupted so it is readable. However writeLAS do throw an error. You have two solutions. The first one should be preferred in my opinion. Fix your original files with las2las from lastools. las2las should be preferred for every tasks that imply las file processing. Use: las2las -...


4

The header needs to be set with a point format that supports RGB colors, see: https://pythonhosted.org/laspy/tut_background.html. For LAS 1.2, the minimum point format for color is 2: header = laspy.header.Header(point_format=2) # LAS point format 2 supports color with laspy.file.File(output_path, mode="w", header=header) as lasfile: lasfile.header....


3

It's perfectly valid (although not usual) for the LAS header to contain additional bytes. It seems Trimble always writes 375, no matter if it's LAS 1.2 (227 bytes), LAS 1.3 (235 bytes), or LAS 1.4 (375 bytes). One advantage of this is that the LAS file could be upgraded to LAS 1.4 in place (assuming the point type is kept). However, those additional 140 ...


3

This question has been discussed here. For an unknown reason the payload of the file is offseted to 375 bytes instead of 235 for a LAS 1.3. las0@header@PHB$`Header Size` #> 375 In theory it could be written properly but in practice rlas generates a corrupted file. You must manually fix the header. las0@header@PHB$`Header Size` <- 235


3

Laspy isn't going to give you convenient access to the SRS in a form you can easily consume. LAS files can have either WKT or GeoTIFF keys as the coordinate system description. For consumption in Esri tools (and elsewhere), you always want the WKT. The most convenient way to get the WKT from an LAS file is to use PDAL. The following script will read a ...


3

You are trying to read the file "ABCD.las" from the package rLiDAR. The package rLiDAR does not have such file. You probably meant something like: readLAS("D:/Thing/Path/ABCD.las") Also you loaded both lidR and rLiDAR that both have a readLAS function that give two different outputs. You are likely to run into trouble using the two packages simultaneously. ...


2

Found the reference below that some LiDAR instruments can record up to six returns depending on the discretization settings: Modern instruments can process the energy-backscatter pertaining to a single beam and identify up to six returns, but the majority support only up to four. A Guide to LIDAR Data Acquisition and Processing for the Forests of the ...


2

There is a maximum of 5 and it depends on the software. There can be 3–5 returns possible per laser pulse. Discrete return lidar can record multiple measurements within a single laser pulse. If the reflected signal strength exceeds a given threshold, then the sensor will record another measurement, up to the maximum number allowed by the sensor (...


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] ...


2

https://github.com/hobu/laz-perf contains an alternative implementation of LASzip that can be compiled to WASM and JavaScript using Emscripten. It is used by Potree and PlasioJS to provide LAZ support in JavaScript.


2

Starting to play around with tools found here. Its been quite useful. https://github.com/brycefrank/pyfor


2

You can download data in LAZ-format which you can covert to las from Lantmäteriet (~The Swedish National Land Survey) from this link. Create account and download via ftp. The lidar data is in folder "Laserdata_Skog". Coverage as of 2019-08-07: Green-ready to download Yellow-quality Control in progress Orange-scan finished Red-scan in progress


2

I constructed a 24 billion point lidar point cloud web service available with color information that might be suitable for this task. It is available in Entwine Point Tile format on AWS courtesy of Bohannan Huston and the City of Hobbs, NM. You can view it in Potree at https://hobbslidar.com. The EPT resource link is https://na-c.entwine.io/coh/ept.json. ...


2

In short there is no such feature in lidR and there is no plan for such addition in a close future. las and laz file are read with LASlib which does not have the capability to stream a remote file. Thus lidR cannot do it. However it does not mean you can't find some partial workarounds. Download only the header of the files This is something I already made....


1

I tried naively to use nearest neighbors to separate the ground and the trees. I iteratively set a point to be a tree, ground, or other type of point. A point is a tree or ground point if a percentage of the k=10 nearest neighbors are tree or ground points. The percentage decreases with each iteration. The initial guess of trees are points with intensity <...


1

LAS 1.2 has a classification byte, which is 8 bits. However 3 of those bits are used for the flags (withheld, synthetic, and keypoint). With laspy, classification accesses the 5 bits that LAS 1.2 allows for the classification number. 2^5 is 32, meaning you can store 32 classes (0-31) in that 5-bit integer. It doesn't touch the flag bits. ...


1

The error message is not very helpful unfortunately. You are missing the required library LASzip on your system as well as the laszip.exe tool. For Windows you can get the LASzip DLL file from the archive the LAStools project provides at https://lastools.github.io/download/LAStools.zip You can find it in LAStools/LASzip/dll/ in said archive. For quick ...


1

After converting the LAS Dataset to a point feature class, then add x, y and z coordinates to the TOC with Add Geometry Attributes tool: Adds new attribute fields to the input features representing the spatial or geometric characteristics and location of each feature, such as length or area and x-, y-, z-, and m-coordinates. Another option is to use the ...


1

There are things you can do to the files before you compress them to make the LAZ compression more efficient. Sort them based on GPSTime if you have that attribute. Sort them along a space-filling curve if you don’t. Zero out attributes you don’t need. If you have color information in raster data elsewhere, it will be much more efficient to compress them ...


1

To answer your first question: No. The tools and supporting documentation over at LASzip.org covers the details. A lossless compression is absolutely critical with LAS data and this group has ASPRS official support afaik. To answer your second question: No. Though you really ought to have tried that yourself. Also, 7zip is no improvement over WinZip, etc.


1

In order to answer, let’s put aside important, but broad issues: The fact that identifying and segmenting trees is a very complex analysis which depends on many things (things related to the type of vegetation, and quality and amount of available data, for example). That processing 'large point clouds' in R is a real concern (due to memory limitation), and ...


1

LAS files can have information regarding coordinate reference system (CRS) defined in header. Lots of .las files do not have information about CRS stored. You can use different tools to get this data. lasstools (lasinfo) - you can create batch script to see what is in header and which CRS is set. lasinfo -i lidar.laz -odix _info -otxt laspy - probably you ...


1

You can convert the .ply files (aka Polygon File Format) to .las with other software, and then, import it in ArcGIS. For example: PDAL: supports reading and writing .ply files (ASCII and binary). You can convert them with the translate tool. LAStools: supports conversion of ASCII .ply files (treats it as text file) with las2las tool (see here). ...


1

The lidR package can do that in R library(lidR) ctg = catalog("C:/a/test/BY17_1401merged_test.las") shp = shapefile("C:/a/cropped_topo50.shp") opt_output_file(ctg) = "C:/a/test/BY17_1401_split_{ID}" new_ctg <- lasclip(BY17, shp) This script references your file (or your files if several). It loads your shapefile. It assigns a templated output ...


1

"As I got a warning I wanted to check what was the maximum number of returns the laser software and/or the processing software was capable of recording. Would the warning indicate that a return number would be erroneous?" The LAS 1.2 format has in its section 'Point Data Records' 3 bits for storing Return Number and 3 bits for Number of Returns (see in ...


1

Cloud Compare has a simple interactive solution too! 1) Select the point cloud in the 'DB tree' by clicking on it once. 2) In the 'Properties' window below the DB tree, the various attributes of the selected point cloud can be viewed. Scroll down to 'Scalar Fields' and select the desired attributes. This will display the point cloud with a colour scaling ...


1

You might have more success with Conda. PDAL is now available on Conda Forge on OSX, Win64, and Linux. Find out more on the PDAL download page.


1

I tested the ClipLidarToPolygon tool in WhiteboxTools using a test polygon that I digitized for an arbitrary section of the StElisAk.las dataset. No errors were thrown and I received the following result: I digitized my test polygon in Whitebox GAT and used QGIS to set the projection to CRS EPSG:26906 - NAD83 / UTM zone 6N - Projected (*Whitebox GAT does ...


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