****************************************************************
  lasinfo: a utility for inspecting LAS files
****************************************************************

:Author: Martin Isenburg
:Contact: isenburg@cs.unc.edu
:Author: Howard Butler
:Contact: hobu.inc@gmail.com
:Revision: $Revision$
:Date: $Date$

.. sectnum::

.. contents::
    :depth: 3
    :backlinks: top

Description
-----------

`lasinfo` prints the header contents by default, and with a switch, can 
be used to print a short summary of the points. When in summary mode (using 
the --check switch), differences between header info and point content are 
reported as warnings.  `lasinfo` prints its information to stderr, and you 
can use pipes to redirect the output of `lasinfo` as necessary.  `lasinfo` 
supports reading from stdin, but it does not attempt to read from stdin if the 
--stdin switch is not used.  `lasinfo` can also be used to modify a few header
entries in-place as described in the examples.

`lasinfo` is a port of Martin Isenburg's `lasinfo` utility from `LASTools`_ 
to the libLAS library.  For the most part, it is unchanged from Martin's 
utility except for a few differences:

* It does *not* scan the points by default and instead you must use the --check 
  switch to have them scanned.

* It *does* print the Variable Length Records (VLRs) by default.

* Slightly different (and tidier) output format.

* GNU-style arguments and switches (although most of the switches used by 
  Martin's utilities should continue to work).


Usage
-----

Simple header inspection
~~~~~~~~~~~~~~~~~~~~~~~~

::

  $ lasinfo lidar.las
  $ lasinfo --input lidar.las


Read from STDIN
~~~~~~~~~~~~~~~

::

  $ lasinfo --stdin < lidar.las


Variable Header Records
~~~~~~~~~~~~~~~~~~~~~~~

::
  
  $ lasinfo --input lidar.las -skip_vlr

will skip the printing of Variable Record Headers (VLRs) for the file.

Check the points for header inconsistencies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

  $ lasinfo --input lidar.las --check

scans over all the points and reports any differences with the header.  
Descriptive information like minimums and maximums of various variables 
(time, x, y, z, etc) and some basic histograms are also reported.

Repair missing or inconsistent header information
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

  $ lasinfo --input lidar.las --repair

will add missing or repair inconsistent header entries with respect to the points.  
Items that are repaired with --repair include the bounding box header entries 
and the point records by return count.  Future versions of the software may 
include other header repair types if they can be done in such a way as to not 
require rewriting of the file.

Update bounding box of LAS file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

  $ lasinfo --input lidar.las --repair_boundingbox

reads all points, computes their bounding box, and updates it in the header.

Set file creation date
~~~~~~~~~~~~~~~~~~~~~~

::
  
  $ lasinfo -i lidar.las --file_creation 8 2007

sets the file creation day/year in the header to 8/2007.  With accordance to the 
ASPRS LAS specification, this literally means the 8th day of 2007.  

Set system identifier
~~~~~~~~~~~~~~~~~~~~~

::

  $ lasinfo -i lidar.las --system_identifier "hello world!"

copies the first 31 characters of the string into the system_identifier 
field of the header.

Set generating software header field
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::
  
  $ lasinfo -i lidar.las -generating_software "this is a test (-:"

copies the first 31 characters of the string into the generating_software 
field of the header.

Example data
------------

try these sources for sample lidar data in LAS format:

http://www.geoict.net/LidarData/Data/OptechSampleLAS.zip

http://www.qcoherent.com/data/LP360_Sample_Data.rar

http://www.appliedimagery.com/Serpent%20Mound%20Model%20LAS%20Data.las

.. _`LAStools`: http://www.cs.unc.edu/~isenburg/lastools/
