[Liblas-commits] hg: 2 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Aug 26 16:38:04 EDT 2010


changeset 28d5309e4a92 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=28d5309e4a92
summary: fix ups so las2oci compiles on windows

changeset d9076e050572 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=d9076e050572
summary: merge

diffstat:

 CMakeLists.txt      |  13 -------------
 apps/CMakeLists.txt |   3 +--
 apps/kdx_util.cpp   |  34 +++++++++++++++++-----------------
 apps/kdx_util.hpp   |  12 ++++++------
 apps/las2oci.cpp    |  26 +++++++++++++-------------
 apps/las2oci.hpp    |   5 +++--
 apps/oci_util.hpp   |   2 ++
 src/CMakeLists.txt  |   3 +--
 8 files changed, 43 insertions(+), 55 deletions(-)

diffs (truncated from 339 to 300 lines):

diff -r ebaaaf3dc720 -r d9076e050572 CMakeLists.txt
--- a/CMakeLists.txt	Thu Aug 26 14:28:05 2010 -0600
+++ b/CMakeLists.txt	Thu Aug 26 14:37:47 2010 -0600
@@ -136,19 +136,6 @@
 mark_as_advanced(CLEAR Boost_LIBRARY_DIRS) 
 link_directories(${Boost_LIBRARY_DIRS}) 
 
-# libxml2 support - optional, default=ON
-set(WITH_LIBXML2 FALSE CACHE BOOL "Choose if libxml2 support should be built ")
-
-if(WITH_LIBXML2)
-    find_package(LibXml2)
-    mark_as_advanced(CLEAR LIBXML2_INCLUDE_DIR)
-    mark_as_advanced(CLEAR LIBXML2_LIBRARIES) 
-    if(LIBXML2_FOUND)
-        include_directories(${LIBXML2_INCLUDE_DIR})
-        add_definitions(-DHAVE_LIBXML2=1)
-    endif()
-endif()
-
 # GeoTIFF support - optional, default=OFF
 set(WITH_GEOTIFF FALSE CACHE BOOL "Choose if GeoTIFF support should be built")
 
diff -r ebaaaf3dc720 -r d9076e050572 apps/CMakeLists.txt
--- a/apps/CMakeLists.txt	Thu Aug 26 14:28:05 2010 -0600
+++ b/apps/CMakeLists.txt	Thu Aug 26 14:37:47 2010 -0600
@@ -66,8 +66,7 @@
     ${TIFF_LIBRARY}
     ${GEOTIFF_LIBRARY}
     ${GDAL_LIBRARY}
-    ${SPATIALINDEX_LIBRARY}
-    ${LIBXML2_LIBRARIES})
+    ${SPATIALINDEX_LIBRARY})
 
 link_directories(${Boost_LIBRARY_DIRS})
 
diff -r ebaaaf3dc720 -r d9076e050572 apps/kdx_util.cpp
--- a/apps/kdx_util.cpp	Thu Aug 26 14:28:05 2010 -0600
+++ b/apps/kdx_util.cpp	Thu Aug 26 14:37:47 2010 -0600
@@ -19,7 +19,7 @@
    {
         const liblas::chipper::Block& b = c.GetBlock(i);
 
-        std::vector<uint32_t> ids = b.GetIDs();       
+        std::vector<boost::uint32_t> ids = b.GetIDs();       
         liblas::Bounds<double> const& bnd = b.GetBounds();
        if (first) {
            mins[0] = bnd.min(0);
@@ -35,7 +35,7 @@
        maxs[0] = std::max(maxs[0], bnd.max(0));
        maxs[1] = std::max(maxs[1], bnd.max(1));
 
-       IndexResult result(static_cast<uint32_t>(i));
+       IndexResult result(static_cast<boost::uint32_t>(i));
        result.SetIDs(ids);
        result.SetBounds(bnd);
        m_results.push_back(result);
@@ -86,7 +86,7 @@
         }
         liblas::Bounds<double> b(low[0], low[1], high[0],high[1]);
 
-        IndexResult result(static_cast<uint32_t>(id));
+        IndexResult result(static_cast<boost::uint32_t>(id));
         result.SetIDs(ids);
         result.SetBounds(b);
         m_results.push_back(result);
@@ -97,7 +97,7 @@
 
 bool GetPointData(  liblas::Point const& p, 
                     // bool bTime, 
-                    std::vector<uint8_t>& point_data)
+                    std::vector<boost::uint8_t>& point_data)
 {
     // This function returns an array of bytes describing the 
     // x,y,z and optionally time values for the point.  
@@ -109,9 +109,9 @@
     double z = p.GetZ();
     // double t = p.GetTime();
 
-    uint8_t* x_b =  reinterpret_cast<uint8_t*>(&x);
-    uint8_t* y_b =  reinterpret_cast<uint8_t*>(&y);
-    uint8_t* z_b =  reinterpret_cast<uint8_t*>(&z);
+    boost::uint8_t* x_b =  reinterpret_cast<boost::uint8_t*>(&x);
+    boost::uint8_t* y_b =  reinterpret_cast<boost::uint8_t*>(&y);
+    boost::uint8_t* z_b =  reinterpret_cast<boost::uint8_t*>(&z);
 
     // liblas::uint8_t* t_b =  reinterpret_cast<liblas::uint8_t*>(&t);
 
@@ -149,7 +149,7 @@
     return true;
 }
 
-void IndexResult::GetData(liblas::Reader* reader, std::vector<uint8_t>& data)
+void IndexResult::GetData(liblas::Reader* reader, std::vector<boost::uint8_t>& data)
 {
     IDVector const& ids = GetIDs();
 
@@ -162,15 +162,15 @@
     data.clear(); 
     
     IDVector::const_iterator i;
-    std::vector<uint8_t>::iterator pi;
+    std::vector<boost::uint8_t>::iterator pi;
     
-    uint32_t block_id = GetID();
+    boost::uint32_t block_id = GetID();
 
-    std::vector<uint8_t> point_data;
+    std::vector<boost::uint8_t> point_data;
     
     for (i=ids.begin(); i!=ids.end(); ++i) 
     {
-        uint32_t id = *i;
+        boost::uint32_t id = *i;
 
         bool doRead = reader->ReadPointAt(id);
         if (doRead) {
@@ -182,21 +182,21 @@
             bool gotdata = GetPointData(p, point_data);
             
             if (!gotdata) { throw std::runtime_error("Unable to fetch Point Data"); exit(1);}
-            std::vector<uint8_t>::const_iterator d;
+            std::vector<boost::uint8_t>::const_iterator d;
             for (d = point_data.begin(); d!=point_data.end(); ++d) {
                 data.push_back(*d);
             }
 
-            uint8_t* id_b = reinterpret_cast<uint8_t*>(&id);
-            uint8_t* block_b = reinterpret_cast<uint8_t*>(&block_id);
+            boost::uint8_t* id_b = reinterpret_cast<boost::uint8_t*>(&id);
+            boost::uint8_t* block_b = reinterpret_cast<boost::uint8_t*>(&block_id);
             
             // 4-byte big-endian integer for the BLK_ID value
-            for (int i =  sizeof(uint32_t) - 1; i >= 0; i--) {
+            for (int i =  sizeof(boost::uint32_t) - 1; i >= 0; i--) {
                 data.push_back(block_b[i]);
             }
             
             // 4-byte big-endian integer for the PT_ID value
-            for (int i =  sizeof(uint32_t) - 1; i >= 0; i--) {
+            for (int i =  sizeof(boost::uint32_t) - 1; i >= 0; i--) {
                 data.push_back(id_b[i]);
             }
             
diff -r ebaaaf3dc720 -r d9076e050572 apps/kdx_util.hpp
--- a/apps/kdx_util.hpp	Thu Aug 26 14:28:05 2010 -0600
+++ b/apps/kdx_util.hpp	Thu Aug 26 14:37:47 2010 -0600
@@ -14,22 +14,22 @@
 
 
 
-typedef std::vector<uint32_t> IDVector;
+typedef std::vector<boost::uint32_t> IDVector;
 typedef boost::shared_ptr< IDVector > IDVectorPtr;
 
 class IndexResult 
 {
 public:
-    IndexResult(uint32_t id) : bounds(), m_id(id) {}
+    IndexResult(boost::uint32_t id) : bounds(), m_id(id) {}
 
     IDVector const& GetIDs() const { return ids; }
     void SetIDs(IDVector& v) {ids = v;}
     const liblas::Bounds<double> GetBounds() const { return bounds; }
     void SetBounds(const liblas::Bounds<double> b) {bounds = b;}
-    uint32_t GetID() const {return m_id;}
-    void SetID(uint32_t v) {m_id = v;}
+    boost::uint32_t GetID() const {return m_id;}
+    void SetID(boost::uint32_t v) {m_id = v;}
     
-    void GetData(liblas::Reader* reader, std::vector<uint8_t>& data);
+    void GetData(liblas::Reader* reader, std::vector<boost::uint8_t>& data);
 
 private:
 
@@ -41,7 +41,7 @@
     
     IDVector ids;
     liblas::Bounds<double> bounds;
-    uint32_t m_id;
+    boost::uint32_t m_id;
 
 };
 
diff -r ebaaaf3dc720 -r d9076e050572 apps/las2oci.cpp
--- a/apps/las2oci.cpp	Thu Aug 26 14:28:05 2010 -0600
+++ b/apps/las2oci.cpp	Thu Aug 26 14:37:47 2010 -0600
@@ -180,7 +180,7 @@
 
     IDVector const& ids = result.GetIDs();
     // const SpatialIndex::Region* b = result.GetBounds();
-    uint32_t num_points = ids.size();
+    boost::uint32_t num_points = ids.size();
 
 
     // EnableTracing(connection);
@@ -223,7 +223,7 @@
     // :4
     statement->Define( locator, 1 ); 
 
-    std::vector<uint8_t> data;
+    std::vector<boost::uint8_t> data;
     result.GetData(reader, data);
         
     // std::vector<liblas::uint8_t> data;
@@ -426,7 +426,7 @@
                     bool bUse3d,
                     bool bInsertHeaderBlob,
                     std::string const& header_blob_column,
-                    std::vector<uint8_t> const& header_data)
+                    std::vector<boost::uint8_t> const& header_data)
 {
     ostringstream oss;
 
@@ -610,10 +610,10 @@
     fprintf(stderr,"----------------------------------------------------------\n");    
 }
 
-std::vector<uint8_t> GetHeaderData(std::string const& filename, uint32_t offset)
+std::vector<boost::uint8_t> GetHeaderData(std::string const& filename, boost::uint32_t offset)
 {
     std::istream* in = OpenInput(filename, false);
-    std::vector<uint8_t> data(offset);
+    std::vector<boost::uint8_t> data(offset);
     liblas::detail::read_n(data.front(), *in, offset);
     delete in;
     return data;
@@ -636,9 +636,9 @@
     ("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.")
     ("overwrite,d", po::value<bool>()->zero_tokens(), "Drop block table before inserting data.")
-    ("block-capacity", po::value<uint32_t>()->default_value(3000), "Maximum number of points to be inserted into each block")
-    ("precision,p", po::value<uint32_t>()->default_value(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.")
-    ("srid,s", po::value<uint32_t>(), "Oracle numerical SRID value to use to define point cloud.")
+    ("block-capacity", po::value<boost::uint32_t>()->default_value(3000), "Maximum number of points to be inserted into each block")
+    ("precision,p", po::value<boost::uint32_t>()->default_value(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.")
+    ("srid,s", po::value<boost::uint32_t>(), "Oracle numerical SRID value to use to define point cloud.")
     ("pre-sql", po::value< string >(), "Quoted SQL or filename location of PL/SQL to run before executing the point cloud creation process.")
     ("pre-block-sql", po::value< string >(), "Quoted SQL or filename location of PL/SQL to run before executing the insertion of block data.")
     ("post-sql", po::value< string >(), "Quoted SQL or filename location of PL/SQL to run after inserting block data.")
@@ -700,7 +700,7 @@
     bool bInsertHeaderBlob = false;
     bool bCachedReader = false;
     
-    uint32_t nCapacity = 10000;
+    boost::uint32_t nCapacity = 10000;
 
     int srid = 0;
     long precision = 8;
@@ -864,14 +864,14 @@
 
         if (vm.count("block-capacity")) 
         {
-            nCapacity = vm["block-capacity"].as< uint32_t >();
+            nCapacity = vm["block-capacity"].as< boost::uint32_t >();
             if (verbose)
                 std::cout << "Setting block capacity to: " << nCapacity << std::endl;
         }
         
         if (vm.count("precision")) 
         {
-            precision = vm["precision"].as< uint32_t >();
+            precision = vm["precision"].as< boost::uint32_t >();
             if (verbose)
                 std::cout << "Setting precision to: " << precision << std::endl;
 
@@ -879,7 +879,7 @@
         
         if (vm.count("srid")) 
         {
-            srid = vm["srid"].as< uint32_t >();
+            srid = vm["srid"].as< boost::uint32_t >();
             if (verbose)
                 std::cout << "Setting output Oracle SRID to: " << srid << std::endl;
         }
@@ -1135,7 +1135,7 @@
         reader2->SetFilters(filters);
         reader2->SetTransforms(transforms);
 
-        std::vector<uint8_t> header_data = GetHeaderData(input, reader2->GetHeader().GetDataOffset());
+        std::vector<boost::uint8_t> header_data = GetHeaderData(input, reader2->GetHeader().GetDataOffset());
 
         KDXIndexSummary* query = 0;
         if (!KDTreeIndexExists(input)) {
diff -r ebaaaf3dc720 -r d9076e050572 apps/las2oci.hpp
--- a/apps/las2oci.hpp	Thu Aug 26 14:28:05 2010 -0600
+++ b/apps/las2oci.hpp	Thu Aug 26 14:37:47 2010 -0600
@@ -11,6 +11,7 @@
 
 
 #include <liblas/liblas.hpp>
+#include <boost/cstdint.hpp>
 
 #include <string>
 #include <sstream>
@@ -39,7 +40,7 @@
 #include <boost/array.hpp>
 #include <boost/shared_ptr.hpp>
 
-typedef std::vector<uint32_t> IDVector;


More information about the Liblas-commits mailing list