[Liblas-commits] hg: 2 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Dec 29 12:03:24 EST 2009


changeset d6430d562e14 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=d6430d562e14
summary: start segmenting out GDAL-related SRS test code

changeset bff38a2f7907 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=bff38a2f7907
summary: Add IsLibSpatialIndexEnabled to test if we have spatialindex library support

diffstat:

 include/liblas/capi/liblas.h |   1 +
 include/liblas/liblas.hpp    |  10 ++++++++++
 python/liblas/__init__.py    |   1 +
 python/liblas/core.py        |   1 +
 python/tests/SRS.txt         |   5 ++---
 src/las_c_api.cpp            |   4 ++++
 6 files changed, 19 insertions(+), 3 deletions(-)

diffs (88 lines):

diff -r da7856778e01 -r bff38a2f7907 include/liblas/capi/liblas.h
--- a/include/liblas/capi/liblas.h	Mon Dec 28 21:18:31 2009 -0600
+++ b/include/liblas/capi/liblas.h	Tue Dec 29 10:59:15 2009 -0600
@@ -131,6 +131,7 @@
 
 LAS_DLL int LAS_IsGDALEnabled(void);
 
+LAS_DLL int LAS_IsLibSpatialIndexEnabled(void);
 /****************************************************************************/
 /* Error handling                                                           */
 /****************************************************************************/
diff -r da7856778e01 -r bff38a2f7907 include/liblas/liblas.hpp
--- a/include/liblas/liblas.hpp	Mon Dec 28 21:18:31 2009 -0600
+++ b/include/liblas/liblas.hpp	Tue Dec 29 10:59:15 2009 -0600
@@ -118,6 +118,16 @@
 #endif
 }
 
+/// Check if libspatialindex support has been built in to libLAS.
+inline bool IsLibSpatialIndexEnabled()
+{
+#ifdef HAVE_SPATIALINDEX
+    return true;
+#else
+    return false;
+#endif
+}
+
 } // namespace liblas
 
 #endif // LIBLAS_HPP_INCLUDED
diff -r da7856778e01 -r bff38a2f7907 python/liblas/__init__.py
--- a/python/liblas/__init__.py	Mon Dec 28 21:18:31 2009 -0600
+++ b/python/liblas/__init__.py	Tue Dec 29 10:59:15 2009 -0600
@@ -4,6 +4,7 @@
 version = get_version()
 HAVE_GDAL = bool(las.LAS_IsGDALEnabled())
 HAVE_LIBGEOTIFF = bool(las.LAS_IsLibGeoTIFFEnabled())
+HAVE_SPATIALINDEX = bool(las.LAS_IsLibSpatialIndexEnabled())
 
 import sys
 
diff -r da7856778e01 -r bff38a2f7907 python/liblas/core.py
--- a/python/liblas/core.py	Mon Dec 28 21:18:31 2009 -0600
+++ b/python/liblas/core.py	Tue Dec 29 10:59:15 2009 -0600
@@ -150,6 +150,7 @@
 
 las.LAS_IsGDALEnabled.restype = ctypes.c_int
 las.LAS_IsLibGeoTIFFEnabled.restype = ctypes.c_int
+las.LAS_IsLibSpatialIndexEnabled.restype = ctypes.c_int
 
 las.LAS_GetVersion.restype = ctypes.POINTER(ctypes.c_char)
 las.LAS_GetVersion.errcheck = free_returned_char_p
diff -r da7856778e01 -r bff38a2f7907 python/tests/SRS.txt
--- a/python/tests/SRS.txt	Mon Dec 28 21:18:31 2009 -0600
+++ b/python/tests/SRS.txt	Tue Dec 29 10:59:15 2009 -0600
@@ -21,15 +21,14 @@
   True
   
   >>> s = srs.SRS()
-  >>> s.set_userinput('EPSG:4326')
-  True
-  
+
   >>> def test_userinput():
   ...     if not liblas.HAVE_LIBGEOTIFF:
   ...         return True
   ...     if not liblas.HAVE_GDAL: 
   ...         return s.proj4 == ''
   ...     if liblas.HAVE_GDAL:
+  ...         s.set_userinput('EPSG:4326')
   ...         return s.proj4 == '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs '
   ...     return False
   
diff -r da7856778e01 -r bff38a2f7907 src/las_c_api.cpp
--- a/src/las_c_api.cpp	Mon Dec 28 21:18:31 2009 -0600
+++ b/src/las_c_api.cpp	Tue Dec 29 10:59:15 2009 -0600
@@ -135,6 +135,10 @@
     return IsLibGeoTIFFEnabled();
 }
 
+LAS_DLL int LAS_IsLibSpatialIndexEnabled(void) {
+    return IsLibSpatialIndexEnabled();
+}
+
 LAS_DLL void LASError_Reset(void) {
     if (errors.empty()) return;
     for (std::size_t i=0;i<errors.size();i++) errors.pop();


More information about the Liblas-commits mailing list