las2pg(1)

NAME
las2pg - LAS translation to PostgreSQL binary format

SYNOPSIS
las2pg
[OPTIONS]

DESCRIPTION
las2pg performs LAS translation to PostgreSQL binary format with optional configuration.

OPTIONS

\FC-h\F[], \FC-help\F[], \FC--help\F[]
    produce help message

\FC-v\F[], \FC--verbose\F[]
    Verbose message output

\FC--num_read_threads\F[] number
    Set number of threads

\FC-s\F[], \FC--skip_invalid\F[]
    Skip writing invalid point(s)

\FC-parse\F[] string, \FC--parse\F[] string
    Specify what exactly to write for each row (default is xyz). For example, 'txyzia' means that the first field of each row will be the gpstime, the next three fields will be the x, y, and z coordinates, the next field will be the intensity and the next field will be the scan angle. The supported entries are:

    t - gpstime as double
    x - x coordinate as double
    y - y coordinate as double
    z - z coordinate as double
    a - scan angle as integer
    i - intensity as integer
    n - number of returns for given pulse as integer
    r - number of this return as integer
    c - classification number as integer
    u - user data as integer
    p - point source ID as integer
    e - edge of flight line as integer
    d - direction of scan flag as integer
    R - red channel of RGB color as integer
    G - green channel of RGB color as integer
    B - blue channel of RGB color as integer
    M - vertex index number as integer
    k - Morton 2D code using X and Y (unscaled and no offset) as bigint

\FC-moffset\F[] x,y, \FC--moffset\F[] x,y
    Specify a global offset in X and Y to be used when computing the Morton 2D code. Values must be unscaled

\FC-check\F[] x,y, \FC--check\F[] x,y
    Check suitability to compute Morton 2D codes. It checks specified scale matches the one in input file. If \FC--moffset\F[] is provided it also checks that obtained Morton 2D codes will be consistent, i.e. global X,Y within [0,2^31]

\FC--stdout\F[]
    Use STDOUT

\FC-i\F[] arg, \FC-in\F[] arg, \FC-input\F[] arg, \FC--input\F[] arg
    file with the list las/laz files

\FC-o\F[] arg, \FC-out\F[] arg, \FC--out\F[] arg, \FC--output\F[] arg
    output prefix

EXAMPLE
Convert a las/laz file into PostgreSQL binary dump format, outputs output_name:

\FC
las2pg -i input_file.las -o output_name
      \F[]

Use flag \FC--stdout\F[] to write to standard output (recommended use together with a pipe, see below).

The intended use of this tool is by using the \FC--stdout\F[] flag and a pipe to avoid storing intermediate files. Example:

\FC
las2pg 1.2-with-color.laz --parse xyzRGBi --stdout | psql -c "copy flat from stdin with binary"
      \F[]

This obviously require a table called flat to be created in a PostgreSQL DB beforehand. The table must have the columns in the same order as specified by the \FC--parse\F[] option, and the column types must be the ones specified above. Example:

\FC
psql -c "create table flat (x double precision, y double precision, z double precision, r integer, g integer, b integer, i integer)"
      \F[]