
.. raw:: pdf

    PageBreak
    
.. _las2oci:
    
******************************************************************************
  las2oci
******************************************************************************

:Author: Howard Butler
:Contact: hobu.inc@gmail.com


Description
==============================================================================

:ref:`las2oci` allows a user to load LAS 1.0-1.2 data into `Oracle Point Cloud`_ 
tables within Oracle 11gR2+.  GDAL and OCI must be compiled with libLAS for 
las2oci to work properly.  See :ref:`optional_libraries` for details on obtaining the 
necessary components if you are building for yourself.


Usage
==============================================================================

:ref:`las2oci` is a command-line utility that allows you to ingest a 
.las file into Oracle.  

.. code-block:: text

    --------------------------------------------------------------------
        las2oci (libLAS 1.6.0b2 with GeoTIFF 1.3.0 GDAL 1.8dev)
    --------------------------------------------------------------------
    las2oci options:
      -h [ --help ]                    produce help message
      -i [ --input ] arg               input LAS file
      -c [ --connection ] arg          OCI connection string
      -v [ --verbose ]                 Verbose message output
      --debug                          Enable debug messages (SQL calls)
      --base-table-name arg (=HOBU)    The table name in which to put the point 
                                       cloud object.  This table must have a column
                                       of type SDO_PC, with the name to be 
                                       specified with --cloud-column-name
      --block-table-name arg           The table name in which to put the block 
                                       data.  This table must be of type 
                                       SDO_PC.BLK_TABLE.  This table will be 
                                       created using the filename of the input LAS 
                                       file if not specified.  Use -d to delete the
                                       table if it already exists.
      --cloud-column-name arg (=CLOUD) The column name that contains the point 
                                       cloud object in the base table
      --header-blob-column arg         Blob column name in the base table in which 
                                       to optionally insert the contents of the 
                                       input file's header.
      -d [ --overwrite ]               Drop block table before inserting data.
      --block-capacity arg (=3000)     Maximum number of points to be inserted into
                                       each block
      -p [ --precision ] arg (=8)      Number of decimal points to write into SQL 
                                       for point coordinate data.  Used in 
                                       user_sdo_geom_metadata entry and defining 
                                       the PC_EXTENT for the point cloud object.
      -s [ --srid ] arg                Oracle numerical SRID value to use to define
                                       point cloud.
      --pre-sql arg                    Quoted SQL or filename location of PL/SQL to
                                       run before executing the point cloud 
                                       creation process.
      --pre-block-sql arg              Quoted SQL or filename location of PL/SQL to
                                       run before executing the insertion of block 
                                       data.
      --post-sql arg                   Quoted SQL or filename location of PL/SQL to
                                       run after inserting block data.
      --base-table-aux-columns arg     Quoted, comma-separated list of columns to 
                                       add to the SQL that gets executed as part of
                                       the point cloud insertion into the 
                                       base-table-name
      --base-table-aux-values arg      Quoted, comma-separated list of values to 
                                       add to the SQL that gets executed as part of
                                       the point cloud insertion into the 
                                       base-table-name
      --solid                          Define the point cloud's PC_EXTENT geometry 
                                       gtype as (1,1007,3) instead of the normal 
                                       (1,1003,3), and use gtype 3008/2008 vs 
                                       3003/2003 for BLK_EXTENT geometry values.
      --3d                             Use Z values for insertion of all extent 
                                       (PC_EXTENT, BLK_EXTENT, 
                                       USER_SDO_GEOM_METADATA) entries
      --global-extent arg              Extent window to define for the PC_EXTENT.
                                       Use a comma-separated or quoted, 
                                       space-separated list, for example, 
                                        -e minx, miny, maxx, maxy
                                        or 
                                        -e minx, miny, minz, maxx, maxy, maxz
                                        -e "minx miny minz maxx maxy maxz"
      --cached                         Cache the entire file on the first read

    Transformation options:
      --t_srs arg           Coordinate system to reproject output LAS file to.  Use
                            --a_srs or verify that your input LAS file has a 
                            coordinate system according to lasinfo

    Filtering options:
      -e [ --extent ] arg    Extent window that points must fall within to keep.
                             Use a comma-separated or quoted, space-separated list,
                             for example, 
                              -e minx, miny, maxx, maxy
                              or 
                              -e minx, miny, minz, maxx, maxy, maxz
                              -e "minx miny minz maxx maxy maxz"
      --minx arg             Extent must be greater than or equal to minx to be 
                             kept. 
                              --minx 1234.0
      --miny arg             Extent must be greater than or equal to miny to be 
                             kept. 
                              --miny 5678.0
      --minz arg             Extent must be greater than or equal to minz to be 
                             kept. If maxx and maxy are set but not minz *and maxz,
                             all z values are kept. 
                              --minz 0.0
      --maxx arg             Extent must be less than or equal to maxx to be kept. 
                              --maxx 1234.0
      --maxy arg             Extent must be less than or equal to maxy to be kept. 
                              --maxy 5678.0
      --maxz arg             Extent must be less than or equal to maxz to be kept. 
                             If maxx and maxy are set but not maxz *and minz, all z
                             values are kept. 
                              --maxz 10.0
      -t [ --thin ] arg (=0) Simple decimation-style thinning.
                             Thin the file by removing every t'th point from the 
                             file.
      --last_return_only     Keep last returns (cannot be used with 
                             --first_return_only)
      --first_return_only    Keep first returns (cannot be used with 
                             --last_return_only
      --keep-returns arg     A list of return numbers to keep in the output file: 
                             --keep-returns 1 2 3
      --drop-returns arg     Return numbers to drop.
                             For example, --drop-returns 2 3 4 5
      --valid_only           Keep only valid points
      --keep-classes arg     A list of classifications to keep:
                             --keep-classes 2 4 12
                             --keep-classes 2
      --drop-classes arg     A comma-separated list of classifications to drop:
                             --drop-classes 1,7,8
                             --drop-classes 2
      --keep-intensity arg   Range in which to keep intensity.
                             The following expression types are supported:  
                             --keep-intensity 0-100 
                             --keep-intensity <200 
                             --keep-intensity >400 
                             --keep-intensity >=200
      --drop-intensity arg   Range in which to drop intensity.
                             The following expression types are supported:  
                             --drop-intensity <200 
                             --drop-intensity >400 
                             --drop-intensity >=200
      --keep-time arg        Range in which to keep time.
                             The following expression types are supported:  
                             --keep-time 413665.2336-414092.8462 
                             --keep-time <414094.8462 
                             --keep-time >413665.2336 
                             --keep-time >=413665.2336
      --drop-time arg        Range in which to drop time.
                             The following expression types are supported:  
                             --drop-time <413666.2336 
                             --drop-time >413665.2336 
                             --drop-time >=413665.2336
      --keep-scan-angle arg  Range in which to keep scan angle.
                             The following expression types are supported:  
                             --keep-scan-angle 0-100 
                             --keep-scan-angle <100
                             --keep-scan-angle <=100
      --drop-scan-angle arg  Range in which to drop scan angle.
                             The following expression types are supported:  
                             --drop-scan-angle <30 
                             --drop-scan-angle >100 
                             --drop-scan-angle >=100
      --keep-color arg       Range in which to keep colors.
                             Define colors as two 3-tuples (R,G,B-R,G,B):  
                             --keep-color '0,0,0-125,125,125'
      --drop-color arg       Range in which to drop colors.
                             Define colors as two 3-tuples (R,G,B-R,G,B):  
                             --drop-color '255,255,255-65536,65536,65536'


    For more information, see the full documentation for las2oci at:
     http://liblas.org/utilities/las2oci.html
    ----------------------------------------------------------




::

    $ las2oci   --input input.las \
                --connection lidar/lidar@oracle/crrel \
                --pre-sql "CREATE TABLE HOBU (id number, CLOUD SDO_PC, DESCRIPTION VARCHAR2(20), HEADER BLOB)" 
                --post-sql "CREATE INDEX HOBU_ID_IDX on hobu(id)" \
                --base-table-aux-columns "description" \
                --base-table-aux-values "'Some text'" \
                --global-extent -180.0,-90.0,180.0,90.0 \
                --header-blob-column HEADER \
                --base-table-name HOBU \
                --cloud-column-name CLOUD \
                --block-table-name OUTPUT





.. _`Oracle Point Cloud`: http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28400/sdo_pc_pkg_ref.htm

