16.58. point2las

This tool can convert point clouds generated by ASP (Section 19.6) and DEMs to the LAS format It relies on the PDAL library, which is shipped with ASP.

If the input cloud has a datum, or the --datum option is specified, then the output LAS file will be created in respect to this datum. Otherwise ECEF \(x,y,z\) values will be saved.

The point2dem program (Section 16.57) can create a DEM from the LAS file, and pc_align (Section 16.54) can align point clouds, including in the LAS format.

16.58.1. Examples

Create a LAS file:

point2las output-prefix-PC.tif -o output-prefix

This will produce the file output-prefix.las. If the --compressed option is passed in, it will write instead output-prefix.laz

The datum can be set as --datum WGS_1984 or --datum D_MOON, for example. It is usually auto-guessed. A projection can be set with --t_srs.

Save the intensity of each triangulated point, as borrowed from the aligned (and normalized) left image L.tif (Section 19), in the W field of the LAS file, in double precision:

point2las output-prefix-PC.tif                    \
  --save-intensity-from-image output-prefix-L.tif \
  -o output-prefix

Save the triangulation error (Section 14.6.1) as the TextureU field in the LAS file in double precision:

point2las --save-triangulation-error \
  output-prefix-PC.tif               \
  -o output-prefix

Save the standard deviations of the horizontal and vertical components of uncertainty (Section 13) to the TextureV and TextureW fields in the LAS file in double precision:

point2las --save-stddev \
  output-prefix-PC.tif  \
  -o output-prefix

Convert a DEM to a LAS file:

point2las --dem dem.tif -o output-prefix

See the command-line options in Section 16.58.4 for more details.

16.58.2. Validation

A LAS or LAZ file can be inspected as:

pdal info --all file.las

16.58.3. Outlier removal

The point2las program filters out outliers in the input point cloud using the ray triangulation error (Section 14.6.1). Points with an error above a certain threshold are not included in the output LAS file.

The triangulation error can be saved as well (Section 16.58.4).

This program first picks a desired number of samples from the cloud, sorts the positive triangulation errors from the sample (the errors equal to 0 correspond to invalid points, so these are ignored), and computes some statistical measures which are printed to the screen. Those include the minimum, mean, standard deviation, maximum, and the error percentiles at 25% (Q1), 50% (median, Q2) and 75% (Q3).

Then, given the desired percentile and factor in --remove-outliers-params, it computes the error for this percentile and multiplies it by the factor. With the default settings, this amounts to 3*Q3. This value is used as the cutoff threshold to remove outliers.

If the option --use-tukey-outlier-removal is set, the outlier cutoff is computed as Q3 + 1.5*(Q3 - Q1) [Tuk77]. This takes precedence over the earlier approach.

Alternatively, the user can specify a custom outlier cutoff via --max-valid-triangulation-error, when it will be used instead of any of the above.

If it is desired to not remove any outliers, the percentage in --remove-outliers-params can be set to 100.

After the LAS file is saved, the number of outliers and their percentage from the total number of points are printed on the screen. Generally, the outlier threshold should not be so restrictive that more than approximately 30% of the points are eliminated.

16.58.4. Command-line options for point2las

--datum <string>

Create a geo-referenced LAS file in respect to this datum. Options:

  • WGS_1984

  • D_MOON (1,737,400 meters)

  • D_MARS (3,396,190 meters)

  • MOLA (3,396,000 meters)

  • NAD83

  • WGS72

  • NAD27

  • Earth (alias for WGS_1984)

  • Mars (alias for D_MARS)

  • Moon (alias for D_MOON)

--reference-spheroid <string>

This is identical to the datum option.

--t_srs <string (default: “”)>

Specify the output projection as a GDAL projection string (WKT, GeoJSON, or PROJ). If not provided, will be read from the point cloud, if available.

--compressed

Compress using laszip.

-o, --output-prefix <filename>

Specify the output file prefix.

--remove-outliers-params <pct factor (default: 75.0 3.0)>

Outlier removal based on percentage. Points with triangulation error larger than pct-th percentile times factor will be removed as outliers.

--use-tukey-outlier-removal

Remove outliers above Q3 + 1.5*(Q3 - Q1) ([Tuk77]). This takes precedence over --remove-outliers-params.

--max-valid-triangulation-error <float (default: 0)>

Outlier removal based on threshold. Points with triangulation error larger than this, if positive (measured in meters) will be removed from the cloud. Takes precedence over the above options.

--save-intensity-from-image <filename>

Save the intensity of each triangulated point, as borrowed from the aligned left image specified via this option, in the W field of the LAS file, in double precision. This bumps the LAS file version from 1.2 to 1.4.

--save-triangulation-error

Save the triangulation error (Section 14.6.1) from the input point cloud as the TextureU field in the LAS file, in double precision. Take into account the outlier filtering. This bumps the LAS file version from 1.2 to 1.4.

--save-stddev

Save the standard deviations of the horizontal and vertical components of uncertainty (Section 13) from the ASP point cloud file to the TextureV and TextureW fields in the LAS file, in double precision. This bumps the LAS file version from 1.2 to 1.4.

--num-samples-for-outlier-estimation <integer (default: 1000000)>

Approximate number of samples to pick from the input cloud to find the outlier cutoff based on triangulation error.

--dem

Assume the input file is a DEM.

--ecef

Save the point cloud in ECEF, rather than with a projection relative to a datum.

--no-input-georef

Do not attempt to read the georeference from the input point cloud.

--threads <integer (default: 0)>

Select the number of threads to use for each process. If 0, use the value in ~/.vwrc.

--cache-size-mb <integer (default = 1024)>

Set the system cache size, in MB.

--tile-size <integer (default: 256 256)>

Image tile size used for multi-threaded processing.

--no-bigtiff

Tell GDAL to not create BigTiff files.

--tif-compress <None|LZW|Deflate|Packbits (default: LZW)>

TIFF compression method.

-v, --version

Display the version of software.

-h, --help

Display this help message.