Changeset 980:2f216f49da09


Ignore:
Timestamp:
02/20/09 13:49:27 (18 months ago)
Author:
Howard Butler <hobu.inc@…>
Branch:
default
Convert:
svn:1766ff46-f334-0410-ab20-d63176f87757/trunk@1058
Message:

add the ability to check for HAVE_GDAL and HAVE_LIBGEOTIFF at runtime

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • include/liblas/capi/liblas.h

    r977 r980  
    125125 *  @return the version string for this library. 
    126126*/ 
    127 LAS_DLL char* LAS_GetVersion(); 
     127LAS_DLL char* LAS_GetVersion(void); 
     128 
     129LAS_DLL int LAS_IsLibGeoTIFFEnabled(void); 
     130 
     131LAS_DLL int LAS_IsGDALEnabled(void); 
    128132 
    129133/****************************************************************************/ 
  • include/liblas/liblas.hpp

    r929 r980  
    9999} 
    100100 
     101inline bool IsGDALEnabled() 
     102{ 
     103#ifdef HAVE_GDAL 
     104    return true; 
     105#else 
     106    return false; 
     107#endif 
     108} 
     109 
     110inline bool IsLibGeoTIFFEnabled() 
     111{ 
     112#ifdef HAVE_LIBGEOTIFF 
     113    return true; 
     114#else 
     115    return false; 
     116#endif 
     117} 
     118 
    101119} // namespace liblas 
    102120 
  • python/liblas/__init__.py

    r977 r980  
    11from core import * 
    22version = get_version() 
     3HAVE_GDAL = bool(las.LAS_IsGDALEnabled()) 
     4HAVE_LIBGEOTIFF = bool(las.LAS_IsLibGeoTIFFEnabled()) 
     5 
    36import file 
    47import point 
  • python/liblas/core.py

    r977 r980  
    148148version = get_version() 
    149149 
     150las.LAS_IsGDALEnabled.restype = ctypes.c_int 
     151las.LAS_IsLibGeoTIFFEnabled.restype = ctypes.c_int 
     152 
    150153las.LAS_GetVersion.restype = ctypes.POINTER(ctypes.c_char) 
    151154las.LAS_GetVersion.errcheck = free_returned_char_p 
  • python/tests/VLR.txt

    r955 r980  
    5454  [2, 32, 4, 5, 6, 7, 8, 9, 10, 11] 
    5555   
    56      
     56  >>> import liblas 
     57 
     58#  >>> liblas.HAVE_GDAL 
     59#  >>> liblas.HAVE_LIBGEOTIFF 
     60 
    5761  >>> from liblas import file 
    5862  >>> f = file.File('../test/data/srs.las') 
     
    6064  >>> h.records_count 
    6165  3L 
    62   >>> h.proj4 
    63   '+proj=utm +zone=17 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ' 
     66  >>> if not liblas.HAVE_GDAL: 
     67  ...     h.proj4 
     68  '+proj=utm +zone=17 +ellps=WGS84 +units=m ' 
     69 
    6470  >>> v = h.GetVLR(0) 
    6571  >>> v.recordid 
  • src/las_c_api.cpp

    r977 r980  
    4242 ****************************************************************************/ 
    4343 
    44  
     44#include <liblas/liblas.hpp> 
    4545#include <liblas/lasreader.hpp> 
    4646#include <liblas/laserror.hpp> 
     
    126126        return (rc); \ 
    127127   }} while(0) 
     128 
     129LAS_DLL int LAS_IsGDALEnabled(void) { 
     130    return IsGDALEnabled(); 
     131} 
     132 
     133LAS_DLL int LAS_IsLibGeoTIFFEnabled(void) { 
     134    return IsLibGeoTIFFEnabled(); 
     135} 
    128136 
    129137LAS_DLL void LASError_Reset(void) { 
Note: See TracChangeset for help on using the changeset viewer.