[Liblas-commits] hg: AUTHORS
liblas-commits at liblas.org
liblas-commits at liblas.org
Thu Mar 24 11:23:28 EDT 2011
details: http://hg.liblas.orghg/rev/f39c9a180450
changeset: 2903:f39c9a180450
user: Michael P. Gerlek <mpg at flaxen.com>
date: Thu Mar 24 08:23:07 2011 -0700
description:
AUTHORS
Subject: hg: merge
details: http://hg.liblas.orghg/rev/b9d8c358259a
changeset: 2904:b9d8c358259a
user: Michael P. Gerlek <mpg at flaxen.com>
date: Thu Mar 24 08:23:22 2011 -0700
description:
merge
diffstat:
AUTHORS | 2 +-
apps/las2oci.cpp | 37 ++-
doc/development/wkt.txt | 2 +-
doc/download.txt | 4 +-
include/liblas/bounds.hpp | 2 +-
include/liblas/chipper.hpp | 56 ++-
src/chipper.cpp | 186 +++++++---
src/detail/zippoint.cpp | 18 +-
src/gt_citation.cpp | 750 ++++++++++++++++++++++++++++++--------------
src/gt_citation.h | 36 +-
src/gt_wkt_srs.cpp | 362 ++++++++++++++-------
src/spatialreference.cpp | 35 ++
12 files changed, 1025 insertions(+), 465 deletions(-)
diffs (truncated from 2138 to 300 lines):
diff -r 5cd75fb456fa -r b9d8c358259a AUTHORS
--- a/AUTHORS Mon Feb 28 10:17:21 2011 -0600
+++ b/AUTHORS Thu Mar 24 08:23:22 2011 -0700
@@ -14,4 +14,4 @@
warmerdam at pobox.com
Michael P. Gerlek
-mpg at flaxen.com
+mpg at flaxen.com
diff -r 5cd75fb456fa -r b9d8c358259a apps/las2oci.cpp
--- a/apps/las2oci.cpp Mon Feb 28 10:17:21 2011 -0600
+++ b/apps/las2oci.cpp Thu Mar 24 08:23:22 2011 -0700
@@ -385,7 +385,9 @@
bool bUse3d,
bool bInsertHeaderBlob,
std::string const& header_blob_column,
- std::vector<boost::uint8_t> const& header_data)
+ std::vector<boost::uint8_t> const& header_data,
+ std::string const& boundary_column,
+ std::string const& bounary_wkt)
{
ostringstream oss;
@@ -399,7 +401,8 @@
std::string cloudColumnName_u = to_upper(cloudColumnName);
std::string aux_columns_u = to_upper(aux_columns);
std::string header_blob_column_u = to_upper(header_blob_column);
-
+ std::string boundary_column_u = to_upper(boundary_column);
+
ostringstream columns;
ostringstream values;
@@ -417,6 +420,11 @@
values <<", :2";
}
+ if (!boundary_column_u.empty()){
+ columns << "," << header_blob_column_u;
+ values <<", SDO_GEOMETRY(:3, :4)";
+ }
+
ostringstream s_srid;
ostringstream s_gtype;
@@ -594,6 +602,8 @@
("base-table-name", po::value< string >()->default_value("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")
("base-table-aux-columns", po::value< string >(), "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", 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")
+ ("base-table-boundary-column", po::value< string >(), "A SDO_GEOMETRY column in which to insert a bounds into the SDO_PC entry")
+ ("base-table-boundary-wkt", po::value< string >(), "A file or string with OGC Geometry WKT to insert into base-table-boundary-column")
("cloud-column-name", po::value< string >()->default_value("CLOUD"), "The column name that contains the point cloud object in the base table")
("header-blob-column", po::value< string >(), "Blob column name in the base table in which to optionally insert the contents of the input file's header.")
("block-table-name", po::value< string >(), "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.")
@@ -647,6 +657,8 @@
std::string base_table_name("HOBU");
std::string block_table_name("");
std::string header_blob_column("");
+ std::string base_table_boundary_column("");
+ std::string base_table_boundary_wkt("");
std::string pre_sql("");
std::string post_sql("");
@@ -789,6 +801,23 @@
if (verbose)
std::cout << "Setting output point cloud column to: " << point_cloud_name << std::endl;
}
+
+ if (vm.count("header-blob-column"))
+ {
+ base_table_boundary_column = vm["base-table-boundary-column"].as< string >();
+ base_table_boundary_wkt = vm["base-table-boundary-wkt"].as< string >();
+
+ if (base_table_boundary_wkt.size() == 0)
+ {
+ std::cerr << "base-table-boundary-column specified, but no wkt given with base-table-boundary-wkt!\n";
+ return 1;
+ }
+
+ if (verbose)
+ std::cout << "Insertting boundary into column: " << base_table_boundary_column << std::endl;
+ }
+
+
if (vm.count("header-blob-column"))
{
header_blob_column = vm["header-blob-column"].as< string >();
@@ -1165,7 +1194,9 @@
bUse3d,
bInsertHeaderBlob,
header_blob_column,
- header_data);
+ header_data,
+ base_table_boundary_column,
+ base_table_boundary_wkt);
if (!pre_block_sql.empty()) {
diff -r 5cd75fb456fa -r b9d8c358259a doc/development/wkt.txt
--- a/doc/development/wkt.txt Mon Feb 28 10:17:21 2011 -0600
+++ b/doc/development/wkt.txt Thu Mar 24 08:23:22 2011 -0700
@@ -131,7 +131,7 @@
Softwares that currently write GeoTIFF VLR records into LAS files can continue
to do so in LAS 1.4. It is acceptable to write *only* GeoTIFF VLR records into
-an LAS file, while softwares that choose to write OGC WKT VLRs should also
+an LAS file, while softwares that choose to write OGC WKT VLRs must also
write GeoTIFF VLRs to promote backward compatibility. If a file is found to
have both OGC WKT and GeoTIFF VLRs, the OGC WKT description, which is more
expressive, should be preferred if possible.
diff -r 5cd75fb456fa -r b9d8c358259a doc/download.txt
--- a/doc/download.txt Mon Feb 28 10:17:21 2011 -0600
+++ b/doc/download.txt Thu Mar 24 08:23:22 2011 -0700
@@ -8,7 +8,7 @@
Current Release(s)
------------------------------------------------------------------------------
-* **2010-02-01**
+* **2011-02-01**
- `libLAS-1.6.0-src.tar.gz <http://download.osgeo.org/liblas/libLAS-1.6.0.tar.gz>`__
`(md5) <http://download.osgeo.org/liblas/libLAS-1.6.0.tar.gz.md5>`__
@@ -39,7 +39,7 @@
Past Releases
------------------------------------------------------------------------------
-* **2010-1-7**
+* **2011-1-7**
- `libLAS-1.6.0b4-src.tar.gz <http://download.osgeo.org/liblas/libLAS-1.6.0b4.tar.gz>`__
`(md5) <http://download.osgeo.org/liblas/libLAS-1.6.0b4.tar.gz.md5>`__
diff -r 5cd75fb456fa -r b9d8c358259a include/liblas/bounds.hpp
--- a/include/liblas/bounds.hpp Mon Feb 28 10:17:21 2011 -0600
+++ b/include/liblas/bounds.hpp Thu Mar 24 08:23:22 2011 -0700
@@ -114,7 +114,7 @@
bool overlaps(Range const& r) const
{
- return minimum <= r.maximum && maximum >= r.minimum;
+ return minimum < r.maximum && maximum > r.minimum;
}
bool contains(Range const& r) const
diff -r 5cd75fb456fa -r b9d8c358259a include/liblas/chipper.hpp
--- a/include/liblas/chipper.hpp Mon Feb 28 10:17:21 2011 -0600
+++ b/include/liblas/chipper.hpp Thu Mar 24 08:23:22 2011 -0700
@@ -61,6 +61,8 @@
else
return "NONE";
}
+ void SortByOIndex(boost::uint32_t left, boost::uint32_t center,
+ boost::uint32_t right);
};
class LAS_DLL Chipper;
@@ -74,32 +76,43 @@
boost::uint32_t m_left;
boost::uint32_t m_right;
liblas::Bounds<double> m_bounds;
- // double m_xmin;
- // double m_ymin;
- // double m_xmax;
- // double m_ymax;
public:
std::vector<boost::uint32_t> GetIDs() const;
- liblas::Bounds<double> const& GetBounds() const {return m_bounds;}
- void SetBounds(liblas::Bounds<double> const& bounds) {m_bounds = bounds;}
- // double GetXmin() const
- // { return m_xmin; }
- // double GetYmin() const
- // { return m_ymin; }
- // double GetXmax() const
- // { return m_xmax; }
- // double GetYmax() const
- // { return m_ymax; }
+ Bounds<double> const& GetBounds() const
+ {return m_bounds;}
+ void SetBounds(liblas::Bounds<double> const& bounds)
+ {m_bounds = bounds;}
+};
+
+// Options that can be used to modify the behavior of the chipper.
+class LAS_DLL Options
+{
+public:
+ Options() : m_threshold( 1000 ), m_use_sort( false ),
+ m_use_maps( false )
+ {}
+
+ // Maximum number of pointer per output block.
+ boost::uint32_t m_threshold;
+ // If true, use sorting instead of copying to reduce memory.
+ bool m_use_sort;
+ // If true, use memory mapped files instead of main memory
+ // (not currently impelemented).
+ bool m_use_maps;
+ // Directory to hold map files.
+ std::string m_map_dir;
};
class LAS_DLL Chipper
{
public:
+ Chipper(Reader *reader, Options *options );
Chipper(Reader *reader, boost::uint32_t max_partition_size) :
- m_reader(reader), m_threshold(max_partition_size),
- m_xvec(DIR_X), m_yvec(DIR_Y), m_spare(DIR_NONE)
- {}
+ m_reader(reader), m_xvec(DIR_X), m_yvec(DIR_Y), m_spare(DIR_NONE)
+ {
+ m_options.m_threshold = max_partition_size;
+ }
void Chip();
std::vector<Block>::size_type GetBlockCount()
@@ -108,25 +121,28 @@
{ return m_blocks[i]; }
private:
- void Load(RefList& xvec, RefList& yvec, RefList& spare);
+ void Allocate();
+ void Load();
void Partition(boost::uint32_t size);
void Split(RefList& xvec, RefList& yvec, RefList& spare);
void DecideSplit(RefList& v1, RefList& v2, RefList& spare,
boost::uint32_t left, boost::uint32_t right);
+ void RearrangeNarrow(RefList& wide, RefList& narrow, RefList& spare,
+ boost::uint32_t left, boost::uint32_t center, boost::uint32_t right);
void Split(RefList& wide, RefList& narrow, RefList& spare,
boost::uint32_t left, boost::uint32_t right);
void FinalSplit(RefList& wide, RefList& narrow,
boost::uint32_t pleft, boost::uint32_t pcenter);
void Emit(RefList& wide, boost::uint32_t widemin, boost::uint32_t widemax,
- RefList& narrow, boost::uint32_t narrowmin, boost::uint32_t narrowmax );
+ RefList& narrow, boost::uint32_t narrowmin, boost::uint32_t narrowmax);
Reader *m_reader;
- boost::uint32_t m_threshold;
std::vector<Block> m_blocks;
std::vector<boost::uint32_t> m_partitions;
RefList m_xvec;
RefList m_yvec;
RefList m_spare;
+ Options m_options;
};
} // namespace chipper
diff -r 5cd75fb456fa -r b9d8c358259a src/chipper.cpp
--- a/src/chipper.cpp Mon Feb 28 10:17:21 2011 -0600
+++ b/src/chipper.cpp Thu Mar 24 08:23:22 2011 -0700
@@ -42,6 +42,7 @@
// boost
#include <boost/cstdint.hpp>
// std
+#include <algorithm>
#include <cmath>
using namespace std;
@@ -78,6 +79,39 @@
namespace liblas { namespace chipper {
+class OIndexSorter
+{
+public:
+ OIndexSorter(boost::uint32_t center) : m_center(center)
+ {}
+
+ bool operator()(const PtRef& p1, const PtRef& p2)
+ {
+ if ( p1.m_oindex < m_center && p2.m_oindex >= m_center )
+ {
+ return true;
+ }
+ if ( p1.m_oindex >= m_center && p2.m_oindex < m_center )
+ {
+ return false;
+ }
+ return p1.m_pos < p2.m_pos;
+ }
+
+private:
+ boost::uint32_t m_center;
+};
+
+void RefList::SortByOIndex(boost::uint32_t left, boost::uint32_t center,
+ boost::uint32_t right)
+{
+ OIndexSorter comparator(center);
+ vector<PtRef>::iterator li = m_vec.begin() + left;
+ vector<PtRef>::iterator ri = m_vec.begin() + right + 1;
+ sort(li, ri, comparator);
+}
+
+
vector<boost::uint32_t> Block::GetIDs() const
{
vector<boost::uint32_t> ids;
@@ -87,65 +121,91 @@
More information about the Liblas-commits
mailing list