[Liblas-commits] hg: 3 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Jun 22 10:52:25 EDT 2010


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

changeset 401e678032d8 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=401e678032d8
summary: clean up logic so it works elsewhere besides windows :)

changeset 64089c9824d9 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=64089c9824d9
summary: more links to sample data

diffstat:

 apps/CMakeLists.txt                  |  13 +++++++-
 apps/bigtest.cpp                     |  55 ++++++++++++++++++++++++++++++++++++
 cmake/modules/BuildOSGeo4W.cmake     |   8 +++-
 doc/download.txt                     |   4 ++
 doc/utilities/lasinfo.txt            |   8 +---
 include/liblas/lasclassification.hpp |  11 +++++++
 6 files changed, 89 insertions(+), 10 deletions(-)

diffs (190 lines):

diff -r 80fa961bbcfb -r 64089c9824d9 apps/CMakeLists.txt
--- a/apps/CMakeLists.txt	Sat Jun 19 17:22:20 2010 -0500
+++ b/apps/CMakeLists.txt	Tue Jun 22 09:52:16 2010 -0500
@@ -20,6 +20,12 @@
 set(LAS2TXT las2txt)
 set(TXT2LAS txt2las)
 set(LAS2LAS2 las2las2 )
+
+string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE_UPPER)
+if (CMAKE_BUILD_TYPE EQUAL ${BUILD_TYPE_UPPER})
+set(BIGFILE_TEST bigfile_test)
+endif()
+
 # Utilities depending on 3rd-pary libraries
 if(GDAL_FOUND)
     set(LAS2OGR las2ogr)
@@ -35,7 +41,7 @@
 
 set(LIBLAS_UTILITIES
     ${LASINFO} ${LASMERGE} ${LAS2LAS} ${LAS2TXT} ${TXT2LAS} 
-    ${LAS2OGR} ${LASINDEX} ${LAS2OCI} ${LAS2LAS2})
+    ${LAS2OGR} ${LASINDEX} ${LAS2OCI} ${LAS2LAS2} ${BIGFILE_TEST})
 
 # TODO: Experimental and requires testing --mloskot
 # Generate user-specific settings for Visual Studio project
@@ -121,6 +127,11 @@
     target_link_libraries(${LAS2OCI} ${APPS_CPP_DEPENDENCIES})
 endif()
 
+if (BIGFILE_TEST)
+    add_executable(${BIGFILE_TEST} bigtest.cpp)
+    target_link_libraries(${BIGFILE_TEST} ${LIBLAS_C_LIB_NAME})
+endif()
+
 ###############################################################################
 # Targets installation
 
diff -r 80fa961bbcfb -r 64089c9824d9 apps/bigtest.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/bigtest.cpp	Tue Jun 22 09:52:16 2010 -0500
@@ -0,0 +1,55 @@
+#include <liblas.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+void dumperror (const char * appmsg)
+{
+   printf("\n%s.\n\tMessage:  %s\n\tMethod: %s",appmsg, LASError_GetLastErrorMsg(), LASError_GetLastErrorMethod());
+}
+int main()
+{
+
+    LASHeaderH header = NULL;
+    LASWriterH writer = NULL;
+    LASReaderH reader = NULL;
+    LASError err;
+    // Limitation about seeking past 4GB output size.  At 20 bytes / record, we
+    // can successfully write 204 million records, but not 205.
+    const uint32_t nMillionPoints = 205;
+    const uint32_t NPOINTS = 1024*1024*nMillionPoints ;
+    const char * OutputName = "Issue147.las";
+
+    // Write a LAS file and after the points are in, update the header.
+    header = LASHeader_Create();
+    writer = LASWriter_Create(OutputName, header, LAS_MODE_WRITE);
+    for (uint32_t i = 0; i < NPOINTS; i++)
+    {
+      double percentDone = ((double)i)/NPOINTS * 100.0;
+      if (i % 1000 == 0)
+         printf("\b\b\b\b\b\b\b%6.2f%%", percentDone, nMillionPoints);
+      
+      LASPointH pt = LASPoint_Create();
+      err = LASPoint_SetX(pt, 0);
+      if (err) printf ("For point %d, failed to set point value X\n", i);
+      err = LASPoint_SetY(pt, 0);
+      if (err) printf ("For point %d, failed to set point value Y\n", i);
+      err = LASPoint_SetZ(pt, 0);
+      if (err) printf ("For point %d, failed to set point value Z\n", i);
+      err = LASWriter_WritePoint(writer, pt);  
+      if (err) printf ("For point %d, failed to WritePoint\n", i);
+      LASPoint_Destroy(pt);
+    }
+   err = LASHeader_SetPointRecordsCount(header, NPOINTS);
+   if (err) dumperror ("Failed to LASHeader_SetPointRecordsCount\n");
+   err = LASWriter_WriteHeader(writer, header);
+   if (err) dumperror ("Failed to LASWriter_WriteHeader");
+   LASWriter_Destroy(writer);
+   LASHeader_Destroy(header);
+   
+   // Read the file we just wrote and check the header data.
+    reader = LASReader_Create(OutputName);
+    header = LASReader_GetHeader(reader);
+    uint32_t npoints = LASHeader_GetPointRecordsCount(header);
+    printf ("\n\nWrote %d, Read %d (testing %d Million (1024 x 1024) Points)\n", NPOINTS, npoints, nMillionPoints);
+}
diff -r 80fa961bbcfb -r 64089c9824d9 cmake/modules/BuildOSGeo4W.cmake
--- a/cmake/modules/BuildOSGeo4W.cmake	Sat Jun 19 17:22:20 2010 -0500
+++ b/cmake/modules/BuildOSGeo4W.cmake	Tue Jun 22 09:52:16 2010 -0500
@@ -58,7 +58,7 @@
 
 
 add_custom_target(copy ALL COMMENT "Copying OSGeo4W files")
-add_dependencies( copy las2las2  )
+add_dependencies( copy make_osgeo4w_directories  )
 
 
 macro(copy_files GLOBPAT DESTINATION  )
@@ -80,7 +80,7 @@
 
 add_custom_target(tar
   COMMAND ${CMAKE_COMMAND} -E echo "Tarring OSGeo4W install")
-add_dependencies( tar las2las2  )
+add_dependencies( tar copy  )
 
 macro (tar_directories source destination base_path)
 
@@ -116,8 +116,10 @@
     )
 add_dependencies( osgeo4w tar   )
 
-add_dependencies(  osgeo4w  las2las2 )
 
+foreach(utility ${LIBLAS_UTILITIES})
+    add_dependencies(  osgeo4w  ${utility} )
 
+endforeach()
 
 
diff -r 80fa961bbcfb -r 64089c9824d9 doc/download.txt
--- a/doc/download.txt	Sat Jun 19 17:22:20 2010 -0500
+++ b/doc/download.txt	Tue Jun 22 09:52:16 2010 -0500
@@ -26,6 +26,10 @@
 
 .. seealso::
     :ref:`source`
+
+.. seealso::
+    A `sample library <http://liblas.org/samples>`__ is also available to provide 
+    data to test your tools.
     
 Development Releases
 ..............................................................................
diff -r 80fa961bbcfb -r 64089c9824d9 doc/utilities/lasinfo.txt
--- a/doc/utilities/lasinfo.txt	Sat Jun 19 17:22:20 2010 -0500
+++ b/doc/utilities/lasinfo.txt	Tue Jun 22 09:52:16 2010 -0500
@@ -131,12 +131,8 @@
 Example data
 ------------
 
-try these sources for sample lidar data in LAS format:
+Visit the libLAS sample library for LiDAR data in LAS format:
 
-http://www.geoict.net/LidarData/Data/OptechSampleLAS.zip
-
-http://www.qcoherent.com/data/LP360_Sample_Data.rar
-
-http://www.appliedimagery.com/Serpent%20Mound%20Model%20LAS%20Data.las
+http://liblas.org/samples/
 
 .. _`LAStools`: http://www.cs.unc.edu/~isenburg/lastools/
diff -r 80fa961bbcfb -r 64089c9824d9 include/liblas/lasclassification.hpp
--- a/include/liblas/lasclassification.hpp	Sat Jun 19 17:22:20 2010 -0500
+++ b/include/liblas/lasclassification.hpp	Tue Jun 22 09:52:16 2010 -0500
@@ -63,6 +63,7 @@
     /// Alias on std::bitset<8> used as collection of flags.
     typedef std::bitset<8> bitset_type;
 
+
     /// Number of classes in lookup table as defined in ASPRS LAS 1.1+.
     /// For LAS 1.0, this static number may be invalid and
     /// extend up to 255 classes stored in variable-length records.
@@ -146,7 +147,17 @@
     uint8_t GetClass() const
     {
         bitset_type bits(m_flags);
+        
+        // MSVC 2010 changed this to an unsigned long long, but did not 
+        // provide the old constructor for merely an unsigned long.  AFAIK
+        // there is only std::bitset<_Bits>::bitset(_ULonglong) and 
+        // std::bitset<_Bits>::bitset(int) here.  As an aside, I see no reason
+        // to have a mask any larger than std::bitset<_Bits>::bitset(int)
+#ifdef WIN32 && if (_MSC_VER >= 1600)
+        bitset_type const mask(static_cast<unsigned long long>(class_table_size) - 1);
+#else
         bitset_type const mask(static_cast<unsigned long>(class_table_size) - 1);
+#endif
         bits &= mask;
 
         uint8_t const index = static_cast<uint8_t>(bits.to_ulong());


More information about the Liblas-commits mailing list