[Liblas-commits] hg: 2 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Oct 20 12:10:40 EDT 2009


changeset e5f3e5dfe317 in /home/www/liblas.org/hg
details: http://hg.liblas.org/main/hg?cmd=changeset;node=e5f3e5dfe317
summary: support fetching and overriding the SRS

changeset 892246f18c76 in /home/www/liblas.org/hg
details: http://hg.liblas.org/main/hg?cmd=changeset;node=892246f18c76
summary: merge

diffstat:

 .hgignore                          |  11 +++++
 CMakeLists.txt                     |  17 +++++++-
 apps/las2las.c                     |   7 +++-
 build/cmake/FindGDAL.cmake         |  28 +++++++++++--
 build/cmake/FindGeoTIFF.cmake      |  78 ++++++++++++++++----------------------
 build/cmake/FindSpatialIndex.cmake |  24 ++++++++++-
 include/liblas/index/query.hpp     |  46 ++++++++++++-----------
 include/liblas/index/storage.hpp   |  14 ++++---
 python/scripts/oci2las.py          |  61 ++++++++++++++++++++++++++++--
 src/detail/reader.cpp              |  13 +++++-
 src/index/index.cpp                |   1 +
 src/index/query.cpp                |  72 +++++++++++++++++-------------------
 src/index/storage.cpp              |  68 +++++++++++++++++++---------------
 src/index/visitor.cpp              |  18 +++++---
 src/lasspatialreference.cpp        |  10 +---
 15 files changed, 294 insertions(+), 174 deletions(-)

diffs (truncated from 956 to 300 lines):

diff -r 2b2fa43686d7 -r 892246f18c76 .hgignore
--- a/.hgignore	Mon Oct 19 14:42:01 2009 -0500
+++ b/.hgignore	Tue Oct 20 11:07:50 2009 -0500
@@ -1,20 +1,29 @@
 syntax: glob
 .deps
 .libs
+*~
 *.dll
+*.embed.manifest
 *.exe
 *.exp
+*.idb
+*.ilk
+*.intermediate.manifest
 *.la
 *.lib
 *.lo
+*.ncb
 *.o
 *.obj
+*.pdb
 *.pyc
 *.res
+*.suo
 *.swp
 *.bz2
 *.gz
 *.orig
+*.user
 aclocal.m4
 apps/las2las
 apps/las2txt
@@ -51,3 +60,5 @@
 CMakeCache.txt
 cmake_install.cmake
 src/liblas.a
+Debug
+Release
diff -r 2b2fa43686d7 -r 892246f18c76 CMakeLists.txt
--- a/CMakeLists.txt	Mon Oct 19 14:42:01 2009 -0500
+++ b/CMakeLists.txt	Tue Oct 20 11:07:50 2009 -0500
@@ -158,8 +158,18 @@
     FIND_PACKAGE(GDAL 1.6.0)
 
     IF(GDAL_FOUND)
-        INCLUDE_DIRECTORIES(${GDAL_INCLUDE_DIR})
-	    ADD_DEFINITIONS(-DHAVE_GDAL=1)
+        # Confirm required API is available
+        INCLUDE(CheckFunctionExists) 
+        SET(CMAKE_REQUIRED_LIBRARIES ${GDAL_LIBRARY})
+        CHECK_FUNCTION_EXISTS(OSRSetEquirectangular2 HAVE_OSRSETEQUIRECTANGULAR2)
+    
+        IF(NOT HAVE_OSRSETEQUIRECTANGULAR2)
+            GDALSET(_FOUND) # Reset to NOT found for GDAL/OGR
+            MESSAGE(FATAL_ERROR "GDAL support requires GDAL 1.6.0 or newer.")
+        ELSE()
+            INCLUDE_DIRECTORIES(${GDAL_INCLUDE_DIR})
+            ADD_DEFINITIONS(-DHAVE_GDAL=1)
+        ENDIF()
     ENDIF()
 ENDIF()
 
@@ -171,6 +181,9 @@
 
     IF(SPATIALINDEX_FOUND)
         INCLUDE_DIRECTORIES(${SPATIALINDEX_INCLUDE_DIR})
+        IF (IS_DIRECTORY ${SPATIALINDEX_INCLUDE_DIR}/spatialindex)
+            INCLUDE_DIRECTORIES(${SPATIALINDEX_INCLUDE_DIR}/spatialindex)
+        ENDIF()
         ADD_DEFINITIONS(-DHAVE_SPATIALINDEX=1)
     ENDIF()
 ENDIF()
diff -r 2b2fa43686d7 -r 892246f18c76 apps/las2las.c
--- a/apps/las2las.c	Mon Oct 19 14:42:01 2009 -0500
+++ b/apps/las2las.c	Tue Oct 20 11:07:50 2009 -0500
@@ -19,6 +19,11 @@
 #include <stdlib.h>
 #include <string.h>
 
+#ifdef _WIN32
+#define compare_no_case(a,b,n)  _strnicmp( (a), (b), (n) )
+#else
+#define compare_no_case(a,b,n)  strncasecmp( (a), (b), (n) )
+#endif
 
 LASPointSummary* SummarizePoints(LASReaderH reader);
 void print_point_summary(FILE *file, LASPointSummary* summary, LASHeaderH header);
@@ -354,7 +359,7 @@
                 )
         {
             i++;
-            if (!strncasecmp(argv[i], "min", 3)) {
+            if (!compare_no_case(argv[i], "min", 3)) {
                 use_min_offset = TRUE;
                 do_set_offset = TRUE;
             } else
diff -r 2b2fa43686d7 -r 892246f18c76 build/cmake/FindGDAL.cmake
--- a/build/cmake/FindGDAL.cmake	Mon Oct 19 14:42:01 2009 -0500
+++ b/build/cmake/FindGDAL.cmake	Tue Oct 20 11:07:50 2009 -0500
@@ -14,11 +14,21 @@
 #
 ###############################################################################
 MESSAGE(STATUS "Searching for GDAL ${GDAL_FIND_VERSION}+ library")
+MESSAGE(STATUS "   NOTE: Required version is not checked - to be implemented")
 
 SET(GDAL_NAMES gdal)
 
 IF(WIN32)
 
+    SET(OSGEO4W_IMPORT_LIBRARY gdal_i)
+    IF(DEFINED ENV{OSGEO4W_ROOT})
+        SET(OSGEO4W_ROOT_DIR $ENV{OSGEO4W_ROOT})
+        MESSAGE(STATUS "Trying OSGeo4W using environment variable OSGEO4W_ROOT=$ENV{OSGEO4W_ROOT}")
+    ELSE()
+        SET(OSGEO4W_ROOT_DIR c:/OSGeo4W)
+        MESSAGE(STATUS "Trying OSGeo4W using default location OSGEO4W_ROOT=${OSGEO4W_ROOT_DIR}")
+    ENDIF()
+
     IF(MINGW)
         FIND_PATH(GDAL_INCLUDE_DIR
             gdal.h
@@ -26,7 +36,8 @@
             PATHS
             /usr/local/include
             /usr/include
-            c:/msys/local/include)
+            c:/msys/local/include
+            ${OSGEO4W_ROOT_DIR}/include)
 
         FIND_LIBRARY(GDAL_LIBRARY
             NAMES ${GDAL_NAMES}
@@ -34,21 +45,28 @@
             PATHS
             /usr/local/lib
             /usr/lib
-            c:/msys/local/lib)
+            c:/msys/local/lib
+            ${OSGEO4W_ROOT_DIR}/lib)
     ENDIF(MINGW)
 
     IF(MSVC)
-        SET(GDAL_INCLUDE_DIR "$ENV{LIB_DIR}/include/gdal" CACHE STRING INTERNAL)
 
+        FIND_PATH(GDAL_INCLUDE_DIR
+            NAMES gdal.h 
+            PATH_PREFIXES gdal gdal-1.6
+            PATHS
+            "$ENV{LIB_DIR}/include/gdal"
+            ${OSGEO4W_ROOT_DIR}/include)
 
-        SET(GDAL_NAMES ${GDAL_NAMES} gdal_I)
+        SET(GDAL_NAMES ${OSGEO4W_IMPORT_LIBRARY} ${GDAL_NAMES})
         FIND_LIBRARY(GDAL_LIBRARY
             NAMES ${GDAL_NAMES}
             PATH_PREFIXES gdal gdal-1.6
             PATHS
             "$ENV{LIB_DIR}/lib"
             /usr/lib
-            c:/msys/local/lib)
+            c:/msys/local/lib
+            ${OSGEO4W_ROOT_DIR}/lib)
         
         IF(GDAL_LIBRARY)
             SET(GDAL_LIBRARY;odbc32;odbccp32 CACHE STRING INTERNAL)
diff -r 2b2fa43686d7 -r 892246f18c76 build/cmake/FindGeoTIFF.cmake
--- a/build/cmake/FindGeoTIFF.cmake	Mon Oct 19 14:42:01 2009 -0500
+++ b/build/cmake/FindGeoTIFF.cmake	Tue Oct 20 11:07:50 2009 -0500
@@ -1,16 +1,18 @@
 ###############################################################################
+#
 # CMake module to search for GeoTIFF library
 #
 # On success, the macro sets the following variables:
 # GEOTIFF_FOUND       = if the library found
-# GEOTIFF_LIBRARY     = full path to the library
+# GEOTIFF_LIBRARIES   = full path to the library
 # GEOTIFF_INCLUDE_DIR = where to find the library headers 
-#
-# On Unix, macro sets also:
-# GEOTIFF_VERSION_STRING = human-readable string containing version of the library
+# also defined, but not for general use are
+# GEOTIFF_LIBRARY, where to find the PROJ.4 library.
 #
 # Copyright (c) 2009 Mateusz Loskot <mateusz at loskot.net>
 #
+# Module source: http://github.com/mloskot/workshop/tree/master/cmake/
+#
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 #
@@ -18,54 +20,40 @@
 MESSAGE(STATUS "Searching for GeoTIFF ${GeoTIFF_FIND_VERSION}+ library")
 MESSAGE(STATUS "   NOTE: Required version is not checked - to be implemented")
 
-SET(GEOTIFF_NAMES geotiff)
+IF(GEOTIFF_INCLUDE_DIR)
+    # Already in cache, be silent
+    SET(GEOTIFF_FIND_QUIETLY TRUE)
+ENDIF()
 
 IF(WIN32)
+    SET(OSGEO4W_IMPORT_LIBRARY geotiff_i)
+    IF(DEFINED ENV{OSGEO4W_ROOT})
+        SET(OSGEO4W_ROOT_DIR $ENV{OSGEO4W_ROOT})
+        MESSAGE(STATUS "Trying OSGeo4W using environment variable OSGEO4W_ROOT=$ENV{OSGEO4W_ROOT}")
+    ELSE()
+        SET(OSGEO4W_ROOT_DIR c:/OSGeo4W)
+        MESSAGE(STATUS "Trying OSGeo4W using default location OSGEO4W_ROOT=${OSGEO4W_ROOT_DIR}")
+    ENDIF()
+ENDIF()
+     
+FIND_PATH(GEOTIFF_INCLUDE_DIR
+    geotiff.h
+    PATH_PREFIXES geotiff
+    PATHS
+    ${OSGEO4W_ROOT_DIR}/include)
 
-    IF(MINGW)
-        FIND_PATH(GEOTIFF_INCLUDE_DIR
-            geotiff.h
-            PATH_PREFIXES geotiff
-            PATHS
-            /usr/local/include
-            /usr/include
-            c:/msys/local/include)
+SET(GEOTIFF_NAMES ${OSGEO4W_IMPORT_LIBRARY} geotiff)
 
-        FIND_LIBRARY(GEOTIFF_LIBRARY
-            NAMES ${GEOTIFF_NAMES}
-            PATHS
-            /usr/local/lib
-            /usr/lib
-            c:/msys/local/lib)
-    ENDIF(MINGW)
+FIND_LIBRARY(GEOTIFF_LIBRARY
+    NAMES ${GEOTIFF_NAMES}
+    PATHS
+    ${OSGEO4W_ROOT_DIR}/lib)
 
-    IF(MSVC)
-        SET(GEOTIFF_INCLUDE_DIR "$ENV{LIB_DIR}/include" CACHE STRING INTERNAL)
-
-        SET(GEOTIFF_NAMES ${GEOTIFF_NAMES} geotiff_i)
-        FIND_LIBRARY(GEOTIFF_LIBRARY NAMES 
-            NAMES ${GEOTIFF_NAMES}
-            PATHS
-            "$ENV{LIB_DIR}/lib"
-            /usr/lib
-            c:/msys/local/lib)
-    ENDIF(MSVC)
-  
-ELSEIF(UNIX)
-
-    FIND_PATH(GEOTIFF_INCLUDE_DIR geotiff.h PATH_PREFIXES geotiff)
-
-    FIND_LIBRARY(GEOTIFF_LIBRARY NAMES ${GEOTIFF_NAMES})
-
-ELSE()
-    MESSAGE("FindGeoTIFF.cmake: unrecognized or unsupported operating system (use Unix or Windows)")
+IF(GEOTIFF_FOUND)
+  SET(GEOTIFF_LIBRARIES ${GEOTIFF_LIBRARY})
 ENDIF()
 
-# Handle the QUIETLY and REQUIRED arguments and set SPATIALINDEX_FOUND to TRUE
+# Handle the QUIETLY and REQUIRED arguments and set GEOTIFF_FOUND to TRUE
 # if all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(GEOTIFF DEFAULT_MSG GEOTIFF_LIBRARY GEOTIFF_INCLUDE_DIR)
-
-# TODO: Do we want to mark these as advanced? --mloskot
-# http://www.cmake.org/cmake/help/cmake2.6docs.html#command:mark_as_advanced
-#MARK_AS_ADVANCED(GEOTIFF_LIBRARY GEOTIFF_INCLUDE_DIR)
diff -r 2b2fa43686d7 -r 892246f18c76 build/cmake/FindSpatialIndex.cmake
--- a/build/cmake/FindSpatialIndex.cmake	Mon Oct 19 14:42:01 2009 -0500
+++ b/build/cmake/FindSpatialIndex.cmake	Tue Oct 20 11:07:50 2009 -0500
@@ -20,10 +20,28 @@
     SET(SPATIALINDEX_FIND_QUIETLY TRUE)
 ENDIF()
 
-FIND_PATH(SPATIALINDEX_INCLUDE_DIR NAMES RTree.h PATH_PREFIXES spatialindex)
+IF(WIN32)
+    SET(OSGEO4W_IMPORT_LIBRARY spatialindex_i)
+    IF(DEFINED ENV{OSGEO4W_ROOT})
+        SET(OSGEO4W_ROOT_DIR $ENV{OSGEO4W_ROOT})
+        MESSAGE(STATUS "Trying OSGeo4W using environment variable OSGEO4W_ROOT=$ENV{OSGEO4W_ROOT}")
+    ELSE()
+        SET(OSGEO4W_ROOT_DIR c:/OSGeo4W)
+        MESSAGE(STATUS "Trying OSGeo4W using default location OSGEO4W_ROOT=${OSGEO4W_ROOT_DIR}")
+    ENDIF()
+ENDIF()
 
-SET(SPATIALINDEX_NAMES spatialindex)
-FIND_LIBRARY(SPATIALINDEX_LIBRARY NAMES ${SPATIALINDEX_NAMES} )
+FIND_PATH(SPATIALINDEX_INCLUDE_DIR
+    NAMES RTree.h 
+    PATH_PREFIXES spatialindex
+    PATHS
+    ${OSGEO4W_ROOT_DIR}/include)
+


More information about the Liblas-commits mailing list