[Liblas-commits] hg: 4 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Sep 28 12:00:23 EDT 2010


changeset 30443d887217 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=30443d887217
summary: use space-separated arguments for --global-extent

changeset 34b6c70e4a6e in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=34b6c70e4a6e
summary: add las2las2 doc

changeset b07ece28fd6b in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=b07ece28fd6b
summary: keep pointformat and version when round-tripping descriptiong XML

changeset c7748a59fad4 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=c7748a59fad4
summary: --add-schema option

diffstat:

 apps/las2oci.cpp             |   21 ++-
 apps/laskernel.cpp           |    7 +
 doc/utilities/index.txt      |    1 +
 doc/utilities/las2las2.txt   |  241 +++++++++++++++++++++++++++++++++++++++++++
 include/liblas/lasschema.hpp |    4 +
 src/lasschema.cpp            |   37 ++++--
 6 files changed, 291 insertions(+), 20 deletions(-)

diffs (truncated from 430 to 300 lines):

diff -r 71134dee7fcb -r c7748a59fad4 apps/las2oci.cpp
--- a/apps/las2oci.cpp	Mon Sep 27 13:53:16 2010 -0500
+++ b/apps/las2oci.cpp	Tue Sep 28 11:00:13 2010 -0500
@@ -676,7 +676,7 @@
     ("base-table-aux-values", po::value< string >(), "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", po::value<bool>()->zero_tokens(), "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", po::value<bool>()->zero_tokens(), "Use Z values for insertion of all extent (PC_EXTENT, BLK_EXTENT, USER_SDO_GEOM_METADATA) entries")
-    ("global-extent", po::value< string >(), "Extent window to define for the PC_EXTENT.\nUse a comma-separated list, for example, \n  --global-extent minx, miny, maxx, maxy\n  or \n  --global-extent minx, miny, minz, maxx, maxy, maxz")
+    ("global-extent", po::value< std::vector<double> >(), "Extent window to define for the PC_EXTENT.\nUse a list, for example, \n  --global-extent minx miny maxx maxy\n  or \n  --global-extent minx miny minz maxx maxy maxz")
     ("cached", po::value<bool>()->zero_tokens(), "Cache the entire file on the first read")
 
 
@@ -981,13 +981,20 @@
         }
         if (vm.count("global-extent")) 
         {
-            std::string extent = vm["global-extent"].as< string >();
-            boost::char_separator<char> sep(SEPARATORS);
-            std::vector<double> vbounds;
-            tokenizer tokens(extent, sep);
+            std::vector<double> vbounds = vm["global-extent"].as< std::vector<double> >();
+
             liblas::Bounds<double> bounds;
-            for (tokenizer::iterator t = tokens.begin(); t != tokens.end(); ++t) {
-                vbounds.push_back(atof((*t).c_str()));
+            
+            if (verbose)
+            {
+                std::cout << "Setting global bounds to : ";
+
+                for (std::vector<double>::const_iterator t = vbounds.begin(); 
+                     t != vbounds.end(); 
+                     ++t) {
+                    std::cout << *t;
+                }
+                std::cout << std::endl;
             }
             if (vbounds.size() == 4) 
             {
diff -r 71134dee7fcb -r c7748a59fad4 apps/laskernel.cpp
--- a/apps/laskernel.cpp	Mon Sep 27 13:53:16 2010 -0500
+++ b/apps/laskernel.cpp	Tue Sep 28 11:00:13 2010 -0500
@@ -118,6 +118,7 @@
         ("pad-header", po::value< string >(), "Add extra bytes to the existing header")
         ("min-offset", po::value<bool>()->zero_tokens(), "Set the offset of the header to the minimums of all values in the file.  Note that this requires multiple read passes through the file to achieve.")
         ("file-creation", po::value< std::vector<string> >()->multitoken(), "Set the header's day/year.  Specify either as \"1 2010\" for the first day of 2010, or as \"now\" to specify the current day/year")
+        ("add-schema", po::value<bool>()->zero_tokens(), "Add the liblas.org schema VLR record to the file.")
 
     ;
     
@@ -742,6 +743,12 @@
             
         }
     }
+
+    if (vm.count("add-schema")) 
+    {
+        liblas::VariableRecord vlr = header.GetSchema().GetVLR();
+        header.AddVLR(vlr);
+    }
     
     return transforms;
 }
diff -r 71134dee7fcb -r c7748a59fad4 doc/utilities/index.txt
--- a/doc/utilities/index.txt	Mon Sep 27 13:53:16 2010 -0500
+++ b/doc/utilities/index.txt	Tue Sep 28 11:00:13 2010 -0500
@@ -8,6 +8,7 @@
    :maxdepth: 1
 
    lasinfo
+   las2las2
    las2las
    las2txt
    lasmerge
diff -r 71134dee7fcb -r c7748a59fad4 doc/utilities/las2las2.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/utilities/las2las2.txt	Tue Sep 28 11:00:13 2010 -0500
@@ -0,0 +1,241 @@
+
+.. raw:: pdf
+
+    PageBreak
+    
+.. _las2las2:
+    
+****************************************************************
+  las2las2: Advanced LAS filtering and manipulation
+****************************************************************
+
+:Author: Howard Butler
+:Contact: hobu.inc at gmail.com
+
+Description
+-----------
+
+:ref:`las2las2 <las2las2>` reads and writes LiDAR data in the ASPRS LAS 1.0, 1.1, and 1.2 formats while 
+modifying its contents. :ref:`las2las2 <las2las2>` is designed for filtering and 
+transformation operations of LAS files.  
+
+While `lasinfo` can do a few simple operations like 
+updating header information, more drastic changes, like removing points or 
+altering values, will require :ref:`las2las2 <las2las2>`.  :ref:`las2las` is expected to be used for 
+modifying single files at a time, and some :ref:`las2las` operations require multiple 
+read passes through the points.   Some examples of operations `las2las` can be 
+used for include:
+
+* clipping of points to those that lie within a certain region specified 
+  by a bounding box (--extent )
+* eliminating points that are the second return (--drop-return 2), 
+* eliminating points that have a scan angle 
+  above some threshold (--drop-scan-angle "<5")
+* eliminating points that have an intensity below some 
+  threshold (--drop-intensity "<15")
+* extracting only first (--first-only) or last (--last-only) returns
+* changing the format from LAS 1.0 to 1.1 or vice versa
+* eliminating points of a given classification (--eliminate class 2)
+
+:ref:`las2las2 <las2las2>` started a port of Martin Isenburg's :ref:`las2las` utility from `LASTools`_ 
+to the libLAS library.  It is much-improved from his version, however, and 
+provides a number of additional capabilities.
+
+* Text output describing the operation(s) is only provided when the --verbose (-v)
+  switch is provided.  Errors are reported to stderr.
+
+* Coordinate reprojection, including vertical datum transformation when compiled 
+  with the latest `GDAL`_.  
+
+* Coordinate system description and alteration.
+
+* Variable Length Records (VLRs) are carried forward by default.
+
+* VLR alteration, including adding your own VLRs with files and removal of VLRs
+
+* File splitting based on a specified file size (--split-mb) or points (--split-pts)
+
+* Ability to set coordinate offsets to minimum values of the existing coordinate space.
+
+* Color filtering
+  
+Usage
+-----
+
+Clipping with a rectangle
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+  $ las2las in.las --output out.las --extent 63025000 483450000 63050000 483475000
+
+clips points of in.las with x<=63025000 and y<=483450000 or x>=63050000
+and y>=483475000 and stores surviving points to out.las.
+
+::
+
+  $ las2las in.las --output out.las --extent 63025000 483450000 0 63050000 483475000 100
+
+clips points of in.las with x <= 63025000 and y <= 483450000 and z <= 100 or x >= 63050000
+and y >= 483475000 and z >= 0
+
+
+Eliminating specified returns
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+  
+  $ las2las --input in.las --output out.las --drop-returns 1
+
+eliminates all points of in.las that are designated first returns by the 
+value in their return_number field and stores surviving points to out.las.
+
+::
+  
+  $ las2las --input in.las --output out.las --drop-returns 2 3 4 5
+
+eliminates all returns in the specified list.
+
+Limiting based on scan angle
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+  $ las2las --input in.las --output out.las --keep-scan-angle "<=15"
+
+keeps all points of in.las whose scan angle is <= 15.
+
+Limiting based on intensity
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+  $ las2las --input in.las --output out.las --drop-intensity "<=1000" 
+  
+eliminates all points of in.las whose intensity is below 1000 and stores 
+surviving points to out.las.
+
+Extract last returns
+~~~~~~~~~~~~~~~~~~~~
+
+::
+  
+  $ las2las --input in.las --output out.las --last_return_only
+
+extracts all last return points from in.las and stores them to out.las.
+
+Throw out invalid data
+~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+  $ las2las --input in.las --output out.las --valid-only
+
+removes invalid (according to the ASPRS LAS file format specification) points.
+This switch should only be required in a few special circumstances. Points
+that might be invalid include those with larger-than-required scan angles.
+
+Eliminate ground points
+~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+  $ las2las --input in.las --output out.las --drop-classes 2
+
+removes points with that have a classification of 2. Points with a
+classification of 2 are conventionally called ground points, but that
+convention may not be followed for older LAS 1.0 files.
+
+Eliminate ground and unclassified points
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+  $ las2las --input in.las --output out.las --drop-classes 1 2
+  
+removes points that have a classification of 1 or 2.
+  
+
+
+Convert to 1.1
+~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+  $ las2las --input in.las --output out.las --format 1.1
+  
+converts the in.las file to a 1.1-formatted file.  For the most part, this 
+conversion is "in name only." 
+
+Alter vertical datum information
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+  $ las2las in.las --a_vertcs 5703 "North American Vertical Datum of 1988 (NAVD88)" 5103 9001
+  
+sets the vertical datum information for the file to be NAVD88 with vertical 
+units of meters. 
+
+.. note::
+    This may not be relevant depending upon the circumstances of the coordinate 
+    system the file is already in.  This option only changes the *description* 
+    of the points.  It does not reproject them in any way.  Use a combination 
+    of --a_srs and --t_srs to do perform reprojection of the file
+
+File splitting
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+  $ las2las in.las --split-mb 10
+
+splits the file into the required number of output-n.las files. Other filters
+or operations may also be applied to the operation in combination with
+splitting. Each outputted file will have its extents and point counts properly
+set.
+
+::
+
+  $ las2las in.las --split-pts 100000
+
+splits the file into the required number of output-n.las files with 100000
+points each in them. Other filters or operations may also be applied to the
+operation in combination with splitting. Each outputted file will have its
+extents and point counts properly set.
+  
+.. note::
+    --split-mb and --split-pts will not work exactly with --min-offset.  
+    --min-offset will take the minimum offsets of *the entire file*, not 
+    each individual file that is a result of the split.
+
+
+VLR addition
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+  $ las2las in.las --add-vlr CUSTOM_VLR 42 "A VLR description" "myfile.ext"
+
+adds a new VLR with name CUSTOM_VLR and an ID of 42. "myfile.ext" can either 
+be a location to a file to read to write into the VLR, or properly escaped 
+text that will be inserted directly into the VLR.  


More information about the Liblas-commits mailing list