[Liblas-commits] hg: 3 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Wed Jan 13 19:26:35 EST 2010


changeset 1a9a7ae688c0 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=1a9a7ae688c0
summary: Updated documentation in Doxygen comments for LASReader and LASWriter.

changeset a59a55c07cd8 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=a59a55c07cd8
summary: It is supposed to be update only in LASReader and LASWriter documentation but looks like big merge.

changeset a87ed509c137 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=a87ed509c137
summary: Merged two dummy commits testing server connection

diffstat:

 .hgignore                              |    1 +
 CMakeLists.txt                         |   17 +-
 README                                 |    7 +-
 apps/CMakeLists.txt                    |   23 +-
 apps/las2las.c                         |   86 +++++++++++-
 apps/lascommon.c                       |    2 +-
 autogen.sh                             |    3 +-
 build/cmake/FindGeoTIFF.cmake          |   78 +++++++---
 build/cmake/FindOracle.cmake           |   77 ++++++++++
 build/cmake/FindSpatialIndex.cmake     |   96 ++++++------
 include/liblas/capi/liblas.h           |    6 +-
 include/liblas/lasreader.hpp           |    5 +-
 include/liblas/lasspatialreference.hpp |   31 ++++-
 include/liblas/laswriter.hpp           |   25 ++-
 python/liblas/core.py                  |    9 +
 python/liblas/srs.py                   |   11 +-
 python/tests/File.txt                  |   36 ++--
 python/tests/SRS-GDAL.txt              |   12 +-
 src/CMakeLists.txt                     |   26 +-
 src/gt_wkt_srs.cpp                     |  234 +++++++++++++++++++++++++++++++-
 src/las_c_api.cpp                      |   36 ++++-
 src/lasheader.cpp                      |    2 +-
 src/lasspatialreference.cpp            |   77 ++++++++++-
 test/data/srs_vertcs.las               |    0 
 test/unit/laspoint_test.cpp            |   10 +-
 test/unit/lasreader_test.cpp           |    2 +-
 test/unit/laswriter_test.cpp           |    4 +-
 27 files changed, 751 insertions(+), 165 deletions(-)

diffs (truncated from 1598 to 300 lines):

diff -r 008dd83b4d5d -r a87ed509c137 .hgignore
--- a/.hgignore	Thu Dec 31 03:03:19 2009 +0000
+++ b/.hgignore	Thu Jan 14 00:26:14 2010 +0000
@@ -62,3 +62,4 @@
 src/liblas.a
 Debug
 Release
+.DS_Store
diff -r 008dd83b4d5d -r a87ed509c137 CMakeLists.txt
--- a/CMakeLists.txt	Thu Dec 31 03:03:19 2009 +0000
+++ b/CMakeLists.txt	Thu Jan 14 00:26:14 2010 +0000
@@ -149,8 +149,8 @@
             INCLUDE_DIRECTORIES(${GEOTIFF_INCLUDE_DIR})
             ADD_DEFINITIONS(-DHAVE_LIBGEOTIFF=1)
         ENDIF()
-    ENDIF(GEOTIFF_FOUND)
-ENDIF(WITH_GEOTIFF)
+    ENDIF()
+ENDIF()
 
 # GDAL/OGR support - optional, default=OFF
 SET(WITH_GDAL FALSE CACHE BOOL "Choose if GDAL support should be built")
@@ -169,7 +169,7 @@
         CHECK_FUNCTION_EXISTS(OSRSetEquirectangular2 HAVE_OSRSETEQUIRECTANGULAR2)
     
         IF(NOT HAVE_OSRSETEQUIRECTANGULAR2)
-			# Reset to NOT found for GDAL/OGR
+            # Reset to NOT found for GDAL/OGR
             SET(GDAL_FOUND)
             MESSAGE(FATAL_ERROR "GDAL support requires GDAL 1.6.0 or newer")
         ELSE()
@@ -195,7 +195,16 @@
 ENDIF()
 
 # Oracle support - optional, default=OFF
-# TODO
+SET(WITH_ORACLE FALSE CACHE BOOL "Choose if Oracle support should be built")
+
+IF(WITH_ORACLE)
+    FIND_PACKAGE(Oracle)
+
+    IF(ORACLE_FOUND)
+        INCLUDE_DIRECTORIES(${ORACLE_INCLUDE_DIR})
+        ADD_DEFINITIONS(-DHAVE_ORACLE=1)
+    ENDIF()
+ENDIF()
 
 ###############################################################################
 # Installation settings
diff -r 008dd83b4d5d -r a87ed509c137 README
--- a/README	Thu Dec 31 03:03:19 2009 +0000
+++ b/README	Thu Jan 14 00:26:14 2010 +0000
@@ -1,4 +1,4 @@
-     
+   
 libLAS - LAS 1.0/1.1/1.2 ASPRS LiDAR data translation toolset
 ==============================================================================
 
@@ -104,7 +104,9 @@
 Linked against a 1.2.5+ version of `libgeotiff`_, you can set and get the spatial reference 
 systems of LAS files using simple `proj.4`_ coordinate system definitions.  
 Alternatively, with libLAS 1.2, you can link against `GDAL`_ to be able to 
-manipulate spatial references using WKT.
+manipulate spatial references using WKT.  The current development version of 
+libLAS can be used in combination with `GDAL`_ 1.7 to support `vertical coordinate systems`_ 
+as well.
 
 Simple Variable Length Record Abstraction
 ..............................................................................
@@ -221,3 +223,4 @@
 .. _`dotnetLibLAS API`: http://liblas.org/wiki/dotnetapi
 .. _`FOSS4G 2008`: http://liblas.org/raw-attachment/wiki/WikiStart/liblas_foss4g_2008.pdf
 .. _`ASPRS Workshop Demo`: http://liblas.org/raw-attachment/wiki/WikiStart/ASPRS-Workshop-NOAA-Demo.pdf
+.. _`vertical coordinate systems`: http://liblas.org/wiki/VerticalCS
diff -r 008dd83b4d5d -r a87ed509c137 apps/CMakeLists.txt
--- a/apps/CMakeLists.txt	Thu Dec 31 03:03:19 2009 +0000
+++ b/apps/CMakeLists.txt	Thu Jan 14 00:26:14 2010 +0000
@@ -29,7 +29,7 @@
     SET(LASINDEX lasindex)
 ENDIF()
 
-IF(OCI_FOUND)
+IF(ORACLE_FOUND AND GDAL_FOUND)
     SET(LAS2OCI las2oci)
 ENDIF()
 
@@ -56,63 +56,64 @@
 
 SET(APPS_CPP_DEPENDENCIES
     ${LIBLAS_LIB_NAME}
+    ${ZLIB_LIBRARY}
     ${GEOTIFF_LIBRARY}
     ${GDAL_LIBRARY}
     ${SPATIALINDEX_LIBRARY}
-    ${ZLIB_LIBRARY})
+    ${ORACLE_LIBRARY})
 
 # Build lasinfo
 IF(LASINFO)
     SET(LASINFO_SRC lascommon.c ${LASINFO}.c)
     ADD_EXECUTABLE(${LASINFO} ${LASINFO_SRC})
     TARGET_LINK_LIBRARIES(${LASINFO} ${LIBLAS_C_LIB_NAME})
-ENDIF(LASINFO)
+ENDIF()
 
 # Build las2las
 IF(LAS2LAS)
     SET(LAS2LAS_SRC lascommon.c ${LAS2LAS}.c)
     ADD_EXECUTABLE(${LAS2LAS} ${LAS2LAS_SRC})
     TARGET_LINK_LIBRARIES(${LAS2LAS} ${LIBLAS_C_LIB_NAME})
-ENDIF(LAS2LAS)
+ENDIF()
 
 # Build las2txt
 IF(LAS2TXT)
     SET(LAS2TXT_SRC lascommon.c ${LAS2TXT}.c)
     ADD_EXECUTABLE(${LAS2TXT} ${LAS2TXT_SRC})
     TARGET_LINK_LIBRARIES(${LAS2TXT} ${LIBLAS_C_LIB_NAME})
-ENDIF(LAS2TXT)
+ENDIF()
  
 # Build txt2las
 IF(TXT2LAS)
     SET(TXT2LAS_SRC lascommon.c ${TXT2LAS}.c)
     ADD_EXECUTABLE(${TXT2LAS} ${TXT2LAS_SRC})
     TARGET_LINK_LIBRARIES(${TXT2LAS} ${LIBLAS_C_LIB_NAME})
-ENDIF(TXT2LAS)
+ENDIF()
 
 # Build lasmerge
 IF(LASMERGE)
     SET(LASMERGE_SRC lascommon.c ${LASMERGE}.c)
     ADD_EXECUTABLE(${LASMERGE} ${LASMERGE_SRC})
     TARGET_LINK_LIBRARIES(${LASMERGE} ${LIBLAS_C_LIB_NAME})
-ENDIF(LASMERGE)
+ENDIF()
 
 # Build lasindex
 IF(LASINDEX)
     ADD_EXECUTABLE(${LASINDEX} lasindex.cpp)
     TARGET_LINK_LIBRARIES(${LASINDEX} ${APPS_CPP_DEPENDENCIES})
-ENDIF(LASINDEX)
+ENDIF()
 
 # Build las2ogr
 IF(LAS2OGR)
     ADD_EXECUTABLE(${LAS2OGR} las2ogr.cpp)
     TARGET_LINK_LIBRARIES(${LAS2OGR} ${APPS_CPP_DEPENDENCIES})
-ENDIF(LAS2OGR)
+ENDIF()
 
 # Build las2oci
 IF(LAS2OCI)
     ADD_EXECUTABLE(${LAS2OCI} las2oci.cpp)
-    TARGET_LINK_LIBRARIES(${LAS2CI} ${APPS_CPP_DEPENDENCIES})
-ENDIF(LAS2OCI)
+    TARGET_LINK_LIBRARIES(${LAS2OCI} ${APPS_CPP_DEPENDENCIES})
+ENDIF()
 
 ###############################################################################
 # Targets installation
diff -r 008dd83b4d5d -r a87ed509c137 apps/las2las.c
--- a/apps/las2las.c	Thu Dec 31 03:03:19 2009 +0000
+++ b/apps/las2las.c	Thu Jan 14 00:26:14 2010 +0000
@@ -140,6 +140,8 @@
     LASPointH surviving_point_max = NULL;
     double surviving_gps_time_min;
     double surviving_gps_time_max;
+    int verticalCSType = -1, verticalDatum = -1, verticalUnits = 9001;
+    const char *verticalCitation = "";
 
     int clipped = 0;
     int eliminated_return = 0;
@@ -336,6 +338,44 @@
                 do_reprojection = TRUE;
             }
         }
+        else if (   strcmp(argv[i],"--a_srs") == 0  ||
+                    strcmp(argv[i],"-a_srs") == 0 
+                )
+        {
+            ++i;
+            if (LAS_IsGDALEnabled()) {
+                out_srs = LASSRS_Create();
+                ret = LASSRS_SetFromUserInput(out_srs, argv[i]);
+                if (ret) {
+                    LASError_Print("Unable to import output SRS");
+                    exit(1);
+                }
+            }
+        }
+        else if (   strcmp(argv[i],"--a_vertcs") == 0  ||
+                    strcmp(argv[i],"-a_vertcs") == 0 
+                )
+        {
+            ++i;
+            verticalCSType = atoi(argv[i]);
+            ++i;
+            if( i < argc && argv[i][0] != '-' )
+            {
+                verticalCitation = argv[i];
+                ++i;
+
+                if( i < argc && argv[i][0] != '-' )
+                {
+                    verticalDatum = atoi(argv[i]);
+                    ++i;
+                    if( i < argc && argv[i][0] != '-' )
+                    {
+                        verticalUnits = atoi(argv[i]);
+                        ++i;
+                    }
+                }
+            }
+        }
         else if (   strcmp(argv[i],"--scale") == 0  ||
                     strcmp(argv[i],"-scale") == 0    
                 )
@@ -627,7 +667,12 @@
         fprintf(stderr, 
         "thinned: %d\n", 
         thinned);
-        
+    
+    if (surviving_number_of_point_records == 0) {
+        fprintf(stderr, "All points were eliminated!\n");
+        exit(0);
+    }
+    
     LASReader_Destroy(reader);
     LASHeader_Destroy(header);
   
@@ -811,6 +856,22 @@
         LASHeader_SetDataOffset(surviving_header, LASHeader_GetDataOffset(surviving_header)+abs(header_pad));
     }
     
+    /* Do we have vertical cs info to set? */
+    if( verticalCSType > 0 )
+    {
+        if( out_srs == NULL )
+            out_srs = LASHeader_GetSRS(surviving_header);
+
+        if( out_srs == NULL )
+            out_srs = LASSRS_Create();
+
+        LASSRS_SetVerticalCS( out_srs,
+                              verticalCSType, 
+                              verticalCitation, 
+                              verticalDatum, 
+                              verticalUnits );
+    }
+
     if (do_reprojection) {
         if (verbose) {
             proj4_text =  LASSRS_GetProj4(out_srs);
@@ -819,14 +880,20 @@
             free(proj4_text);
         }
         
-        /* keep around the header's SRS if we don't have on set by the user */
+        /* keep around the header's SRS if we don't have one set by the user */
         if (in_srs == NULL) {
             in_srs = LASHeader_GetSRS(surviving_header);
         }
         
         LASHeader_SetSRS(surviving_header, out_srs);
-        
     }
+
+    /* Are we just assigning an override SRS? (-a_srs) */
+    else if( out_srs != NULL )
+    {
+        LASHeader_SetSRS(surviving_header, out_srs);
+    }
+
     if (verbose) {
         fprintf(stderr, 
                 "second pass reading %d and writing %d points ...\n", 
@@ -974,8 +1041,11 @@
     LASReader_Destroy(reader);
     LASHeader_Destroy(header);
     LASHeader_Destroy(surviving_header);
-    LASPoint_Destroy(surviving_point_max);
-    LASPoint_Destroy(surviving_point_min);
+
+    if (surviving_point_max != NULL)
+        LASPoint_Destroy(surviving_point_max);
+    if (surviving_point_min != NULL)
+        LASPoint_Destroy(surviving_point_min);
 
     reader = LASReader_Create(file_name_out);
     if (!reader) { 
@@ -997,8 +1067,10 @@
     repair_header(stderr, header, summary) ;
 
     if (summary != NULL) {
-        LASPoint_Destroy(summary->pmin);
-        LASPoint_Destroy(summary->pmax);
+        if (summary->pmin != NULL)
+            LASPoint_Destroy(summary->pmin);


More information about the Liblas-commits mailing list