diff --git a/Utilities/otbliblas/CPackSourceConfig.cmake b/Utilities/otbliblas/CPackSourceConfig.cmake
old mode 100755
new mode 100644
index 45ed22c374a131335fb86ad2315987099dcbb253..6e679e324b32f4c83bb52361e4dd061b74375c51
--- a/Utilities/otbliblas/CPackSourceConfig.cmake
+++ b/Utilities/otbliblas/CPackSourceConfig.cmake
@@ -44,39 +44,39 @@ SET(CPACK_CMAKE_GENERATOR "Unix Makefiles")
 SET(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "TRUE")
 SET(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "TRUE")
 SET(CPACK_GENERATOR "TGZ;ZIP;TBZ2")
-SET(CPACK_IGNORE_FILES "/test/data/TO_core_last_zoom.las;_CPack_Packages;.gz;.bz2;.zip;.hg;README;HOWTORELEASE.txt;CMakeCache.txt;CPackConfig.cmake;schemas;hobu-config.bat")
-SET(CPACK_INSTALLED_DIRECTORIES "/tmp/liblas-main;/")
+SET(CPACK_IGNORE_FILES "/test/data/TO_core_last_zoom.las;_CPack_Packages;.gz;.bz2;.zip;.hg;README;HOWTORELEASE.txt;doc;CMakeCache.txt;CPackConfig.cmake;schemas;hobu-config.bat;liblas-osgeo4w-init.bat;liblas-osgeo4w-start.bat.tmpl")
+SET(CPACK_INSTALLED_DIRECTORIES "/tmp/liblas;/")
 SET(CPACK_INSTALL_CMAKE_PROJECTS "")
 SET(CPACK_INSTALL_PREFIX "/usr/local")
-SET(CPACK_MODULE_PATH "/tmp/liblas-main/cmake/modules")
-SET(CPACK_NSIS_DISPLAY_NAME "libLAS 1.6.0b1")
+SET(CPACK_MODULE_PATH "/tmp/liblas/cmake/modules")
+SET(CPACK_NSIS_DISPLAY_NAME "libLAS 1.6.0b2")
 SET(CPACK_NSIS_INSTALLER_ICON_CODE "")
 SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
-SET(CPACK_NSIS_PACKAGE_NAME "libLAS 1.6.0b1")
-SET(CPACK_OUTPUT_CONFIG_FILE "/tmp/liblas-main/CPackConfig.cmake")
+SET(CPACK_NSIS_PACKAGE_NAME "libLAS 1.6.0b2")
+SET(CPACK_OUTPUT_CONFIG_FILE "/tmp/liblas/CPackConfig.cmake")
 SET(CPACK_PACKAGE_DEFAULT_LOCATION "/")
 SET(CPACK_PACKAGE_DESCRIPTION_FILE "/Applications/CMake 2.8-0.app/Contents/share/cmake-2.8/Templates/CPack.GenericDescription.txt")
 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "libLAS built using CMake")
-SET(CPACK_PACKAGE_FILE_NAME "libLAS-1.6.0b1")
-SET(CPACK_PACKAGE_INSTALL_DIRECTORY "libLAS 1.6.0b1")
-SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "libLAS 1.6.0b1")
+SET(CPACK_PACKAGE_FILE_NAME "libLAS-1.6.0b2")
+SET(CPACK_PACKAGE_INSTALL_DIRECTORY "libLAS 1.6.0b2")
+SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "libLAS 1.6.0b2")
 SET(CPACK_PACKAGE_NAME "libLAS")
 SET(CPACK_PACKAGE_RELOCATABLE "true")
 SET(CPACK_PACKAGE_VENDOR "Humanity")
-SET(CPACK_PACKAGE_VERSION "1.6.0b1")
+SET(CPACK_PACKAGE_VERSION "1.6.0b2")
 SET(CPACK_PACKAGE_VERSION_MAJOR "1")
 SET(CPACK_PACKAGE_VERSION_MINOR "6")
-SET(CPACK_PACKAGE_VERSION_PATCH "0b1")
+SET(CPACK_PACKAGE_VERSION_PATCH "0b2")
 SET(CPACK_RESOURCE_FILE_LICENSE "/Applications/CMake 2.8-0.app/Contents/share/cmake-2.8/Templates/CPack.GenericLicense.txt")
 SET(CPACK_RESOURCE_FILE_README "/Applications/CMake 2.8-0.app/Contents/share/cmake-2.8/Templates/CPack.GenericDescription.txt")
 SET(CPACK_RESOURCE_FILE_WELCOME "/Applications/CMake 2.8-0.app/Contents/share/cmake-2.8/Templates/CPack.GenericWelcome.txt")
 SET(CPACK_SET_DESTDIR "OFF")
 SET(CPACK_SOURCE_CYGWIN "")
 SET(CPACK_SOURCE_GENERATOR "TGZ;ZIP;TBZ2")
-SET(CPACK_SOURCE_IGNORE_FILES "/test/data/TO_core_last_zoom.las;_CPack_Packages;.gz;.bz2;.zip;.hg;README;HOWTORELEASE.txt;CMakeCache.txt;CPackConfig.cmake;schemas;hobu-config.bat")
-SET(CPACK_SOURCE_INSTALLED_DIRECTORIES "/tmp/liblas-main;/")
-SET(CPACK_SOURCE_OUTPUT_CONFIG_FILE "/tmp/liblas-main/CPackSourceConfig.cmake")
-SET(CPACK_SOURCE_PACKAGE_FILE_NAME "libLAS-1.6.0b1")
+SET(CPACK_SOURCE_IGNORE_FILES "/test/data/TO_core_last_zoom.las;_CPack_Packages;.gz;.bz2;.zip;.hg;README;HOWTORELEASE.txt;doc;CMakeCache.txt;CPackConfig.cmake;schemas;hobu-config.bat;liblas-osgeo4w-init.bat;liblas-osgeo4w-start.bat.tmpl")
+SET(CPACK_SOURCE_INSTALLED_DIRECTORIES "/tmp/liblas;/")
+SET(CPACK_SOURCE_OUTPUT_CONFIG_FILE "/tmp/liblas/CPackSourceConfig.cmake")
+SET(CPACK_SOURCE_PACKAGE_FILE_NAME "libLAS-1.6.0b2")
 SET(CPACK_SOURCE_TBZ2 "")
 SET(CPACK_SOURCE_TGZ "")
 SET(CPACK_SOURCE_TOPLEVEL_TAG "Darwin-Source")
diff --git a/Utilities/otbliblas/CTestConfig.cmake b/Utilities/otbliblas/CTestConfig.cmake
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/CTestTestfile.cmake b/Utilities/otbliblas/CTestTestfile.cmake
old mode 100755
new mode 100644
index a2d20cbc823c61aeeeeac08d54eb66e2d925bbd3..8708911fe2b5305cc4b811688e9a8a1cb057507e
--- a/Utilities/otbliblas/CTestTestfile.cmake
+++ b/Utilities/otbliblas/CTestTestfile.cmake
@@ -1,6 +1,6 @@
 # CMake generated Testfile for 
-# Source directory: /tmp/liblas-main
-# Build directory: /tmp/liblas-main
+# Source directory: /tmp/liblas
+# Build directory: /tmp/liblas
 # 
 # This file includes the relevent testing commands required for 
 # testing this directory and lists subdirectories to be tested as well.
diff --git a/Utilities/otbliblas/Makefile b/Utilities/otbliblas/Makefile
index d58e358d37336e5dac76dac7a45ad45c1f2450e8..13ffa205606b739d898f100e1682f3dda2c26dc5 100755
--- a/Utilities/otbliblas/Makefile
+++ b/Utilities/otbliblas/Makefile
@@ -39,10 +39,10 @@ RM = "/Applications/CMake 2.8-0.app/Contents/bin/cmake" -E remove -f
 CMAKE_EDIT_COMMAND = "/Applications/CMake 2.8-0.app/Contents/bin/ccmake"
 
 # The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /tmp/liblas-main
+CMAKE_SOURCE_DIR = /tmp/liblas
 
 # The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /tmp/liblas-main
+CMAKE_BINARY_DIR = /tmp/liblas
 
 #=============================================================================
 # Targets provided globally by CMake.
@@ -111,7 +111,7 @@ package/fast: package
 # Special rule for the target package_source
 package_source:
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool for source..."
-	"/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackSourceConfig.cmake /tmp/liblas-main/CPackSourceConfig.cmake
+	"/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackSourceConfig.cmake /tmp/liblas/CPackSourceConfig.cmake
 .PHONY : package_source
 
 # Special rule for the target package_source
@@ -140,9 +140,9 @@ test/fast: test
 
 # The main all target
 all: cmake_check_build_system
-	$(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas-main/CMakeFiles /tmp/liblas-main/CMakeFiles/progress.marks
+	$(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas/CMakeFiles /tmp/liblas/CMakeFiles/progress.marks
 	$(MAKE) -f CMakeFiles/Makefile2 all
-	$(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas-main/CMakeFiles 0
+	$(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas/CMakeFiles 0
 .PHONY : all
 
 # The main clean target
@@ -325,6 +325,19 @@ lasmerge/fast:
 	$(MAKE) -f apps/CMakeFiles/lasmerge.dir/build.make apps/CMakeFiles/lasmerge.dir/build
 .PHONY : lasmerge/fast
 
+#=============================================================================
+# Target rules for targets named ts2las
+
+# Build rule for target.
+ts2las: cmake_check_build_system
+	$(MAKE) -f CMakeFiles/Makefile2 ts2las
+.PHONY : ts2las
+
+# fast build rule for target.
+ts2las/fast:
+	$(MAKE) -f apps/CMakeFiles/ts2las.dir/build.make apps/CMakeFiles/ts2las.dir/build
+.PHONY : ts2las/fast
+
 #=============================================================================
 # Target rules for targets named txt2las
 
@@ -378,6 +391,7 @@ help:
 	@echo "... lasinfo"
 	@echo "... lasinfo-old"
 	@echo "... lasmerge"
+	@echo "... ts2las"
 	@echo "... txt2las"
 	@echo "... liblas_test"
 .PHONY : help
diff --git a/Utilities/otbliblas/apps/CMakeLists.txt b/Utilities/otbliblas/apps/CMakeLists.txt
old mode 100755
new mode 100644
index 88a28074b89641c340ced52bce1185b0d6c53d2b..3a5bf774746b2aab5f58fbc16bc358686a427574
--- a/Utilities/otbliblas/apps/CMakeLists.txt
+++ b/Utilities/otbliblas/apps/CMakeLists.txt
@@ -21,15 +21,20 @@ set(LAS2LAS las2las)
 set(LAS2LAS_OLD las2las-old)
 set(LAS2TXT las2txt)
 set(TXT2LAS txt2las)
+set(TS2LAS ts2las)
 set(LASBLOCK lasblock )
 
 set(BIGFILE_TEST bigfile_test)
 set(LASINDEX_TEST lasindex_test)
 
+if(Boost_IOSTREAMS_FOUND)
+  set(BIGFILE_BIO_TEST bigfile_boost_iostreams_test)
+endif()
+
 # Set the build type to release if it is not explicitly set by the user and 
 # isn't in the cache yet
 if (NOT CMAKE_BUILD_TYPE )
-set(CMAKE_BUILD_TYPE "Release")
+  set(CMAKE_BUILD_TYPE "Release")
 endif()
 
 # Utilities depending on 3rd-pary libraries
@@ -43,7 +48,7 @@ endif()
 
 set(LIBLAS_UTILITIES
     ${LASINFO_OLD} ${LASINFO} ${LASMERGE} ${LAS2LAS} ${LAS2TXT} ${TXT2LAS} 
-    ${LAS2OGR}  ${LAS2OCI} ${LAS2LAS} ${LAS2LAS_OLD} ${LASBLOCK} )
+    ${LAS2OGR}  ${LAS2OCI} ${LAS2LAS} ${LAS2LAS_OLD} ${LASBLOCK} ${TS2LAS})
 
 # TODO: Experimental and requires testing --mloskot
 # Generate user-specific settings for Visual Studio project
@@ -62,12 +67,18 @@ endif()
 ###############################################################################
 # Configure build targets
 
+if(WIN32)
+    add_definitions("-DLAS_DLL_EXPORT=1")
+endif()
+
+
 set(APPS_CPP_DEPENDENCIES
     ${LIBLAS_LIB_NAME}
     ${TIFF_LIBRARY}
     ${GEOTIFF_LIBRARY}
     ${GDAL_LIBRARY}
-    ${SPATIALINDEX_LIBRARY})
+    ${SPATIALINDEX_LIBRARY}
+    ${Boost_LIBRARIES})
 
 link_directories(${Boost_LIBRARY_DIRS})
 
@@ -87,12 +98,12 @@ endif()
 
 if(LAS2LAS)
     add_executable(${LAS2LAS} las2las.cpp laskernel.cpp)
-    target_link_libraries(${LAS2LAS} ${APPS_CPP_DEPENDENCIES} ${Boost_LIBRARIES})
+    target_link_libraries(${LAS2LAS} ${APPS_CPP_DEPENDENCIES} )
 endif()
 
 if(LASINFO)
     add_executable(${LASINFO} lasinfo.cpp laskernel.cpp)
-    target_link_libraries(${LASINFO} ${APPS_CPP_DEPENDENCIES} ${Boost_LIBRARIES})
+    target_link_libraries(${LASINFO} ${APPS_CPP_DEPENDENCIES} )
 endif()
 
 # Build las2txt
@@ -109,6 +120,11 @@ if(TXT2LAS)
     target_link_libraries(${TXT2LAS} ${LIBLAS_C_LIB_NAME})
 endif()
 
+if(TS2LAS)
+    add_executable(${TS2LAS} ts2las.cpp )
+    target_link_libraries(${TS2LAS} ${APPS_CPP_DEPENDENCIES} )
+endif()
+
 # Build lasmerge
 if(LASMERGE)
     set(LASMERGE_SRC lascommon.c ${LASMERGE}.c)
@@ -120,7 +136,7 @@ endif()
 if(LASBLOCK)
     set(LASBLOCK_SRC lasblock.cpp chipper.cpp chipper.hpp)
     add_executable(${LASBLOCK} ${LASBLOCK_SRC})
-    target_link_libraries(${LASBLOCK} ${APPS_CPP_DEPENDENCIES} ${Boost_LIBRARIES})
+    target_link_libraries(${LASBLOCK} ${APPS_CPP_DEPENDENCIES} )
 endif()
 
 # Build las2ogr
@@ -132,17 +148,22 @@ endif()
 # Build las2oci
 if(LAS2OCI)
     add_executable(${LAS2OCI} las2oci.cpp oci_wrapper.cpp kdx_util.cpp oci_util.cpp laskernel.cpp chipper.cpp)
-    target_link_libraries(${LAS2OCI} ${APPS_CPP_DEPENDENCIES} ${Boost_LIBRARIES} ${ORACLE_LIBRARY})
+    target_link_libraries(${LAS2OCI} ${APPS_CPP_DEPENDENCIES} ${ORACLE_LIBRARY})
 endif()
 
 if(BIGFILE_TEST)
-    add_executable(${BIGFILE_TEST} bigtest.cpp)
+    add_executable(${BIGFILE_TEST} bigtest.c)
     target_link_libraries(${BIGFILE_TEST} ${LIBLAS_C_LIB_NAME})
 endif()
 
 if (LASINDEX_TEST)
     add_executable(${LASINDEX_TEST} lasindex_test.cpp)
-    target_link_libraries(${LASINDEX_TEST} ${APPS_CPP_DEPENDENCIES} ${Boost_LIBRARIES})    
+    target_link_libraries(${LASINDEX_TEST} ${APPS_CPP_DEPENDENCIES})    
+endif()
+
+if(BIGFILE_BIO_TEST)
+    add_executable(${BIGFILE_BIO_TEST} bigfile_boost_iostreams_test.cpp)
+    target_link_libraries(${BIGFILE_BIO_TEST} ${APPS_CPP_DEPENDENCIES} )    
 endif()
 
 ###############################################################################
diff --git a/Utilities/otbliblas/apps/Makefile b/Utilities/otbliblas/apps/Makefile
index f5ea0053ccf3bc5fc968437f8a2cc8d15b77c3f3..a8cfa8c0714f98dff501d93423a3512f31be790c 100755
--- a/Utilities/otbliblas/apps/Makefile
+++ b/Utilities/otbliblas/apps/Makefile
@@ -39,10 +39,10 @@ RM = "/Applications/CMake 2.8-0.app/Contents/bin/cmake" -E remove -f
 CMAKE_EDIT_COMMAND = "/Applications/CMake 2.8-0.app/Contents/bin/ccmake"
 
 # The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /tmp/liblas-main
+CMAKE_SOURCE_DIR = /tmp/liblas
 
 # The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /tmp/liblas-main
+CMAKE_BINARY_DIR = /tmp/liblas
 
 #=============================================================================
 # Targets provided globally by CMake.
@@ -101,7 +101,7 @@ list_install_components/fast: list_install_components
 # Special rule for the target package
 package: preinstall
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool..."
-	cd /tmp/liblas-main && "/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackConfig.cmake
+	cd /tmp/liblas && "/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackConfig.cmake
 .PHONY : package
 
 # Special rule for the target package
@@ -111,7 +111,7 @@ package/fast: package
 # Special rule for the target package_source
 package_source:
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool for source..."
-	cd /tmp/liblas-main && "/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackSourceConfig.cmake /tmp/liblas-main/CPackSourceConfig.cmake
+	cd /tmp/liblas && "/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackSourceConfig.cmake /tmp/liblas/CPackSourceConfig.cmake
 .PHONY : package_source
 
 # Special rule for the target package_source
@@ -140,14 +140,14 @@ test/fast: test
 
 # The main all target
 all: cmake_check_build_system
-	cd /tmp/liblas-main && $(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas-main/CMakeFiles /tmp/liblas-main/apps/CMakeFiles/progress.marks
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 apps/all
-	$(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas-main/CMakeFiles 0
+	cd /tmp/liblas && $(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas/CMakeFiles /tmp/liblas/apps/CMakeFiles/progress.marks
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 apps/all
+	$(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas/CMakeFiles 0
 .PHONY : all
 
 # The main clean target
 clean:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 apps/clean
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 apps/clean
 .PHONY : clean
 
 # The main clean target
@@ -156,22 +156,22 @@ clean/fast: clean
 
 # Prepare targets for installation.
 preinstall: all
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 apps/preinstall
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 apps/preinstall
 .PHONY : preinstall
 
 # Prepare targets for installation.
 preinstall/fast:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 apps/preinstall
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 apps/preinstall
 .PHONY : preinstall/fast
 
 # clear depends
 depend:
-	cd /tmp/liblas-main && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
+	cd /tmp/liblas && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
 .PHONY : depend
 
 # Convenience name for target.
 apps/CMakeFiles/bigfile_test.dir/rule:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/bigfile_test.dir/rule
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/bigfile_test.dir/rule
 .PHONY : apps/CMakeFiles/bigfile_test.dir/rule
 
 # Convenience name for target.
@@ -180,12 +180,12 @@ bigfile_test: apps/CMakeFiles/bigfile_test.dir/rule
 
 # fast build rule for target.
 bigfile_test/fast:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/bigfile_test.dir/build.make apps/CMakeFiles/bigfile_test.dir/build
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/bigfile_test.dir/build.make apps/CMakeFiles/bigfile_test.dir/build
 .PHONY : bigfile_test/fast
 
 # Convenience name for target.
 apps/CMakeFiles/las2las.dir/rule:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/las2las.dir/rule
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/las2las.dir/rule
 .PHONY : apps/CMakeFiles/las2las.dir/rule
 
 # Convenience name for target.
@@ -194,12 +194,12 @@ las2las: apps/CMakeFiles/las2las.dir/rule
 
 # fast build rule for target.
 las2las/fast:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2las.dir/build.make apps/CMakeFiles/las2las.dir/build
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2las.dir/build.make apps/CMakeFiles/las2las.dir/build
 .PHONY : las2las/fast
 
 # Convenience name for target.
 apps/CMakeFiles/las2las-old.dir/rule:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/las2las-old.dir/rule
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/las2las-old.dir/rule
 .PHONY : apps/CMakeFiles/las2las-old.dir/rule
 
 # Convenience name for target.
@@ -208,12 +208,12 @@ las2las-old: apps/CMakeFiles/las2las-old.dir/rule
 
 # fast build rule for target.
 las2las-old/fast:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2las-old.dir/build.make apps/CMakeFiles/las2las-old.dir/build
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2las-old.dir/build.make apps/CMakeFiles/las2las-old.dir/build
 .PHONY : las2las-old/fast
 
 # Convenience name for target.
 apps/CMakeFiles/las2txt.dir/rule:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/las2txt.dir/rule
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/las2txt.dir/rule
 .PHONY : apps/CMakeFiles/las2txt.dir/rule
 
 # Convenience name for target.
@@ -222,12 +222,12 @@ las2txt: apps/CMakeFiles/las2txt.dir/rule
 
 # fast build rule for target.
 las2txt/fast:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2txt.dir/build.make apps/CMakeFiles/las2txt.dir/build
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2txt.dir/build.make apps/CMakeFiles/las2txt.dir/build
 .PHONY : las2txt/fast
 
 # Convenience name for target.
 apps/CMakeFiles/lasblock.dir/rule:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/lasblock.dir/rule
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/lasblock.dir/rule
 .PHONY : apps/CMakeFiles/lasblock.dir/rule
 
 # Convenience name for target.
@@ -236,12 +236,12 @@ lasblock: apps/CMakeFiles/lasblock.dir/rule
 
 # fast build rule for target.
 lasblock/fast:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasblock.dir/build.make apps/CMakeFiles/lasblock.dir/build
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasblock.dir/build.make apps/CMakeFiles/lasblock.dir/build
 .PHONY : lasblock/fast
 
 # Convenience name for target.
 apps/CMakeFiles/lasindex_test.dir/rule:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/lasindex_test.dir/rule
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/lasindex_test.dir/rule
 .PHONY : apps/CMakeFiles/lasindex_test.dir/rule
 
 # Convenience name for target.
@@ -250,12 +250,12 @@ lasindex_test: apps/CMakeFiles/lasindex_test.dir/rule
 
 # fast build rule for target.
 lasindex_test/fast:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasindex_test.dir/build.make apps/CMakeFiles/lasindex_test.dir/build
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasindex_test.dir/build.make apps/CMakeFiles/lasindex_test.dir/build
 .PHONY : lasindex_test/fast
 
 # Convenience name for target.
 apps/CMakeFiles/lasinfo.dir/rule:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/lasinfo.dir/rule
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/lasinfo.dir/rule
 .PHONY : apps/CMakeFiles/lasinfo.dir/rule
 
 # Convenience name for target.
@@ -264,12 +264,12 @@ lasinfo: apps/CMakeFiles/lasinfo.dir/rule
 
 # fast build rule for target.
 lasinfo/fast:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasinfo.dir/build.make apps/CMakeFiles/lasinfo.dir/build
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasinfo.dir/build.make apps/CMakeFiles/lasinfo.dir/build
 .PHONY : lasinfo/fast
 
 # Convenience name for target.
 apps/CMakeFiles/lasinfo-old.dir/rule:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/lasinfo-old.dir/rule
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/lasinfo-old.dir/rule
 .PHONY : apps/CMakeFiles/lasinfo-old.dir/rule
 
 # Convenience name for target.
@@ -278,12 +278,12 @@ lasinfo-old: apps/CMakeFiles/lasinfo-old.dir/rule
 
 # fast build rule for target.
 lasinfo-old/fast:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasinfo-old.dir/build.make apps/CMakeFiles/lasinfo-old.dir/build
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasinfo-old.dir/build.make apps/CMakeFiles/lasinfo-old.dir/build
 .PHONY : lasinfo-old/fast
 
 # Convenience name for target.
 apps/CMakeFiles/lasmerge.dir/rule:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/lasmerge.dir/rule
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/lasmerge.dir/rule
 .PHONY : apps/CMakeFiles/lasmerge.dir/rule
 
 # Convenience name for target.
@@ -292,12 +292,26 @@ lasmerge: apps/CMakeFiles/lasmerge.dir/rule
 
 # fast build rule for target.
 lasmerge/fast:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasmerge.dir/build.make apps/CMakeFiles/lasmerge.dir/build
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasmerge.dir/build.make apps/CMakeFiles/lasmerge.dir/build
 .PHONY : lasmerge/fast
 
+# Convenience name for target.
+apps/CMakeFiles/ts2las.dir/rule:
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/ts2las.dir/rule
+.PHONY : apps/CMakeFiles/ts2las.dir/rule
+
+# Convenience name for target.
+ts2las: apps/CMakeFiles/ts2las.dir/rule
+.PHONY : ts2las
+
+# fast build rule for target.
+ts2las/fast:
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/ts2las.dir/build.make apps/CMakeFiles/ts2las.dir/build
+.PHONY : ts2las/fast
+
 # Convenience name for target.
 apps/CMakeFiles/txt2las.dir/rule:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/txt2las.dir/rule
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 apps/CMakeFiles/txt2las.dir/rule
 .PHONY : apps/CMakeFiles/txt2las.dir/rule
 
 # Convenience name for target.
@@ -306,39 +320,39 @@ txt2las: apps/CMakeFiles/txt2las.dir/rule
 
 # fast build rule for target.
 txt2las/fast:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/txt2las.dir/build.make apps/CMakeFiles/txt2las.dir/build
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/txt2las.dir/build.make apps/CMakeFiles/txt2las.dir/build
 .PHONY : txt2las/fast
 
-bigtest.o: bigtest.cpp.o
+bigtest.o: bigtest.c.o
 .PHONY : bigtest.o
 
 # target to build an object file
-bigtest.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/bigfile_test.dir/build.make apps/CMakeFiles/bigfile_test.dir/bigtest.cpp.o
-.PHONY : bigtest.cpp.o
+bigtest.c.o:
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/bigfile_test.dir/build.make apps/CMakeFiles/bigfile_test.dir/bigtest.c.o
+.PHONY : bigtest.c.o
 
-bigtest.i: bigtest.cpp.i
+bigtest.i: bigtest.c.i
 .PHONY : bigtest.i
 
 # target to preprocess a source file
-bigtest.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/bigfile_test.dir/build.make apps/CMakeFiles/bigfile_test.dir/bigtest.cpp.i
-.PHONY : bigtest.cpp.i
+bigtest.c.i:
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/bigfile_test.dir/build.make apps/CMakeFiles/bigfile_test.dir/bigtest.c.i
+.PHONY : bigtest.c.i
 
-bigtest.s: bigtest.cpp.s
+bigtest.s: bigtest.c.s
 .PHONY : bigtest.s
 
 # target to generate assembly for a file
-bigtest.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/bigfile_test.dir/build.make apps/CMakeFiles/bigfile_test.dir/bigtest.cpp.s
-.PHONY : bigtest.cpp.s
+bigtest.c.s:
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/bigfile_test.dir/build.make apps/CMakeFiles/bigfile_test.dir/bigtest.c.s
+.PHONY : bigtest.c.s
 
 chipper.o: chipper.cpp.o
 .PHONY : chipper.o
 
 # target to build an object file
 chipper.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasblock.dir/build.make apps/CMakeFiles/lasblock.dir/chipper.cpp.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasblock.dir/build.make apps/CMakeFiles/lasblock.dir/chipper.cpp.o
 .PHONY : chipper.cpp.o
 
 chipper.i: chipper.cpp.i
@@ -346,7 +360,7 @@ chipper.i: chipper.cpp.i
 
 # target to preprocess a source file
 chipper.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasblock.dir/build.make apps/CMakeFiles/lasblock.dir/chipper.cpp.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasblock.dir/build.make apps/CMakeFiles/lasblock.dir/chipper.cpp.i
 .PHONY : chipper.cpp.i
 
 chipper.s: chipper.cpp.s
@@ -354,7 +368,7 @@ chipper.s: chipper.cpp.s
 
 # target to generate assembly for a file
 chipper.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasblock.dir/build.make apps/CMakeFiles/lasblock.dir/chipper.cpp.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasblock.dir/build.make apps/CMakeFiles/lasblock.dir/chipper.cpp.s
 .PHONY : chipper.cpp.s
 
 las2las-old.o: las2las-old.c.o
@@ -362,7 +376,7 @@ las2las-old.o: las2las-old.c.o
 
 # target to build an object file
 las2las-old.c.o:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2las-old.dir/build.make apps/CMakeFiles/las2las-old.dir/las2las-old.c.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2las-old.dir/build.make apps/CMakeFiles/las2las-old.dir/las2las-old.c.o
 .PHONY : las2las-old.c.o
 
 las2las-old.i: las2las-old.c.i
@@ -370,7 +384,7 @@ las2las-old.i: las2las-old.c.i
 
 # target to preprocess a source file
 las2las-old.c.i:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2las-old.dir/build.make apps/CMakeFiles/las2las-old.dir/las2las-old.c.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2las-old.dir/build.make apps/CMakeFiles/las2las-old.dir/las2las-old.c.i
 .PHONY : las2las-old.c.i
 
 las2las-old.s: las2las-old.c.s
@@ -378,7 +392,7 @@ las2las-old.s: las2las-old.c.s
 
 # target to generate assembly for a file
 las2las-old.c.s:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2las-old.dir/build.make apps/CMakeFiles/las2las-old.dir/las2las-old.c.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2las-old.dir/build.make apps/CMakeFiles/las2las-old.dir/las2las-old.c.s
 .PHONY : las2las-old.c.s
 
 las2las.o: las2las.cpp.o
@@ -386,7 +400,7 @@ las2las.o: las2las.cpp.o
 
 # target to build an object file
 las2las.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2las.dir/build.make apps/CMakeFiles/las2las.dir/las2las.cpp.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2las.dir/build.make apps/CMakeFiles/las2las.dir/las2las.cpp.o
 .PHONY : las2las.cpp.o
 
 las2las.i: las2las.cpp.i
@@ -394,7 +408,7 @@ las2las.i: las2las.cpp.i
 
 # target to preprocess a source file
 las2las.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2las.dir/build.make apps/CMakeFiles/las2las.dir/las2las.cpp.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2las.dir/build.make apps/CMakeFiles/las2las.dir/las2las.cpp.i
 .PHONY : las2las.cpp.i
 
 las2las.s: las2las.cpp.s
@@ -402,7 +416,7 @@ las2las.s: las2las.cpp.s
 
 # target to generate assembly for a file
 las2las.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2las.dir/build.make apps/CMakeFiles/las2las.dir/las2las.cpp.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2las.dir/build.make apps/CMakeFiles/las2las.dir/las2las.cpp.s
 .PHONY : las2las.cpp.s
 
 las2txt.o: las2txt.c.o
@@ -410,7 +424,7 @@ las2txt.o: las2txt.c.o
 
 # target to build an object file
 las2txt.c.o:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2txt.dir/build.make apps/CMakeFiles/las2txt.dir/las2txt.c.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2txt.dir/build.make apps/CMakeFiles/las2txt.dir/las2txt.c.o
 .PHONY : las2txt.c.o
 
 las2txt.i: las2txt.c.i
@@ -418,7 +432,7 @@ las2txt.i: las2txt.c.i
 
 # target to preprocess a source file
 las2txt.c.i:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2txt.dir/build.make apps/CMakeFiles/las2txt.dir/las2txt.c.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2txt.dir/build.make apps/CMakeFiles/las2txt.dir/las2txt.c.i
 .PHONY : las2txt.c.i
 
 las2txt.s: las2txt.c.s
@@ -426,7 +440,7 @@ las2txt.s: las2txt.c.s
 
 # target to generate assembly for a file
 las2txt.c.s:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2txt.dir/build.make apps/CMakeFiles/las2txt.dir/las2txt.c.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2txt.dir/build.make apps/CMakeFiles/las2txt.dir/las2txt.c.s
 .PHONY : las2txt.c.s
 
 lasblock.o: lasblock.cpp.o
@@ -434,7 +448,7 @@ lasblock.o: lasblock.cpp.o
 
 # target to build an object file
 lasblock.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasblock.dir/build.make apps/CMakeFiles/lasblock.dir/lasblock.cpp.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasblock.dir/build.make apps/CMakeFiles/lasblock.dir/lasblock.cpp.o
 .PHONY : lasblock.cpp.o
 
 lasblock.i: lasblock.cpp.i
@@ -442,7 +456,7 @@ lasblock.i: lasblock.cpp.i
 
 # target to preprocess a source file
 lasblock.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasblock.dir/build.make apps/CMakeFiles/lasblock.dir/lasblock.cpp.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasblock.dir/build.make apps/CMakeFiles/lasblock.dir/lasblock.cpp.i
 .PHONY : lasblock.cpp.i
 
 lasblock.s: lasblock.cpp.s
@@ -450,7 +464,7 @@ lasblock.s: lasblock.cpp.s
 
 # target to generate assembly for a file
 lasblock.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasblock.dir/build.make apps/CMakeFiles/lasblock.dir/lasblock.cpp.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasblock.dir/build.make apps/CMakeFiles/lasblock.dir/lasblock.cpp.s
 .PHONY : lasblock.cpp.s
 
 lascommon.o: lascommon.c.o
@@ -458,11 +472,11 @@ lascommon.o: lascommon.c.o
 
 # target to build an object file
 lascommon.c.o:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2las-old.dir/build.make apps/CMakeFiles/las2las-old.dir/lascommon.c.o
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2txt.dir/build.make apps/CMakeFiles/las2txt.dir/lascommon.c.o
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasinfo-old.dir/build.make apps/CMakeFiles/lasinfo-old.dir/lascommon.c.o
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasmerge.dir/build.make apps/CMakeFiles/lasmerge.dir/lascommon.c.o
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/txt2las.dir/build.make apps/CMakeFiles/txt2las.dir/lascommon.c.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2las-old.dir/build.make apps/CMakeFiles/las2las-old.dir/lascommon.c.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2txt.dir/build.make apps/CMakeFiles/las2txt.dir/lascommon.c.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasinfo-old.dir/build.make apps/CMakeFiles/lasinfo-old.dir/lascommon.c.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasmerge.dir/build.make apps/CMakeFiles/lasmerge.dir/lascommon.c.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/txt2las.dir/build.make apps/CMakeFiles/txt2las.dir/lascommon.c.o
 .PHONY : lascommon.c.o
 
 lascommon.i: lascommon.c.i
@@ -470,11 +484,11 @@ lascommon.i: lascommon.c.i
 
 # target to preprocess a source file
 lascommon.c.i:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2las-old.dir/build.make apps/CMakeFiles/las2las-old.dir/lascommon.c.i
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2txt.dir/build.make apps/CMakeFiles/las2txt.dir/lascommon.c.i
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasinfo-old.dir/build.make apps/CMakeFiles/lasinfo-old.dir/lascommon.c.i
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasmerge.dir/build.make apps/CMakeFiles/lasmerge.dir/lascommon.c.i
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/txt2las.dir/build.make apps/CMakeFiles/txt2las.dir/lascommon.c.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2las-old.dir/build.make apps/CMakeFiles/las2las-old.dir/lascommon.c.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2txt.dir/build.make apps/CMakeFiles/las2txt.dir/lascommon.c.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasinfo-old.dir/build.make apps/CMakeFiles/lasinfo-old.dir/lascommon.c.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasmerge.dir/build.make apps/CMakeFiles/lasmerge.dir/lascommon.c.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/txt2las.dir/build.make apps/CMakeFiles/txt2las.dir/lascommon.c.i
 .PHONY : lascommon.c.i
 
 lascommon.s: lascommon.c.s
@@ -482,11 +496,11 @@ lascommon.s: lascommon.c.s
 
 # target to generate assembly for a file
 lascommon.c.s:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2las-old.dir/build.make apps/CMakeFiles/las2las-old.dir/lascommon.c.s
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2txt.dir/build.make apps/CMakeFiles/las2txt.dir/lascommon.c.s
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasinfo-old.dir/build.make apps/CMakeFiles/lasinfo-old.dir/lascommon.c.s
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasmerge.dir/build.make apps/CMakeFiles/lasmerge.dir/lascommon.c.s
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/txt2las.dir/build.make apps/CMakeFiles/txt2las.dir/lascommon.c.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2las-old.dir/build.make apps/CMakeFiles/las2las-old.dir/lascommon.c.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2txt.dir/build.make apps/CMakeFiles/las2txt.dir/lascommon.c.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasinfo-old.dir/build.make apps/CMakeFiles/lasinfo-old.dir/lascommon.c.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasmerge.dir/build.make apps/CMakeFiles/lasmerge.dir/lascommon.c.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/txt2las.dir/build.make apps/CMakeFiles/txt2las.dir/lascommon.c.s
 .PHONY : lascommon.c.s
 
 lasindex_test.o: lasindex_test.cpp.o
@@ -494,7 +508,7 @@ lasindex_test.o: lasindex_test.cpp.o
 
 # target to build an object file
 lasindex_test.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasindex_test.dir/build.make apps/CMakeFiles/lasindex_test.dir/lasindex_test.cpp.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasindex_test.dir/build.make apps/CMakeFiles/lasindex_test.dir/lasindex_test.cpp.o
 .PHONY : lasindex_test.cpp.o
 
 lasindex_test.i: lasindex_test.cpp.i
@@ -502,7 +516,7 @@ lasindex_test.i: lasindex_test.cpp.i
 
 # target to preprocess a source file
 lasindex_test.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasindex_test.dir/build.make apps/CMakeFiles/lasindex_test.dir/lasindex_test.cpp.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasindex_test.dir/build.make apps/CMakeFiles/lasindex_test.dir/lasindex_test.cpp.i
 .PHONY : lasindex_test.cpp.i
 
 lasindex_test.s: lasindex_test.cpp.s
@@ -510,7 +524,7 @@ lasindex_test.s: lasindex_test.cpp.s
 
 # target to generate assembly for a file
 lasindex_test.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasindex_test.dir/build.make apps/CMakeFiles/lasindex_test.dir/lasindex_test.cpp.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasindex_test.dir/build.make apps/CMakeFiles/lasindex_test.dir/lasindex_test.cpp.s
 .PHONY : lasindex_test.cpp.s
 
 lasinfo-old.o: lasinfo-old.c.o
@@ -518,7 +532,7 @@ lasinfo-old.o: lasinfo-old.c.o
 
 # target to build an object file
 lasinfo-old.c.o:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasinfo-old.dir/build.make apps/CMakeFiles/lasinfo-old.dir/lasinfo-old.c.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasinfo-old.dir/build.make apps/CMakeFiles/lasinfo-old.dir/lasinfo-old.c.o
 .PHONY : lasinfo-old.c.o
 
 lasinfo-old.i: lasinfo-old.c.i
@@ -526,7 +540,7 @@ lasinfo-old.i: lasinfo-old.c.i
 
 # target to preprocess a source file
 lasinfo-old.c.i:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasinfo-old.dir/build.make apps/CMakeFiles/lasinfo-old.dir/lasinfo-old.c.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasinfo-old.dir/build.make apps/CMakeFiles/lasinfo-old.dir/lasinfo-old.c.i
 .PHONY : lasinfo-old.c.i
 
 lasinfo-old.s: lasinfo-old.c.s
@@ -534,7 +548,7 @@ lasinfo-old.s: lasinfo-old.c.s
 
 # target to generate assembly for a file
 lasinfo-old.c.s:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasinfo-old.dir/build.make apps/CMakeFiles/lasinfo-old.dir/lasinfo-old.c.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasinfo-old.dir/build.make apps/CMakeFiles/lasinfo-old.dir/lasinfo-old.c.s
 .PHONY : lasinfo-old.c.s
 
 lasinfo.o: lasinfo.cpp.o
@@ -542,7 +556,7 @@ lasinfo.o: lasinfo.cpp.o
 
 # target to build an object file
 lasinfo.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasinfo.dir/build.make apps/CMakeFiles/lasinfo.dir/lasinfo.cpp.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasinfo.dir/build.make apps/CMakeFiles/lasinfo.dir/lasinfo.cpp.o
 .PHONY : lasinfo.cpp.o
 
 lasinfo.i: lasinfo.cpp.i
@@ -550,7 +564,7 @@ lasinfo.i: lasinfo.cpp.i
 
 # target to preprocess a source file
 lasinfo.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasinfo.dir/build.make apps/CMakeFiles/lasinfo.dir/lasinfo.cpp.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasinfo.dir/build.make apps/CMakeFiles/lasinfo.dir/lasinfo.cpp.i
 .PHONY : lasinfo.cpp.i
 
 lasinfo.s: lasinfo.cpp.s
@@ -558,7 +572,7 @@ lasinfo.s: lasinfo.cpp.s
 
 # target to generate assembly for a file
 lasinfo.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasinfo.dir/build.make apps/CMakeFiles/lasinfo.dir/lasinfo.cpp.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasinfo.dir/build.make apps/CMakeFiles/lasinfo.dir/lasinfo.cpp.s
 .PHONY : lasinfo.cpp.s
 
 laskernel.o: laskernel.cpp.o
@@ -566,8 +580,8 @@ laskernel.o: laskernel.cpp.o
 
 # target to build an object file
 laskernel.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2las.dir/build.make apps/CMakeFiles/las2las.dir/laskernel.cpp.o
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasinfo.dir/build.make apps/CMakeFiles/lasinfo.dir/laskernel.cpp.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2las.dir/build.make apps/CMakeFiles/las2las.dir/laskernel.cpp.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasinfo.dir/build.make apps/CMakeFiles/lasinfo.dir/laskernel.cpp.o
 .PHONY : laskernel.cpp.o
 
 laskernel.i: laskernel.cpp.i
@@ -575,8 +589,8 @@ laskernel.i: laskernel.cpp.i
 
 # target to preprocess a source file
 laskernel.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2las.dir/build.make apps/CMakeFiles/las2las.dir/laskernel.cpp.i
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasinfo.dir/build.make apps/CMakeFiles/lasinfo.dir/laskernel.cpp.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2las.dir/build.make apps/CMakeFiles/las2las.dir/laskernel.cpp.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasinfo.dir/build.make apps/CMakeFiles/lasinfo.dir/laskernel.cpp.i
 .PHONY : laskernel.cpp.i
 
 laskernel.s: laskernel.cpp.s
@@ -584,8 +598,8 @@ laskernel.s: laskernel.cpp.s
 
 # target to generate assembly for a file
 laskernel.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/las2las.dir/build.make apps/CMakeFiles/las2las.dir/laskernel.cpp.s
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasinfo.dir/build.make apps/CMakeFiles/lasinfo.dir/laskernel.cpp.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/las2las.dir/build.make apps/CMakeFiles/las2las.dir/laskernel.cpp.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasinfo.dir/build.make apps/CMakeFiles/lasinfo.dir/laskernel.cpp.s
 .PHONY : laskernel.cpp.s
 
 lasmerge.o: lasmerge.c.o
@@ -593,7 +607,7 @@ lasmerge.o: lasmerge.c.o
 
 # target to build an object file
 lasmerge.c.o:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasmerge.dir/build.make apps/CMakeFiles/lasmerge.dir/lasmerge.c.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasmerge.dir/build.make apps/CMakeFiles/lasmerge.dir/lasmerge.c.o
 .PHONY : lasmerge.c.o
 
 lasmerge.i: lasmerge.c.i
@@ -601,7 +615,7 @@ lasmerge.i: lasmerge.c.i
 
 # target to preprocess a source file
 lasmerge.c.i:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasmerge.dir/build.make apps/CMakeFiles/lasmerge.dir/lasmerge.c.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasmerge.dir/build.make apps/CMakeFiles/lasmerge.dir/lasmerge.c.i
 .PHONY : lasmerge.c.i
 
 lasmerge.s: lasmerge.c.s
@@ -609,15 +623,39 @@ lasmerge.s: lasmerge.c.s
 
 # target to generate assembly for a file
 lasmerge.c.s:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/lasmerge.dir/build.make apps/CMakeFiles/lasmerge.dir/lasmerge.c.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/lasmerge.dir/build.make apps/CMakeFiles/lasmerge.dir/lasmerge.c.s
 .PHONY : lasmerge.c.s
 
+ts2las.o: ts2las.cpp.o
+.PHONY : ts2las.o
+
+# target to build an object file
+ts2las.cpp.o:
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/ts2las.dir/build.make apps/CMakeFiles/ts2las.dir/ts2las.cpp.o
+.PHONY : ts2las.cpp.o
+
+ts2las.i: ts2las.cpp.i
+.PHONY : ts2las.i
+
+# target to preprocess a source file
+ts2las.cpp.i:
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/ts2las.dir/build.make apps/CMakeFiles/ts2las.dir/ts2las.cpp.i
+.PHONY : ts2las.cpp.i
+
+ts2las.s: ts2las.cpp.s
+.PHONY : ts2las.s
+
+# target to generate assembly for a file
+ts2las.cpp.s:
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/ts2las.dir/build.make apps/CMakeFiles/ts2las.dir/ts2las.cpp.s
+.PHONY : ts2las.cpp.s
+
 txt2las.o: txt2las.c.o
 .PHONY : txt2las.o
 
 # target to build an object file
 txt2las.c.o:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/txt2las.dir/build.make apps/CMakeFiles/txt2las.dir/txt2las.c.o
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/txt2las.dir/build.make apps/CMakeFiles/txt2las.dir/txt2las.c.o
 .PHONY : txt2las.c.o
 
 txt2las.i: txt2las.c.i
@@ -625,7 +663,7 @@ txt2las.i: txt2las.c.i
 
 # target to preprocess a source file
 txt2las.c.i:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/txt2las.dir/build.make apps/CMakeFiles/txt2las.dir/txt2las.c.i
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/txt2las.dir/build.make apps/CMakeFiles/txt2las.dir/txt2las.c.i
 .PHONY : txt2las.c.i
 
 txt2las.s: txt2las.c.s
@@ -633,7 +671,7 @@ txt2las.s: txt2las.c.s
 
 # target to generate assembly for a file
 txt2las.c.s:
-	cd /tmp/liblas-main && $(MAKE) -f apps/CMakeFiles/txt2las.dir/build.make apps/CMakeFiles/txt2las.dir/txt2las.c.s
+	cd /tmp/liblas && $(MAKE) -f apps/CMakeFiles/txt2las.dir/build.make apps/CMakeFiles/txt2las.dir/txt2las.c.s
 .PHONY : txt2las.c.s
 
 # Help Target
@@ -660,6 +698,7 @@ help:
 	@echo "... package_source"
 	@echo "... rebuild_cache"
 	@echo "... test"
+	@echo "... ts2las"
 	@echo "... txt2las"
 	@echo "... bigtest.o"
 	@echo "... bigtest.i"
@@ -697,6 +736,9 @@ help:
 	@echo "... lasmerge.o"
 	@echo "... lasmerge.i"
 	@echo "... lasmerge.s"
+	@echo "... ts2las.o"
+	@echo "... ts2las.i"
+	@echo "... ts2las.s"
 	@echo "... txt2las.o"
 	@echo "... txt2las.i"
 	@echo "... txt2las.s"
@@ -711,6 +753,6 @@ help:
 # No rule that depends on this can have commands that come from listfiles
 # because they might be regenerated.
 cmake_check_build_system:
-	cd /tmp/liblas-main && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
+	cd /tmp/liblas && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
 .PHONY : cmake_check_build_system
 
diff --git a/Utilities/otbliblas/apps/bigfile_boost_iostreams_test.cpp b/Utilities/otbliblas/apps/bigfile_boost_iostreams_test.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e17b6e1cf214f9eb7ec59b533c02cb0db17dc412
--- /dev/null
+++ b/Utilities/otbliblas/apps/bigfile_boost_iostreams_test.cpp
@@ -0,0 +1,141 @@
+/******************************************************************************
+ *
+ * Project:  libLAS - http://liblas.org - A BSD library for LAS format data.
+ * Purpose:  Test reading and writing of large LAS files (>4GB)
+ *           using portable Boost.IOStreams library.
+ * Author:   Mateusz Loskot, mateusz@loskot.net
+ *
+ ******************************************************************************
+ * Copyright (c) 2010, Mateusz Loskot
+ *
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following 
+ * conditions are met:
+ * 
+ *     * Redistributions of source code must retain the above copyright 
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright 
+ *       notice, this list of conditions and the following disclaimer in 
+ *       the documentation and/or other materials provided 
+ *       with the distribution.
+ *     * Neither the name of the Martin Isenburg or Iowa Department 
+ *       of Natural Resources nor the names of its contributors may be 
+ *       used to endorse or promote products derived from this software 
+ *       without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
+ * OF SUCH DAMAGE.
+ ****************************************************************************/
+#include <liblas/laspoint.hpp>
+#include <liblas/lasreader.hpp>
+#include <liblas/laswriter.hpp>
+#ifdef _MSC_VER
+#  pragma warning(push)
+#  pragma warning(disable: 4702)
+#endif
+#include <boost/iostreams/device/file_descriptor.hpp>
+#include <boost/iostreams/positioning.hpp>
+#include <boost/iostreams/stream.hpp>
+#ifdef _MSC_VER
+#  pragma warning(pop)
+#endif()
+#include <cassert>
+#include <exception>
+#include <iostream>
+#include <sstream>
+#include <stdexcept>
+
+namespace bio = boost::iostreams;
+namespace las = liblas;
+
+int main()
+{
+    try
+    {
+        // name of generated file
+        std::string filename("bigfile_bio_test.las");
+        // test writing mor than 204 million points
+        bio::stream_offset const n_million_points = 210;
+        bio::stream_offset const point_count = 1024 * 1024 * n_million_points;
+
+        std::cout.setf(std::ios::fixed, std::ios::floatfield);
+        std::cout.setf(std::ios::showpoint);
+        std::cout.precision(2);
+
+        std::cout << "LAS file: " << filename << std::endl;
+        std::cout << "Writing " << point_count << " points" << std::endl;
+        {
+            typedef bio::stream<bio::file_descriptor_sink> bio_ostream;
+            bio_ostream bigofs(filename);
+            las::Header header;
+            las::Writer writer(bigofs, header);
+
+            las::Point empty_point;
+            bio::stream_offset i = 0;
+            for (i = 0; i < point_count; ++i)
+            {
+                if (!writer.WritePoint(empty_point))
+                {
+                    std::ostringstream oss;
+                    oss << "failed to write point #" << i;
+                    throw std::runtime_error(oss.str());
+                }
+
+                if (i % 1000 == 0)
+                {
+                    std::cout << "\b\b\b\b\b\b\b\b" << double(i)/point_count * 100.0;
+                }
+            }
+            assert(i == point_count);
+        }
+
+        std::cout << std::endl << "Reading " << point_count << " points" << std::endl;
+        {
+            typedef bio::stream<bio::file_descriptor_source> bio_istream;
+            bio_istream bigifs(filename); 
+            las::Reader reader(bigifs);
+    
+            bio::stream_offset i = 0;
+            while (reader.ReadNextPoint())
+            {
+                las::Point const& p = reader.GetPoint();
+
+                if (!p.Validate())
+                {
+                    std::ostringstream oss;
+                    oss << "invalid point around #" << i;
+                    throw std::runtime_error(oss.str());
+                }
+
+                if (i % 1000 == 0)
+                {
+                    std::cout << "\b\b\b\b\b\b\b\b" << double(i)/point_count * 100.0;
+                }
+                ++i;
+            }
+            assert(i == point_count);
+        }
+
+        std::cout << std::endl << "Done." << std::endl;
+
+        return EXIT_SUCCESS;
+    }
+    catch (std::exception const& e)
+    {
+        std::cerr << e.what() << std::endl;
+    }
+ 
+    return EXIT_FAILURE;
+}
diff --git a/Utilities/otbliblas/apps/bigtest.c b/Utilities/otbliblas/apps/bigtest.c
new file mode 100755
index 0000000000000000000000000000000000000000..7a0ab00a1745dbd090449d654984f3302ac3dcf1
--- /dev/null
+++ b/Utilities/otbliblas/apps/bigtest.c
@@ -0,0 +1,58 @@
+#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;
+    LASPointH pt = 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 unsigned long nMillionPoints = 205;
+    const unsigned long NPOINTS = 1024*1024*nMillionPoints ;
+    const char * OutputName = "Issue147.las";
+    unsigned long i = 0;
+    unsigned long npoints = 0;
+
+    // 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 (i = 0; i < NPOINTS; i++)
+    {
+      if (i % 1000 == 0)
+         printf("\b\b\b\b\b\b\b%6.2f%%", ((double)i)/NPOINTS * 100.0);
+      
+      pt = LASPoint_Create();
+      err = LASPoint_SetX(pt, 0);
+      if (err) printf ("For point %lu, failed to set point value X\n", i);
+      err = LASPoint_SetY(pt, 0);
+      if (err) printf ("For point %lu, failed to set point value Y\n", i);
+      err = LASPoint_SetZ(pt, 0);
+      if (err) printf ("For point %lu, failed to set point value Z\n", i);
+      err = LASWriter_WritePoint(writer, pt);  
+      if (err) printf ("For point %lu, 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);
+    npoints = LASHeader_GetPointRecordsCount(header);
+    printf ("\n\nWrote %lu, Read %lu (testing %lu Million (1024 x 1024) Points)\n", NPOINTS, npoints, nMillionPoints);
+}
diff --git a/Utilities/otbliblas/apps/cmake_install.cmake b/Utilities/otbliblas/apps/cmake_install.cmake
old mode 100755
new mode 100644
index e31a9367bc72c5fa8bf3c31eadf9dbb921c5ea71..b7f9f2a72c77a01c2c7cf10e8317e122134be293
--- a/Utilities/otbliblas/apps/cmake_install.cmake
+++ b/Utilities/otbliblas/apps/cmake_install.cmake
@@ -1,4 +1,4 @@
-# Install script for directory: /tmp/liblas-main/apps
+# Install script for directory: /tmp/liblas/apps
 
 # Set the install prefix
 IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
@@ -28,10 +28,11 @@ IF(NOT CMAKE_INSTALL_COMPONENT)
 ENDIF(NOT CMAKE_INSTALL_COMPONENT)
 
 IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas-main/bin/lasinfo-old")
+  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas/bin/lasinfo-old")
   IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/lasinfo-old")
     EXECUTE_PROCESS(COMMAND "/usr/bin/install_name_tool"
-      -change "/tmp/liblas-main/bin/liblas_c.dylib" "/usr/local/lib/liblas_c.dylib"
+      -change "/tmp/liblas/bin/liblas.dylib" "liblas.dylib"
+      -change "/tmp/liblas/bin/liblas_c.dylib" "/usr/local/lib/liblas_c.dylib"
       "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/lasinfo-old")
     IF(CMAKE_INSTALL_DO_STRIP)
       EXECUTE_PROCESS(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/lasinfo-old")
@@ -40,8 +41,11 @@ IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspeci
 ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
 
 IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas-main/bin/lasinfo")
+  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas/bin/lasinfo")
   IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/lasinfo")
+    EXECUTE_PROCESS(COMMAND "/usr/bin/install_name_tool"
+      -change "/tmp/liblas/bin/liblas.dylib" "liblas.dylib"
+      "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/lasinfo")
     IF(CMAKE_INSTALL_DO_STRIP)
       EXECUTE_PROCESS(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/lasinfo")
     ENDIF(CMAKE_INSTALL_DO_STRIP)
@@ -49,10 +53,11 @@ IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspeci
 ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
 
 IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas-main/bin/lasmerge")
+  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas/bin/lasmerge")
   IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/lasmerge")
     EXECUTE_PROCESS(COMMAND "/usr/bin/install_name_tool"
-      -change "/tmp/liblas-main/bin/liblas_c.dylib" "/usr/local/lib/liblas_c.dylib"
+      -change "/tmp/liblas/bin/liblas.dylib" "liblas.dylib"
+      -change "/tmp/liblas/bin/liblas_c.dylib" "/usr/local/lib/liblas_c.dylib"
       "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/lasmerge")
     IF(CMAKE_INSTALL_DO_STRIP)
       EXECUTE_PROCESS(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/lasmerge")
@@ -61,8 +66,11 @@ IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspeci
 ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
 
 IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas-main/bin/las2las")
+  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas/bin/las2las")
   IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/las2las")
+    EXECUTE_PROCESS(COMMAND "/usr/bin/install_name_tool"
+      -change "/tmp/liblas/bin/liblas.dylib" "liblas.dylib"
+      "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/las2las")
     IF(CMAKE_INSTALL_DO_STRIP)
       EXECUTE_PROCESS(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/las2las")
     ENDIF(CMAKE_INSTALL_DO_STRIP)
@@ -70,10 +78,11 @@ IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspeci
 ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
 
 IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas-main/bin/las2txt")
+  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas/bin/las2txt")
   IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/las2txt")
     EXECUTE_PROCESS(COMMAND "/usr/bin/install_name_tool"
-      -change "/tmp/liblas-main/bin/liblas_c.dylib" "/usr/local/lib/liblas_c.dylib"
+      -change "/tmp/liblas/bin/liblas.dylib" "liblas.dylib"
+      -change "/tmp/liblas/bin/liblas_c.dylib" "/usr/local/lib/liblas_c.dylib"
       "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/las2txt")
     IF(CMAKE_INSTALL_DO_STRIP)
       EXECUTE_PROCESS(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/las2txt")
@@ -82,10 +91,11 @@ IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspeci
 ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
 
 IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas-main/bin/txt2las")
+  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas/bin/txt2las")
   IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/txt2las")
     EXECUTE_PROCESS(COMMAND "/usr/bin/install_name_tool"
-      -change "/tmp/liblas-main/bin/liblas_c.dylib" "/usr/local/lib/liblas_c.dylib"
+      -change "/tmp/liblas/bin/liblas.dylib" "liblas.dylib"
+      -change "/tmp/liblas/bin/liblas_c.dylib" "/usr/local/lib/liblas_c.dylib"
       "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/txt2las")
     IF(CMAKE_INSTALL_DO_STRIP)
       EXECUTE_PROCESS(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/txt2las")
@@ -94,8 +104,11 @@ IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspeci
 ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
 
 IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas-main/bin/las2las")
+  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas/bin/las2las")
   IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/las2las")
+    EXECUTE_PROCESS(COMMAND "/usr/bin/install_name_tool"
+      -change "/tmp/liblas/bin/liblas.dylib" "liblas.dylib"
+      "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/las2las")
     IF(CMAKE_INSTALL_DO_STRIP)
       EXECUTE_PROCESS(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/las2las")
     ENDIF(CMAKE_INSTALL_DO_STRIP)
@@ -103,10 +116,11 @@ IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspeci
 ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
 
 IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas-main/bin/las2las-old")
+  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas/bin/las2las-old")
   IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/las2las-old")
     EXECUTE_PROCESS(COMMAND "/usr/bin/install_name_tool"
-      -change "/tmp/liblas-main/bin/liblas_c.dylib" "/usr/local/lib/liblas_c.dylib"
+      -change "/tmp/liblas/bin/liblas.dylib" "liblas.dylib"
+      -change "/tmp/liblas/bin/liblas_c.dylib" "/usr/local/lib/liblas_c.dylib"
       "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/las2las-old")
     IF(CMAKE_INSTALL_DO_STRIP)
       EXECUTE_PROCESS(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/las2las-old")
@@ -115,11 +129,26 @@ IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspeci
 ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
 
 IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas-main/bin/lasblock")
+  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas/bin/lasblock")
   IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/lasblock")
+    EXECUTE_PROCESS(COMMAND "/usr/bin/install_name_tool"
+      -change "/tmp/liblas/bin/liblas.dylib" "liblas.dylib"
+      "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/lasblock")
     IF(CMAKE_INSTALL_DO_STRIP)
       EXECUTE_PROCESS(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/lasblock")
     ENDIF(CMAKE_INSTALL_DO_STRIP)
   ENDIF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/lasblock")
 ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
 
+IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
+  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/tmp/liblas/bin/ts2las")
+  IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/ts2las")
+    EXECUTE_PROCESS(COMMAND "/usr/bin/install_name_tool"
+      -change "/tmp/liblas/bin/liblas.dylib" "liblas.dylib"
+      "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/ts2las")
+    IF(CMAKE_INSTALL_DO_STRIP)
+      EXECUTE_PROCESS(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/ts2las")
+    ENDIF(CMAKE_INSTALL_DO_STRIP)
+  ENDIF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/ts2las")
+ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
+
diff --git a/Utilities/otbliblas/apps/las2las-old.c b/Utilities/otbliblas/apps/las2las-old.c
old mode 100755
new mode 100644
index d5ca7feb1af6e756aaa2c83c7d6947547e946e1a..208a79cdffa1336df551d701da9bdc64320fdc8f
--- a/Utilities/otbliblas/apps/las2las-old.c
+++ b/Utilities/otbliblas/apps/las2las-old.c
@@ -880,7 +880,7 @@ int main(int argc, char *argv[])
         } else {
             if (verbose) {
                 fprintf(stderr, 
-                    "Setting xyz offset to commandline-assigned values...\n");
+                    "Setting xyz offset to %.8f %.8f %.8f...\n", xyz_offset[0], xyz_offset[1], xyz_offset[2]);
             }
             LASHeader_SetOffset(surviving_header,
                                 xyz_offset[0],
@@ -892,7 +892,7 @@ int main(int argc, char *argv[])
     if (do_set_scale) {
         if (verbose) {
             fprintf(stderr, 
-                "Setting xyz scale...\n");
+                "Setting xyz scale to %.8f %.8f %.8f...\n", xyz_scale[0], xyz_scale[1], xyz_scale[2]);
         }
         LASHeader_SetScale( surviving_header, 
                             xyz_scale[0],
diff --git a/Utilities/otbliblas/apps/las2las.cpp b/Utilities/otbliblas/apps/las2las.cpp
index ddb25fe366209c0d5947f466db025aee46aeda49..b12298042bed15b2d7c9480302da94a1b15a80e9 100755
--- a/Utilities/otbliblas/apps/las2las.cpp
+++ b/Utilities/otbliblas/apps/las2las.cpp
@@ -20,6 +20,50 @@ namespace po = boost::program_options;
 using namespace liblas;
 using namespace std;
 
+// 0, 4, 16, 64, 256
+//std::size_t const default_buffer_size = 0;
+//std::size_t const default_buffer_size = 4 * 1024;
+//std::size_t const default_buffer_size = 16 * 1024;
+//std::size_t const default_buffer_size = 64 * 1024;
+//std::size_t const default_buffer_size = 256 * 1024;
+std::size_t const default_buffer_size = 1024 * 1024;
+std::vector<char> ofs_buffer;
+std::vector<char> ifs_buffer;
+
+std::ofstream& set_ofstream_buffer(std::ofstream& ofs, std::size_t buffer_size)
+{
+    char* buffer = 0; // unbuffered;
+    if (buffer_size > 0)
+    {
+        std::vector<char>(buffer_size).swap(ofs_buffer);
+        buffer = &ofs_buffer[0];
+    }
+
+    std::streambuf* sb = ofs.rdbuf()->pubsetbuf(buffer, buffer_size);
+    if (0 != buffer && 0 == sb)
+    {
+        throw std::runtime_error("failed to attach non-null buffer to input file stream");
+    }
+    return ofs;
+}
+
+std::ifstream& set_ifstream_buffer(std::ifstream& ifs, std::size_t buffer_size)
+{
+    char* buffer = 0; // unbuffered;
+    if (buffer_size > 0)
+    {
+        std::vector<char>(buffer_size).swap(ifs_buffer);
+        buffer = &ifs_buffer[0];
+    }
+
+    std::streambuf* sb = ifs.rdbuf()->pubsetbuf(buffer, buffer_size);
+    if (0 != buffer && 0 == sb)
+    {
+        throw std::runtime_error("failed to attach non-null buffer to input file stream");
+    }
+    return ifs;
+}
+
 liblas::Writer* start_writer(   std::ofstream* strm, 
                                 std::string const& output, 
                                 liblas::Header const& header)
@@ -30,13 +74,15 @@ liblas::Writer* start_writer(   std::ofstream* strm,
         std::ostringstream oss;
         oss << "Cannot create " << output << "for write.  Exiting...";
         throw std::runtime_error(oss.str());
-    }        
+    }
+
+    // set_ofstream_buffer(*strm, default_buffer_size);
+
     liblas::Writer* writer = new liblas::Writer(*strm, header);
     return writer;
     
 }
 
-
 bool process(   std::string const& input,
                 std::string const& output,
                 liblas::Header & header,
@@ -48,35 +94,36 @@ bool process(   std::string const& input,
                 bool min_offset)
 {
 
-
-    
     std::ifstream ifs;
     if (!liblas::Open(ifs, input.c_str()))
     {
         std::cerr << "Cannot open " << input << "for read.  Exiting...";
         return false;
     }
+    // set_ifstream_buffer(ifs, default_buffer_size);
+
     liblas::Reader reader(ifs);
     liblas::Summary* summary = new liblas::Summary;
     
     reader.SetFilters(filters);
-    reader.SetTransforms(transforms);
-
+    reader.SetTransforms(transforms);    
+    
     if (min_offset) 
     {
         
         liblas::property_tree::ptree tree = reader.Summarize();
-    
         try
         {
-            header.SetOffset(tree.get<double>("minimum.x"),
-                             tree.get<double>("minimum.y"),
-                             tree.get<double>("minimum.z"));
+            header.SetOffset(tree.get<double>("summary.points.minimum.x"),
+                             tree.get<double>("summary.points.minimum.y"),
+                             tree.get<double>("summary.points.minimum.z"));
     
                               
-        }     catch (liblas::property_tree::ptree_bad_path const& e) 
+        }
+        catch (liblas::property_tree::ptree_bad_path const& e) 
         {
             std::cerr << "Unable to write minimum header info.  Does the outputted file have any points?";
+            std::cerr << e.what() << std::endl;
             return false;
         }
         if (verbose) 
@@ -287,14 +334,18 @@ int main(int argc, char* argv[])
         if (vm.count("input")) 
         {
             input = vm["input"].as< string >();
-            std::ifstream ifs;
+            
             if (verbose)
                 std::cout << "Opening " << input << " to fetch Header" << std::endl;
+
+            std::ifstream ifs;
             if (!liblas::Open(ifs, input.c_str()))
             {
                 std::cerr << "Cannot open " << input << "for read.  Exiting...";
                 return 1;
             }
+            // set_ifstream_buffer(ifs, default_buffer_size);
+
             liblas::Reader reader(ifs);
             header = reader.GetHeader();
         } else {
@@ -332,11 +383,13 @@ int main(int argc, char* argv[])
         }
         
     }
-    catch(std::exception& e) {
+    catch(std::exception& e)
+    {
         std::cerr << "error: " << e.what() << "\n";
         return 1;
     }
-    catch(...) {
+    catch(...)
+    {
         std::cerr << "Exception of unknown type!\n";
     }
     
diff --git a/Utilities/otbliblas/apps/las2oci.cpp b/Utilities/otbliblas/apps/las2oci.cpp
index 92f007d3c66bf72624d582a2eb6e3b52f01798bf..4bcf2e02c605a55102cd24f6754dbc933cd6f15a 100755
--- a/Utilities/otbliblas/apps/las2oci.cpp
+++ b/Utilities/otbliblas/apps/las2oci.cpp
@@ -10,7 +10,7 @@ namespace po = boost::program_options;
 using namespace liblas;
 using namespace std;
 
-void OCIGDALDebugErrorHandler(CPLErr eErrClass, int err_no, const char *msg)
+ void CPL_STDCALL OCIGDALDebugErrorHandler(CPLErr eErrClass, int err_no, const char *msg)
 {
     ostringstream oss;
     
@@ -24,7 +24,7 @@ void OCIGDALDebugErrorHandler(CPLErr eErrClass, int err_no, const char *msg)
     }
 }
 
-void OCIGDALErrorHandler(CPLErr eErrClass, int err_no, const char *msg)
+ void CPL_STDCALL OCIGDALErrorHandler(CPLErr eErrClass, int err_no, const char *msg)
 {
     ostringstream oss;
     
@@ -666,7 +666,7 @@ file_options.add_options()
     ("base-table-aux-values", po::value< string >(), "Quoted, comma-separated list of values to add to the SQL that gets executed as part of the point cloud insertion into the base-table-name")
     ("solid", po::value<bool>()->zero_tokens(), "Define the point cloud's PC_EXTENT geometry gtype as (1,1007,3) instead of the normal (1,1003,3), and use gtype 3008/2008 vs 3003/2003 for BLK_EXTENT geometry values.")
     ("3d", po::value<bool>()->zero_tokens(), "Use Z values for insertion of all extent (PC_EXTENT, BLK_EXTENT, USER_SDO_GEOM_METADATA) entries")
-    ("global-extent", po::value< std::vector<double> >(), "Extent window to define for the PC_EXTENT.\nUse a list, for example, \n  --global-extent minx miny maxx maxy\n  or \n  --global-extent minx miny minz maxx maxy maxz")
+    ("global-extent", po::value< std::vector<double> >(), "Extent window to define for the PC_EXTENT.\nUse a comma-separated or quoted, space-separated list, for example, \n -e minx, miny, maxx, maxy\n or \n -e minx, miny, minz, maxx, maxy, maxz\n -e \"minx miny minz maxx maxy maxz\"")
     ("cached", po::value<bool>()->zero_tokens(), "Cache the entire file on the first read")
 
 
@@ -800,6 +800,7 @@ int main(int argc, char* argv[])
             header = reader.GetHeader();
         } else {
             std::cerr << "Input LAS file not specified!\n";
+            std::cout << GetInvocationHeader()<<file_options<<transform_options<<filtering_options<<"\n";
             return 1;
         }
 
@@ -934,7 +935,7 @@ int main(int argc, char* argv[])
             }
             if (verbose)
                 if (!used_file)
-                    std::cout << "Setting output post-sql to: " << pre_sql << std::endl;
+                    std::cout << "Setting output post-sql to: " << post_sql << std::endl;
                 else
                     std::cout << "Setting output post-sql to: " << sql << std::endl; // Tell filename instead
         }
@@ -971,20 +972,14 @@ int main(int argc, char* argv[])
         }
         if (vm.count("global-extent")) 
         {
-            std::vector<double> vbounds = vm["global-extent"].as< std::vector<double> >();
+            std::string bounds_string = vm["global-extent"].as< string >();
 
-            liblas::Bounds<double> bounds;
-            
-            if (verbose)
-            {
-                std::cout << "Setting global bounds to : ";
-
-                for (std::vector<double>::const_iterator t = vbounds.begin(); 
-                     t != vbounds.end(); 
-                     ++t) {
-                    std::cout << *t;
-                }
-                std::cout << std::endl;
+            boost::char_separator<char> sep(SEPARATORS);
+
+            std::vector<double> vbounds;
+            tokenizer tokens(bounds_string, sep);
+            for (tokenizer::iterator t = tokens.begin(); t != tokens.end(); ++t) {
+                vbounds.push_back(atof((*t).c_str()));
             }
             if (vbounds.size() == 4) 
             {
@@ -1004,10 +999,8 @@ int main(int argc, char* argv[])
                 ostringstream oss;
                 oss << "Bounds must be specified as a 4-tuple or "
                        "6-tuple, not a "<< vbounds.size()<<"-tuple" << "\n";
-                std::cerr << oss.str();
-            }            
-            if (verbose)
-                std::cout << "Storing 3D geometries... " << std::endl;
+                throw std::runtime_error(oss.str());
+            }
         }
 
         if (vm.count("xmin")) 
diff --git a/Utilities/otbliblas/apps/lascommon.c b/Utilities/otbliblas/apps/lascommon.c
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/apps/lasindex_test.cpp b/Utilities/otbliblas/apps/lasindex_test.cpp
old mode 100755
new mode 100644
index 1f9513248c85cfa9e3560138369fc7ce4383f070..759f8c634ed88858cce777e450fa4a7003f9b368
--- a/Utilities/otbliblas/apps/lasindex_test.cpp
+++ b/Utilities/otbliblas/apps/lasindex_test.cpp
@@ -99,6 +99,10 @@ void usage(FILE *debugger)
     fprintf(debugger,"  follow with low and high values for Z filter\n");
     fprintf(debugger,"\n");
     
+    fprintf(debugger,"-it (use iterator for filtering):\n");
+    fprintf(debugger,"  follow with number of points to be returned in each iteration\n");
+    fprintf(debugger,"\n");
+    
     fprintf(debugger, "\nFor more information, see the full documentation for lasindex_test at:\n"
                     " http://liblas.org/browser/trunk/doc/lasindex_test.txt\n");
     fprintf(debugger,"----------------------------------------------------------\n");
@@ -121,6 +125,7 @@ std::istream* OpenInput(std::string filename)
     if (!istrm->good())
     {
         delete istrm;
+        istrm = 0;
         throw std::runtime_error("Reading stream was not able to be created.");
     }
     return istrm;
@@ -142,6 +147,7 @@ std::ostream* OpenOutput(std::string filename)
     if (!ostrm->good())
     {
         delete ostrm;
+        ostrm = 0;
         throw std::runtime_error("Writing stream was not able to be created.");
     }
     return ostrm;
@@ -162,6 +168,26 @@ void IndexFilterInitError(FILE *debugger)
     fprintf(debugger, "Unable to initialize index filter. Invalid values.\n");
 }
 
+bool ReportIteratorResults(FILE *debugger, uint32_t resultSize, uint32_t pointCount, uint32_t step)
+{
+	if (resultSize)
+	{
+		// do something with the list of points
+		#ifdef VISUAL_8
+		fprintf(debugger, "Points within filter area %d of %d, step %d, %s\n", resultSize, 
+			pointCount, step, "Using iterator");
+		#else // VISUAL_8
+		fprintf(debugger, "Points within filter area %d of %d, step %d, %s\n", resultSize, 
+			pointCount, step, "Using iterator");
+		#endif // VISUAL_8
+		return true;
+	}
+	else
+	{
+		IndexFilterNoPoints(debugger);
+		return false;
+	} // else
+} // ReportIteratorResults
 
 int main(int argc, char* argv[])
 {
@@ -174,12 +200,14 @@ int main(int argc, char* argv[])
 	char *datefield = 0;
 	double zbinheight = 0.0;
 	double oLowFilterX = 0.0, oHighFilterX = 0.0, oLowFilterY = 0.0, oHighFilterY = 0.0, oLowFilterZ = 0.0, oHighFilterZ = 0.0;
-	uint32_t maxmem = 0;
+	boost::uint32_t maxmem = 0;
+	boost::uint32_t chunkSize = 100;
 	int debuglevel = 3;
 	bool readonly = 0;
 	bool forcenewindex = 0;
 	bool boundssetbyuser = 0;
 	bool writestandaloneindex = 0;
+	bool useiterator = 0;
 	FILE *debugger = stderr;
 	
 	// temporary until argv[] starts to work
@@ -207,13 +235,18 @@ int main(int argc, char* argv[])
 		 "-n", "C:\\LibLAS\\Samples\\N1440375_idx.ldx", "-r"};
 	argc = 6;
 	*/
-	/*-----------------build embedded index, filter with user bounds------------
+	/*-----------------build embedded index, filter with user bounds------------ */
 	const char* arggv[] = {"foo", "-t", "C:\\LibLAS\\Samples\\N1440375.tmp",
 		 "-i", "C:\\LibLAS\\Samples\\N1440375.las", "-a", SAMPLE_AUTHOR, "-c", SAMPLE_COMMENT, "-d", SAMPLE_DATE,
 		 "-o", "C:\\LibLAS\\Samples\\N1440375_idx.las",
 		 "-x", "1443000.00", "1444000.00", "-y", "376000.02", "379000.00", "-z", "850.00", "950.00"};
 	argc = 22;
-	*/	
+
+	/*------------filter with embedded index using iterator---------------------
+	const char* arggv[] = {"foo",
+		 "-i", "C:\\LibLAS\\Samples\\N1440375_idx.las", "-r", "-it", "20000"};
+	argc = 6;
+	*/
 	/*---------------------Serpent Mound Model LAS Data-----------------------*/
 	/*----------------------------build index-----------------------------------
 	const char* arggv[] = {"foo", "-t", "C:\\LibLAS\\Samples\\Serpent Mound Model LAS Data.tmp",
@@ -230,8 +263,8 @@ int main(int argc, char* argv[])
 	/*----------------------------build index-----------------------------------
 	const char* arggv[] = {"foo", "-t", "C:\\LibLAS\\Mount St Helens Oct 4 2004.tmp",
 		 "-i", "C:\\LibLAS\\Samples\\Mount St Helens Oct 4 2004.las", "-a", SAMPLE_AUTHOR, "-c", SAMPLE_COMMENT, "-d", SAMPLE_DATE,
-		 "-o", "C:\\LibLAS\\Samples\\Mount St Helens Oct 4 2004_idx.las"};
-	argc = 13;
+		 "-o", "C:\\LibLAS\\Samples\\Mount St Helens Oct 4 2004_idx.las", "-b", "100"};
+	argc = 15;
 	*/
 	/*------------------filter with embedded index------------------------------
 	const char* arggv[] = {"foo",
@@ -251,18 +284,34 @@ int main(int argc, char* argv[])
 	argc = 4;
 	*/
 	/*------------------------------flatDataset-------------------------------*/
-	///*------------------------------build index---------------------------------
+	/*------------------------------build index---------------------------------
 	const char* arggv[] = {"foo", "-t", "C:\\LibLAS\\flatDataset.tmp",
 		 "-i", "C:\\LibLAS\\Samples\\flatDataset.las", "-a", SAMPLE_AUTHOR, "-c", SAMPLE_COMMENT, "-d", SAMPLE_DATE,
 		 "-o", "C:\\LibLAS\\Samples\\flatDataset_idx.las"};
 	argc = 13;
-	//*/
+	*/
 	/*------------------filter with embedded index------------------------------
 	const char* arggv[] = {"foo",
 		 "-i", "C:\\LibLAS\\Samples\\flatDataset_idx.las", "-r"};
 	argc = 4;
 	*/
-	/*------------------------------------------------------------------------*/
+	/*------------filter with embedded index using iterator---------------------
+	const char* arggv[] = {"foo",
+		 "-i", "C:\\LibLAS\\Samples\\flatDataset_idx.las", "-r", "-it", "25"};
+	argc = 6;
+	*/
+	/*---------------------------billion_points-------------------------------*/
+	/*-----------------build index in standalone file---------------------------
+	const char* arggv[] = {"foo", "-t", "K:\\FME\\billion_points.tmp",
+		 "-i", "D:\\Zips\\FME\\billion_points.las", "-a", SAMPLE_AUTHOR, "-c", SAMPLE_COMMENT, "-d", SAMPLE_DATE,
+		 "-o", "K:\\FME\\billion_points_idx.ldx", "-s", "-it", "5000000"};
+	argc = 16;
+	*/
+	/*-------------------filter from standalone file using iterator---------------
+	const char* arggv[] = {"foo", "-i", "D:\\Zips\\FME\\billion_points.las",
+		 "-n", "K:\\FME\\billion_points_idx.ldx", "-r", "-it", "5000000"};
+	argc = 8;
+	*/
 	
 	for (int i = 1; i < argc; i++)
     {
@@ -375,11 +424,19 @@ int main(int argc, char* argv[])
             oHighFilterZ = atof((const char *)arggv[i]);
             boundssetbyuser = true;
         }
+        else if (   strcmp((const char *)arggv[i],"-it") == 0
+            )
+        {
+            i++;
+            chunkSize = atoi((const char *)arggv[i]);
+            useiterator = true;
+        }
 	} // for
 
 	fprintf(debugger, "%s\n", lasinfilenme);
 	
 	IndexData ParamSrc;
+	IndexData ParamSrc2;
 	
 	if (lasinfilenme)
 	{
@@ -419,7 +476,80 @@ int main(int argc, char* argv[])
 							if (index.IndexReady())
 							{
 								// for testing filter bounds set by user
-								if (boundssetbyuser)
+								if (useiterator)
+								{
+									ParamSrc = IndexData(index);
+									ParamSrc2 = IndexData(index);
+									if (ParamSrc.SetFilterValues(index.GetBounds(), index)
+										&& ParamSrc2.SetFilterValues((index.GetMinX() + index.GetMaxX()) * .5, index.GetMaxX(), 
+										(index.GetMinY() + index.GetMaxY()) * .5, index.GetMaxY(), index.GetMinZ(), index.GetMaxZ(), index))
+									{
+										// two iterators with different filter bounds
+										IndexIterator *indexIt = index.Filter(ParamSrc, chunkSize);
+										IndexIterator *indexIt2 = index.Filter(ParamSrc2, chunkSize);
+										if (indexIt && indexIt2)
+										{
+											for (boost::uint32_t step = 0; step < 1000; ++step)
+											{
+												// use any of these to begin the vector with the next point that fits the filter criteria 
+												// that hasn't been scanned yet.
+												// ex: indexIt->advance(1) starts the vector on the first point that fits the criteria if no points have 
+												// been scanned previously. If there have been previous points scanned then the vector returned
+												// will start with the next point that fits the criteria beyond those previously scanned.
+												// ex: indexIt->advance(5) starts the vector on the fifth point that fits the criteria if no points have 
+												// been scanned previously. If there have been previous points scanned then the vector returned
+												// will start with the fifth point that fits the criteria beyond those previously scanned.
+												// The following three methods may be used to advance by any positive number X.
+												//const std::vector<boost::uint32_t>& FilterResult = indexIt->advance(X);
+												//const std::vector<boost::uint32_t>& FilterResult = (*indexIt)+=X;
+												//const std::vector<boost::uint32_t>& FilterResult = (*indexIt)+X;
+												// The following two methods may be used to advance as though X were 1.
+												// There is no functional difference between pre and post increment;
+												//const std::vector<boost::uint32_t>& FilterResult = ++(*indexIt);
+												//const std::vector<boost::uint32_t>& FilterResult = (*indexIt)++;
+												// Random access to any number point in the file that fits the filter criteria is 
+												// provided with the overloaded [] operator or () operator.
+												// ex: (*indexIt)[32] would start the array at the 32nd point in the file that fits the criteria
+												// Any number of non-conforming points may have been skipped to get to the start point
+												//const std::vector<boost::uint32_t>& FilterResult = (*indexIt)[32];
+												//const std::vector<boost::uint32_t>& FilterResult = (*indexIt)(0);
+												
+												// get first or next consecutive range on first iterator
+												const std::vector<boost::uint32_t>& FilterResult = (*indexIt)++;
+												if (!ReportIteratorResults(debugger, FilterResult.size(), index.GetPointRecordsCount(), step))
+													break;
+
+												// get first or next consecutive range on 2nd iterator
+												const std::vector<boost::uint32_t>& FilterResult2 = (*indexIt2)++;
+												if (!ReportIteratorResults(debugger, FilterResult2.size(), index.GetPointRecordsCount(), step))
+													break;
+
+												// get next range on first iterator
+												const std::vector<boost::uint32_t>& FilterResult3 = (*indexIt)++;
+												if (!ReportIteratorResults(debugger, FilterResult3.size(), index.GetPointRecordsCount(), step))
+													break;
+												
+												// get a range beginning with the 5th compliant point on 2nd iterator
+												const std::vector<boost::uint32_t>& FilterResult4 = (*indexIt2)[5];
+												if (!ReportIteratorResults(debugger, FilterResult4.size(), index.GetPointRecordsCount(), step))
+													break;
+
+												// get a range on first iterator beginning 6 compliant pts beyond last range (skipping 5)
+												const std::vector<boost::uint32_t>& FilterResult5 = (*indexIt)+6;
+												if (!ReportIteratorResults(debugger, FilterResult5.size(), index.GetPointRecordsCount(), step))
+													break;
+											
+											} // for
+										} // if
+										else
+											IndexFilterInitError(debugger);
+										delete indexIt;
+										delete indexIt2;
+									}
+									else
+										IndexFilterInitError(debugger);
+								} // if useiterator
+								else if (boundssetbyuser)
 								{
 									Bounds<double> filterBounds(oLowFilterX, oLowFilterY, oLowFilterZ,
 										oHighFilterX, oHighFilterY, oHighFilterZ);
@@ -429,8 +559,11 @@ int main(int argc, char* argv[])
 										if (FilterResult.size())
 										{
 											// do something with the list of points
-											fprintf(debugger, "Points within filter area %zu of %d, %s\n", FilterResult.size(), 
-												index.GetPointRecordsCount(), "User-defined gilter bounds");
+											std::ostringstream oss;
+											oss << "Points within filter area " << FilterResult.size() 
+												<< " of " << index.GetPointRecordsCount()
+												<< ",\nUser-defined filter bounds" << std::endl;
+											fprintf(debugger, "%s", oss.str().c_str());
 										}
 										else
 											IndexFilterNoPoints(debugger);
@@ -518,20 +651,24 @@ int main(int argc, char* argv[])
 													indexBounds.max(2));
 												break;
 											} // 5
+                                            default:
+                                            {
+                                                CovgStr = "";
+                                                break;
+                                            }
 										} // switch
+
 										if (ParamSrc.SetFilterValues(filterBounds, index))
 										{
 											const std::vector<uint32_t>& FilterResult = index.Filter(ParamSrc);
 											if (FilterResult.size())
 											{
 												// do something with the list of points
-												#ifdef VISUAL_8
-												fprintf(debugger, "Points within filter area %d of %d, %s\n", FilterResult.size(), 
-													index.GetPointRecordsCount(), CovgStr);
-												#else // VISUAL_8
-												fprintf(debugger, "Points within filter area %zu of %d, %s\n", FilterResult.size(), 
-													index.GetPointRecordsCount(), CovgStr);
-												#endif // VISUAL_8
+												std::ostringstream oss;
+												oss << "Points within filter area " << FilterResult.size() 
+													<< " of " << index.GetPointRecordsCount() 
+													<< ", " << CovgStr << std::endl;
+												fprintf(debugger, "%s", oss.str().c_str());
 											}
 											else
 												IndexFilterNoPoints(debugger);
@@ -558,8 +695,8 @@ int main(int argc, char* argv[])
 					if (static_cast<std::ifstream&>(*idxstrm))
 						static_cast<std::ifstream&>(*idxstrm).close();
 				} // if
-				if (idxreader)
-					delete idxreader;
+
+				delete idxreader;
 				delete reader;
 			} // if reader
 		
diff --git a/Utilities/otbliblas/apps/lasinfo-old.c b/Utilities/otbliblas/apps/lasinfo-old.c
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/apps/lasinfo.cpp b/Utilities/otbliblas/apps/lasinfo.cpp
index a1d699fa23515989b984eaa8a3cae974cecdf64a..63e24893d0a6baca23a5a814e251707591179c15 100755
--- a/Utilities/otbliblas/apps/lasinfo.cpp
+++ b/Utilities/otbliblas/apps/lasinfo.cpp
@@ -69,9 +69,9 @@ void OutputHelp( std::ostream & oss, po::options_description const& options)
 
     oss << options;
 
-    oss <<"\nFor more information, see the full documentation for lasinfo2 at:\n";
+    oss <<"\nFor more information, see the full documentation for lasinfo at:\n";
     
-    oss << " http://liblas.org/utilities/lasinfo2.html\n";
+    oss << " http://liblas.org/utilities/lasinfo.html\n";
     oss << "----------------------------------------------------------\n";
 
 }
@@ -105,6 +105,8 @@ int main(int argc, char* argv[])
     bool show_schema = true;
     bool output_xml = false;
     bool output_json = false;
+    bool show_point = false;
+    boost::uint32_t point = 0;
     
     std::vector<liblas::FilterPtr> filters;
     std::vector<liblas::TransformPtr> transforms;
@@ -113,7 +115,7 @@ int main(int argc, char* argv[])
 
     try {
 
-        po::options_description file_options("lasinfo2 options");
+        po::options_description file_options("lasinfo options");
         po::options_description filtering_options = GetFilteringOptions();
         po::options_description header_options = GetHeaderOptions();
 
@@ -129,7 +131,9 @@ int main(int argc, char* argv[])
             ("no-vlrs", po::value<bool>(&show_vlrs)->zero_tokens()->implicit_value(false), "Don't show VLRs")
             ("no-schema", po::value<bool>(&show_schema)->zero_tokens()->implicit_value(false), "Don't show schema")
             ("no-check", po::value<bool>(&check)->zero_tokens()->implicit_value(false), "Don't scan points")
-            ("xml", po::value<bool>(&output_xml)->zero_tokens()->implicit_value(true), "Output summary as XML")
+            ("xml", po::value<bool>(&output_xml)->zero_tokens()->implicit_value(true), "Output as XML")
+            ("point,p", po::value<boost::uint32_t>(&point), "Display a point with a given id.  --point 44")
+
             // ("json", po::value<bool>(&output_json)->zero_tokens()->implicit_value(true), "Output summary as JSON")
 
 // --xml
@@ -151,6 +155,10 @@ int main(int argc, char* argv[])
             return 1;
         }
 
+        if (vm.count("point")) 
+        {
+            show_point = true;
+        }
 
         if (vm.count("input")) 
         {
@@ -183,7 +191,33 @@ int main(int argc, char* argv[])
     
 
         liblas::Reader reader(ifs);
-        
+        if (show_point)
+        {
+            try 
+            {
+                reader.ReadPointAt(point);
+                liblas::Point const& p = reader.GetPoint();
+                if (output_xml) {
+                    liblas::property_tree::ptree tree;
+                    tree = p.GetPTree();
+                    liblas::property_tree::write_xml(std::cout, tree);
+                    exit(0);
+                } 
+                else 
+                {
+                    std::cout <<  p << std::endl;
+                    exit(0);    
+                }
+                
+            } catch (std::out_of_range const& e)
+            {
+                std::cerr << "Unable to read point at index " << point << ": " << e.what() << std::endl;
+                exit(1);
+                
+            }
+
+        }
+
         liblas::Summary summary;
         if (check)
             summary = check_points(  reader, 
diff --git a/Utilities/otbliblas/apps/laskernel.cpp b/Utilities/otbliblas/apps/laskernel.cpp
old mode 100755
new mode 100644
index 3fa52470e05edaaeb960c589a9b22752023dcc5e..b280001a98b34b0151ebea88c2cead8b6794f12a
--- a/Utilities/otbliblas/apps/laskernel.cpp
+++ b/Utilities/otbliblas/apps/laskernel.cpp
@@ -1,7 +1,7 @@
 
 #include "laskernel.hpp"
 
-std::istream* OpenInput(std::string filename, bool bEnd) 
+std::istream* OpenInput(std::string const& filename, bool bEnd) 
 {
     std::ios::openmode mode = std::ios::in | std::ios::binary;
     if (bEnd == true) {
@@ -30,10 +30,10 @@ std::string TryReadFileData(std::string const& filename)
     std::vector<char> data = TryReadRawFileData(filename);
 
     // FIXME: What is this construction supposed to grab? --mloskot
-    return std::string(data.front(), (std::size_t) data.size());
+    return std::string(&data[0], data.size());
 }
 
-std::vector<char> TryReadRawFileData(std::string filename)
+std::vector<char> TryReadRawFileData(std::string const& filename)
 {
     std::istream* infile = OpenInput(filename.c_str(), true);
     std::ifstream::pos_type size;
@@ -63,7 +63,7 @@ bool term_progress(std::ostream& os, double complete)
     static int lastTick = -1;
     int tick = static_cast<int>(complete * 40.0);
 
-    tick = std::min(40, std::max(0, tick));
+    tick = (std::min)(40, std::max(0, tick));
 
     // Have we started a new progress run?  
     if (tick < lastTick && lastTick >= 39)
@@ -153,7 +153,7 @@ void RepairHeader(liblas::Summary const& summary, liblas::Header& header)
                       tree.get<double>("summary.points.maximum.y"),
                       tree.get<double>("summary.points.maximum.z"));
         
-    }     catch (liblas::property_tree::ptree_bad_path const& e) 
+    }     catch (liblas::property_tree::ptree_bad_path const& ) 
     {
         std::cerr << "Unable to write header bounds info.  Does the outputted file have any points?";
         return;
@@ -175,7 +175,7 @@ void RepairHeader(liblas::Summary const& summary, liblas::Header& header)
             header.SetPointRecordsByReturnCount(i-1, count);        
         } 
         
-    }     catch (liblas::property_tree::ptree_bad_path const& e) 
+    }     catch (liblas::property_tree::ptree_bad_path const& ) 
     {
         std::cerr << "Unable to write header point return count info.  Does the outputted file have any points?";
         return;
@@ -255,7 +255,13 @@ po::options_description GetFilteringOptions()
 po::options_description filtering_options("Filtering options");
 
 filtering_options.add_options()
-    ("extent,e", po::value< std::vector<double> >()->multitoken(), "Extent window that points must fall within to keep.\nFor example, \n  -e minx miny maxx maxy\n  or \n  -e minx miny minz maxx maxy maxz")
+    ("extent,e", po::value< string >(), "Extent window that points must fall within to keep.\nUse a comma-separated or quoted, space-separated list, for example, \n -e minx, miny, maxx, maxy\n or \n -e minx, miny, minz, maxx, maxy, maxz\n -e \"minx miny minz maxx maxy maxz\"")     
+    ("minx", po::value< double >(), "Extent must be greater than or equal to minx to be kept. \n --minx 1234.0")
+    ("miny", po::value< double >(), "Extent must be greater than or equal to miny to be kept. \n --miny 5678.0")
+    ("minz", po::value< double >(), "Extent must be greater than or equal to minz to be kept. If maxx and maxy are set but not minz *and maxz, all z values are kept. \n --minz 0.0")
+    ("maxx", po::value< double >(), "Extent must be less than or equal to maxx to be kept. \n --maxx 1234.0")
+    ("maxy", po::value< double >(), "Extent must be less than or equal to maxy to be kept. \n --maxy 5678.0")
+    ("maxz", po::value< double >(), "Extent must be less than or equal to maxz to be kept. If maxx and maxy are set but not maxz *and minz, all z values are kept. \n --maxz 10.0")
     ("thin,t", po::value<boost::uint32_t>()->default_value(0), "Simple decimation-style thinning.\nThin the file by removing every t'th point from the file.")
     ("last_return_only", po::value<bool>()->zero_tokens(), "Keep last returns (cannot be used with --first_return_only)")
     ("first_return_only", po::value<bool>()->zero_tokens(), "Keep first returns (cannot be used with --last_return_only")
@@ -294,8 +300,8 @@ po::options_description GetHeaderOptions()
     transform_options.add_options()
         ("a_srs", po::value< string >(), "Coordinate system to assign to input LAS file")
         ("a_vertcs", po::value< std::vector<string> >()->multitoken(), "Override vertical coordinate system information.  Use --a_vertcs \"verticalCSType [citation [verticalDatum [verticalUnits]]]\"\nFor example: --a_vertcs 5703 \"North American Vertical Datum of 1988 (NAVD88)\" 5103 9001")   
-        ("offset", po::value< std::vector<double> >()->multitoken(), "A list of offsets to set on the output file: \n--offset 0 0 0")
-        ("scale", po::value< std::vector<double> >()->multitoken(), "A list of scales to set on the output file: \n--scale 0.1 0.1 0.00001")
+        ("offset", po::value< string >(), "A comma-separated or quoted, space-separated list of offsets to set on the output file: \n--offset 0,0,0\n--offset \"1234 5678 91011\"")
+        ("scale", po::value< std::vector<double> >()->multitoken(), "A list of scales to set on the output file. Scales *cannot* be negative, and should always be a negative power of 10 \n--scale 0.1 0.1 0.00001")
         ("format,f", po::value< string >(), "Set the LAS format of the new file (only 1.0-1.2 supported at this time): \n--format 1.2\n-f 1.1")
         ("pad-header", po::value< string >(), "Add extra bytes to the existing header")
         ("min-offset", po::value<bool>()->zero_tokens(), "Set the offset of the header to the minimums of all values in the file.  Note that this requires multiple read passes through the file to achieve.")
@@ -305,6 +311,7 @@ po::options_description GetHeaderOptions()
         ("add-vlr", po::value<std::vector<std::string> >()->multitoken(), "Add VLRs with the given name and id combination. --add-vlr hobu 1234 \"Description of the VLR\" \"filename.ext\"")
         ("system-identifier", po::value<std::string>(), "Set the SystemID for the file. --system_identifier \"MODIFICATION\"")
         ("generating-software", po::value<std::string>(), "Set the SoftwareID for the file. --generating_software \"liblas.org\"")
+        ("point-translate", po::value<std::string>(), "An expression to translate the X, Y, Z values of the point. For example, converting Z units that are in meters to feet: --point-translate \"x*1.0 y*1.0 z*3.2808399\"")
 
     ;
     
@@ -313,6 +320,8 @@ po::options_description GetHeaderOptions()
 std::vector<liblas::FilterPtr> GetFilters(po::variables_map vm, bool verbose)
 {
     std::vector<liblas::FilterPtr> filters;
+    liblas::Bounds<double> extent;
+    bool bSetExtent = false;
     
     if (vm.count("keep-classes")) 
     {
@@ -408,14 +417,73 @@ std::vector<liblas::FilterPtr> GetFilters(po::variables_map vm, bool verbose)
                                                             liblas::FilterI::eExclusion);
         filters.push_back(return_filter); 
     }
-            
+
+    if (vm.count("minx")) 
+    {
+        double minx = vm["minx"].as< double >();
+        extent.min(0, minx);
+        bSetExtent = true;
+        if (verbose)
+            std::cout << "Setting minx to: " << minx << std::endl;
+    }
+
+    if (vm.count("maxx")) 
+    {
+        double maxx = vm["maxx"].as< double >();
+        extent.max(0, maxx);
+        bSetExtent = true;
+        if (verbose)
+            std::cout << "Setting maxx to: " << maxx << std::endl;
+    }
+
+    if (vm.count("miny")) 
+    {
+        double miny = vm["miny"].as< double >();
+        extent.min(1, miny);
+        bSetExtent = true;
+        if (verbose)
+            std::cout << "Setting miny to: " << miny << std::endl;
+    }
+
+    if (vm.count("maxx")) 
+    {
+        double maxy = vm["maxy"].as< double >();
+        extent.max(1, maxy);
+        bSetExtent = true;
+        if (verbose)
+            std::cout << "Setting maxy to: " << maxy << std::endl;
+    }
+
+    if (vm.count("minz")) 
+    {
+        double minz = vm["minz"].as< double >();
+        extent.min(2, minz);
+        bSetExtent = true;
+        if (verbose)
+            std::cout << "Setting minz to: " << minz << std::endl;
+    }
+
+    if (vm.count("maxz")) 
+    {
+        double maxz = vm["maxz"].as< double >();
+        extent.max(2, maxz);
+        bSetExtent = true;
+        if (verbose)
+            std::cout << "Setting maxz to: " << maxz << std::endl;
+    }
+    
     if (vm.count("extent")) 
     {
+        std::string bounds_string = vm["extent"].as< string >();
 
-        std::vector<double> vbounds = vm["extent"].as< std::vector<double> >();
+        boost::char_separator<char> sep(SEPARATORS);
 
+        std::vector<double> vbounds;
+        tokenizer tokens(bounds_string, sep);
         liblas::Bounds<double> bounds;
-
+        for (tokenizer::iterator t = tokens.begin(); t != tokens.end(); ++t) {
+            vbounds.push_back(atof((*t).c_str()));
+        }
         if (vbounds.size() == 4) 
         {
             bounds = liblas::Bounds<double>(vbounds[0], 
@@ -436,6 +504,15 @@ std::vector<liblas::FilterPtr> GetFilters(po::variables_map vm, bool verbose)
                    "6-tuple, not a "<< vbounds.size()<<"-tuple" << "\n";
             throw std::runtime_error(oss.str());
         }
+        
+        if ( bSetExtent ) 
+        {
+            if (verbose) 
+            {
+                std::cout << " Growing --extent bounds with those that were set via --[x|y|z][min|max]" << std::endl;
+            }
+            bounds.grow(extent);
+        }
     
         if (verbose)
         {
@@ -458,6 +535,11 @@ std::vector<liblas::FilterPtr> GetFilters(po::variables_map vm, bool verbose)
         }
 
         liblas::FilterPtr bounds_filter = MakeBoundsFilter(bounds, liblas::FilterI::eInclusion);
+        // Set to false because we are using this opportunity to set the filter
+        // If it were still true after this point, *another* BoundsFilter would be 
+        // added to the filters list at the end of this function
+        if (bSetExtent)
+            bSetExtent = false; 
         filters.push_back(bounds_filter);
         
     }
@@ -585,7 +667,16 @@ std::vector<liblas::FilterPtr> GetFilters(po::variables_map vm, bool verbose)
             std::vector<liblas::Color::value_type> rgb;
             for(tokenizer::iterator c = rgbs.begin(); c != rgbs.end(); ++c)
             {
-                rgb.push_back(atoi((*c).c_str()));
+                int color_val = atoi((*c).c_str());
+                if (color_val < std::numeric_limits<boost::uint16_t>::min() || 
+                    color_val > std::numeric_limits<boost::uint16_t>::max()) 
+                {
+                    ostringstream oss;
+                    oss << "Color value must be between 0-65536, not " << color_val;
+                    throw std::runtime_error( oss.str() );
+                    
+                }
+                rgb.push_back(static_cast<boost::uint16_t>(color_val));
             }
             liblas::Color color(rgb[0], rgb[1], rgb[2]);
             colors.push_back(color);
@@ -611,7 +702,16 @@ std::vector<liblas::FilterPtr> GetFilters(po::variables_map vm, bool verbose)
             std::vector<liblas::Color::value_type> rgb;
             for(tokenizer::iterator c = rgbs.begin(); c != rgbs.end(); ++c)
             {
-                rgb.push_back(atoi((*c).c_str()));
+                int color_val = atoi((*c).c_str());
+                if (color_val < std::numeric_limits<boost::uint16_t>::min() || 
+                    color_val > std::numeric_limits<boost::uint16_t>::max()) 
+                {
+                    ostringstream oss;
+                    oss << "Color value must be between 0-65536, not " << color_val;
+                    throw std::runtime_error( oss.str() );
+                    
+                }
+                rgb.push_back(static_cast<boost::uint16_t>(color_val));
             }
             liblas::Color color(rgb[0], rgb[1], rgb[2]);
             colors.push_back(color);
@@ -664,6 +764,15 @@ std::vector<liblas::FilterPtr> GetFilters(po::variables_map vm, bool verbose)
         filters.push_back(valid_filter);            
     }
 
+
+    // If we have bSetExtent and we haven't turned it off by merging with a --extent 
+    // BoundsFilter, make a filter
+    if (bSetExtent)
+    {
+        liblas::FilterPtr bounds_filter = MakeBoundsFilter(extent, liblas::FilterI::eInclusion);
+        filters.push_back(bounds_filter);
+    }
+    
     return filters;
 }
 
@@ -671,143 +780,39 @@ std::vector<liblas::TransformPtr> GetTransforms(po::variables_map vm, bool verbo
 {
     std::vector<liblas::TransformPtr> transforms;
 
-    if (vm.count("a_srs")) 
-    {
-        liblas::SpatialReference in_ref;
-        
-        std::string input_srs = vm["a_srs"].as< string >();
-        if (verbose)
-            std::cout << "Setting input SRS to " << input_srs << std::endl;
-        in_ref.SetFromUserInput(input_srs);
-        header.SetSRS(in_ref);
-    }
-
-    if (vm.count("a_vertcs"))
-    {
-        liblas::SpatialReference vert_ref = header.GetSRS();
-
-        std::vector<std::string> vertical_vec = vm["a_vertcs"].as< std::vector<std::string> >();
-        if (vertical_vec.size() > 4) {
-            ostringstream oss;
-            oss << "Too many arguments were given to a_vertcs. "
-                << "--a_vertcs verticalCSType citation verticalDatum verticalUnits  "
-                << "All except verticalCSType are optional, but they are "
-                << "applied in order, so if you want to set verticalUnits, "
-                << "you must set all the others";
-
-            throw std::runtime_error(oss.str());
-        }
-        if (vertical_vec.size() < 1) {
-            ostringstream oss;
-            oss << "At least verticalCSType must be given to a_vertcs. "
-                << "--a_vertcs verticalCSType citation verticalDatum verticalUnits  "
-                << "All except verticalCSType are optional, but they are "
-                << "applied in order, so if you want to set verticalUnits, "
-                << "you must set all the others";
-
-            throw std::runtime_error(oss.str());
-        }
-        
-        if (verbose)
-        {
-            ostringstream oss;
-            for (std::vector<std::string>::const_iterator i = vertical_vec.begin();
-                 i != vertical_vec.end();
-                 i++) 
-                {
-                    oss << *i << " ";
-                }
-                std::cout << "Setting vertical info to: " << oss.str() << std::endl;
-        }
-            
-        boost::int32_t verticalCSType = boost::lexical_cast<boost::int32_t>(vertical_vec[0]);
-        
-        std::string citation;
-        int verticalDatum = -1;
-        int verticalUnits = 9001;
-        
-        if (vertical_vec.size() > 1) {
-            citation = boost::lexical_cast<std::string>(vertical_vec[1]);
-        }
-        
-        if (vertical_vec.size() > 2) {
-            verticalDatum = boost::lexical_cast<boost::int32_t>(vertical_vec[2]);
-        }
-
-        if (vertical_vec.size() > 3) {
-            verticalUnits = boost::lexical_cast<boost::int32_t>(vertical_vec[3]);
-        }
-        
-        vert_ref.SetVerticalCS(verticalCSType, citation, verticalDatum, verticalUnits);
-        header.SetSRS(vert_ref);      
-    }
-    
-    if (vm.count("t_srs")) 
+    if (vm.count("offset")) 
     {
-        liblas::SpatialReference in_ref;
-        liblas::SpatialReference out_ref;
-        
-        std::string output_srs = vm["t_srs"].as< string >();
+        std::string offset_string = vm["offset"].as< string >();
         if (verbose)
-            std::cout << "Setting output SRS to " << output_srs << std::endl;
-        out_ref.SetFromUserInput(output_srs);
-
-        if (vm.count("a_srs")){
-            std::string input_srs = vm["a_srs"].as< string >();
-            in_ref.SetFromUserInput(input_srs);
-        } else {
-            // If the user didn't assign an input SRS, we'll try to take 
-            // it from our existing header.
-            in_ref = header.GetSRS();
-            if (in_ref.GetVLRs().size() == 0)
+            std::cout << "Setting offsets to: " << offset_string << std::endl;
+        boost::char_separator<char> sep(SEPARATORS);
+        std::vector<double> offsets;
+        tokenizer tokens(offset_string, sep);
+        bool mins = false;
+        std::string m("min");
+        for (tokenizer::iterator t = tokens.begin(); t != tokens.end(); ++t) {
+            // Check if the user set --offset min,min,min
+            // FIXME: make this so the user could do --offset min,min,20.00
+            if (!(*t).compare(m))
+            {   
+                mins = true;
+                continue;
+            }
+            else
             {
-                throw std::runtime_error("No input SRS is available on the file you have specified.  Please use --a_srs to assign one");
+                mins = false;
+                offsets.push_back(atof((*t).c_str()));
             }
-            
         }
-        // Set the header's SRS to the output SRS now.  We've already 
-        // made the transformation, and this SRS will be used to 
-        // write the new file(s)
-        header.SetSRS(out_ref);
-        
-        liblas::Bounds<double> b = header.GetExtent();
-        b.project(in_ref, out_ref);
-        header.SetExtent(b);
-        liblas::TransformPtr srs_transform = liblas::TransformPtr(new liblas::ReprojectionTransform(in_ref, out_ref));
-        transforms.push_back(srs_transform);
-    }
-
-
-
-
-    if (vm.count("offset")) 
-    {
-
-        std::vector<double> offsets = vm["offset"].as< std::vector<double> >();
-        if (offsets.size() != 3) {
-            ostringstream oss;
-            oss << "Three arguments must be given to offset. "
-                << "--offset x y z";
-
-            throw std::runtime_error(oss.str());
-        }
-
-        
-        if (verbose)
+        if (offsets.size() != 3) 
         {
-            ostringstream oss;
-            for (std::vector<double>::const_iterator i = offsets.begin();
-                 i != offsets.end();
-                 i++) 
-                {
-                    oss << *i << " ";
-                }
-                std::cout << "Setting offsets to: " << oss.str() << std::endl;
-        }
+            throw std::runtime_error("All three values for setting the offset must be floats, and there must be three values");
 
+        }
         header.SetOffset(offsets[0], offsets[1], offsets[2]);
     }
 
+
     if (vm.count("scale")) 
     {
         std::vector<double> scales = vm["scale"].as< std::vector<double> >();
@@ -908,14 +913,27 @@ std::vector<liblas::TransformPtr> GetTransforms(po::variables_map vm, bool verbo
             }            
         }
         
-        boost::uint32_t day = 0;
-        boost::uint32_t year = 0;
+        boost::int32_t day = 0;
+        boost::int32_t year = 0;
         
         
         if (creation.size() == 2) 
         {
             day = atoi(creation[0].c_str());
             year = atoi(creation[1].c_str());
+            
+            if (day < 0 || day > 366) {
+                ostringstream oss;
+                oss << "Day must be between 1-366, not " << day;
+                throw std::runtime_error(oss.str());
+            }
+            if (year < 0)
+            {
+                ostringstream oss;
+                oss << "Year must be greater than 0, not " << year;
+                throw std::runtime_error(oss.str());
+            }
+            
         }
         
         if (now == true) 
@@ -924,8 +942,8 @@ std::vector<liblas::TransformPtr> GetTransforms(po::variables_map vm, bool verbo
             header.SetCreationDOY(h.GetCreationDOY());
             header.SetCreationYear(h.GetCreationYear());
         } else {
-            header.SetCreationDOY(day);
-            header.SetCreationYear(year);
+            header.SetCreationDOY(static_cast<boost::uint16_t>(day));
+            header.SetCreationYear(static_cast<boost::uint16_t>(year));
             
         }
     }
@@ -943,7 +961,7 @@ std::vector<liblas::TransformPtr> GetTransforms(po::variables_map vm, bool verbo
         
         if (vlrs.size() % 2 != 0) {
             ostringstream err;
-            err << "VLR descriptions must be in pairs of 2";
+            err << "VLR descriptions must be in pairs of 2 -- A name and an ID";
             throw std::runtime_error(err.str());
         }
         ostringstream oss;
@@ -962,7 +980,17 @@ std::vector<liblas::TransformPtr> GetTransforms(po::variables_map vm, bool verbo
         
         for (std::vector<std::string>::size_type i = 0; i < vlrs.size(); i=i+2)
         {
-            header.DeleteVLRs(vlrs[i], atoi(vlrs[i+1].c_str()));
+            boost::int32_t id = atoi(vlrs[i+1].c_str());
+            if (id < 0)
+            {
+                throw std::runtime_error("VLR ID must be > 0");
+            }
+            if (id > std::numeric_limits<boost::uint16_t>::max()) {
+                ostringstream oss;
+                oss << "ID must be less than "<< std::numeric_limits<boost::uint16_t>::max() <<", not " << id;
+                throw std::runtime_error(oss.str());
+            }
+            header.DeleteVLRs(vlrs[i], static_cast<boost::uint16_t>(id));
         }
     }
 
@@ -991,7 +1019,19 @@ std::vector<liblas::TransformPtr> GetTransforms(po::variables_map vm, bool verbo
         
         liblas::VariableRecord v;
         v.SetUserId(vlrs[0]);
-        v.SetRecordId(atoi(vlrs[1].c_str()));
+
+        boost::int32_t id = atoi(vlrs[1].c_str());
+        if (id < 0)
+        {
+            throw std::runtime_error("VLR ID must be > 0");
+        }
+        if (id > std::numeric_limits<boost::uint16_t>::max()) {
+            ostringstream oss;
+            oss << "ID must be less than "<< std::numeric_limits<boost::uint16_t>::max() <<", not " << id;
+            throw std::runtime_error(oss.str());
+        }
+
+        v.SetRecordId(static_cast<boost::uint16_t>(id));
         
         std::vector<boost::uint8_t> data;
         
@@ -1036,7 +1076,7 @@ std::vector<liblas::TransformPtr> GetTransforms(po::variables_map vm, bool verbo
 
 
         v.SetData(data);
-        v.SetRecordLength(data.size());
+        v.SetRecordLength(static_cast<boost::uint16_t>(data.size()));
         header.AddVLR(v);
     }
 
@@ -1064,6 +1104,125 @@ std::vector<liblas::TransformPtr> GetTransforms(po::variables_map vm, bool verbo
         
         header.SetSystemId(id);
     }
+    
+
+    if (vm.count("a_srs")) 
+    {
+        liblas::SpatialReference in_ref;
+        
+        std::string input_srs = vm["a_srs"].as< string >();
+        if (verbose)
+            std::cout << "Setting input SRS to " << input_srs << std::endl;
+        in_ref.SetFromUserInput(input_srs);
+        header.SetSRS(in_ref);
+    }
+
+    if (vm.count("a_vertcs"))
+    {
+        liblas::SpatialReference vert_ref = header.GetSRS();
+
+        std::vector<std::string> vertical_vec = vm["a_vertcs"].as< std::vector<std::string> >();
+        if (vertical_vec.size() > 4) {
+            ostringstream oss;
+            oss << "Too many arguments were given to a_vertcs. "
+                << "--a_vertcs verticalCSType citation verticalDatum verticalUnits  "
+                << "All except verticalCSType are optional, but they are "
+                << "applied in order, so if you want to set verticalUnits, "
+                << "you must set all the others";
+
+            throw std::runtime_error(oss.str());
+        }
+        if (vertical_vec.size() < 1) {
+            ostringstream oss;
+            oss << "At least verticalCSType must be given to a_vertcs. "
+                << "--a_vertcs verticalCSType citation verticalDatum verticalUnits  "
+                << "All except verticalCSType are optional, but they are "
+                << "applied in order, so if you want to set verticalUnits, "
+                << "you must set all the others";
+
+            throw std::runtime_error(oss.str());
+        }
+        
+        if (verbose)
+        {
+            ostringstream oss;
+            for (std::vector<std::string>::const_iterator i = vertical_vec.begin();
+                 i != vertical_vec.end();
+                 i++) 
+                {
+                    oss << *i << " ";
+                }
+                std::cout << "Setting vertical info to: " << oss.str() << std::endl;
+        }
+            
+        boost::int32_t verticalCSType = boost::lexical_cast<boost::int32_t>(vertical_vec[0]);
+        
+        std::string citation;
+        int verticalDatum = -1;
+        int verticalUnits = 9001;
+        
+        if (vertical_vec.size() > 1) {
+            citation = boost::lexical_cast<std::string>(vertical_vec[1]);
+        }
+        
+        if (vertical_vec.size() > 2) {
+            verticalDatum = boost::lexical_cast<boost::int32_t>(vertical_vec[2]);
+        }
+
+        if (vertical_vec.size() > 3) {
+            verticalUnits = boost::lexical_cast<boost::int32_t>(vertical_vec[3]);
+        }
+        
+        vert_ref.SetVerticalCS(verticalCSType, citation, verticalDatum, verticalUnits);
+        header.SetSRS(vert_ref);      
+    }
+    
+    if (vm.count("t_srs")) 
+    {
+        liblas::SpatialReference in_ref;
+        liblas::SpatialReference out_ref;
+        
+        std::string output_srs = vm["t_srs"].as< string >();
+        if (verbose)
+            std::cout << "Setting output SRS to " << output_srs << std::endl;
+        out_ref.SetFromUserInput(output_srs);
+
+        if (vm.count("a_srs")){
+            std::string input_srs = vm["a_srs"].as< string >();
+            in_ref.SetFromUserInput(input_srs);
+        } else {
+            // If the user didn't assign an input SRS, we'll try to take 
+            // it from our existing header.
+            in_ref = header.GetSRS();
+            if (in_ref.GetVLRs().size() == 0)
+            {
+                throw std::runtime_error("No input SRS is available on the file you have specified.  Please use --a_srs to assign one");
+            }
+            
+        }
+        // Set the header's SRS to the output SRS now.  We've already 
+        // made the transformation, and this SRS will be used to 
+        // write the new file(s)
+        header.SetSRS(out_ref);
+        
+        liblas::Bounds<double> b = header.GetExtent();
+        b.project(in_ref, out_ref);
+        header.SetExtent(b);
+        liblas::TransformPtr srs_transform = liblas::TransformPtr(new liblas::ReprojectionTransform(in_ref, out_ref, liblas::HeaderPtr(new liblas::Header(header))));
+        transforms.push_back(srs_transform);
+    }
+
+    if (vm.count("point-translate")) 
+    {
+        std::string translate = vm["point-translate"].as< std::string >();
+        if (verbose)
+        {
+
+                std::cout << "Translating points with expression: " << translate << std::endl;
+        }
+        liblas::TransformPtr trans_trans = liblas::TransformPtr(new liblas::TranslationTransform(translate));
+        transforms.push_back(trans_trans);
+    }
     return transforms;
 }
 
diff --git a/Utilities/otbliblas/apps/laskernel.hpp b/Utilities/otbliblas/apps/laskernel.hpp
old mode 100755
new mode 100644
index 5cd6aa09d654c04fae1a1ad0314218114daac760..e204fb662d57ddacb7d5a46f26cb3f76ad56841d
--- a/Utilities/otbliblas/apps/laskernel.hpp
+++ b/Utilities/otbliblas/apps/laskernel.hpp
@@ -65,7 +65,7 @@
 using namespace std;
 namespace po = boost::program_options;
 
-#define SEPARATORS ",|"
+#define SEPARATORS ",| "
 typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
 
 bool IsDualRangeFilter(std::string parse_string) ;
@@ -92,9 +92,9 @@ std::vector<liblas::TransformPtr> GetTransforms(po::variables_map vm, bool verbo
 #define compare_no_case(a,b,n)  strncasecmp( (a), (b), (n) )
 #endif
 
-std::istream* OpenInput(std::string filename, bool bEnd);
-std::string TryReadFileData(std::string filename);
-std::vector<char> TryReadRawFileData(std::string filename);
+// std::istream* OpenInput(std::string const& filename, bool bEnd);
+std::string TryReadFileData(std::string const& filename);
+std::vector<char> TryReadRawFileData(std::string const& filename);
 bool term_progress(std::ostream& os, double complete);
 void SetStreamPrecision(std::ostream& os, double scale);
 
diff --git a/Utilities/otbliblas/apps/liblas-config.in b/Utilities/otbliblas/apps/liblas-config.in
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/apps/oci_util.cpp b/Utilities/otbliblas/apps/oci_util.cpp
index cb9584eb188a639dc28c7e1656c1d999a817b82a..8ff230965e9e8df7e28b789b1465a03afd714594 100755
--- a/Utilities/otbliblas/apps/oci_util.cpp
+++ b/Utilities/otbliblas/apps/oci_util.cpp
@@ -1,7 +1,6 @@
 #include "oci_util.hpp"
 
 
-
 std::string ReadSQLData(std::string filename)
 {
     std::istream* infile = OpenInput(filename.c_str(), true);
@@ -166,12 +165,17 @@ bool BlockTableExists(OWConnection* connection, std::string tableName)
     
     try {
         statement->Execute();
-    } catch (std::runtime_error const& e) {
-        delete statement;
-        std::ostringstream oss;
-        oss << "Failed select if block table "<< tableName << " exists.  Do you have rights to select?"  
-            << std::endl << e.what() << std::endl;
-        throw std::runtime_error(oss.str());
+    } catch (std::runtime_error const& ) {
+        // Assume for now that an error returned here is OCI_NODATA, which means 
+        // the table doesn't exist.  If this really isn't the case, we're going 
+        // to get more legit message further down the line.
+
+        return false;
+        // delete statement;
+        // std::ostringstream oss;
+        // oss << "Failed select if block table "<< tableName << " exists.  Do you have rights to select?"  
+        //     << std::endl << e.what() << std::endl;
+        // throw std::runtime_error(oss.str());
     }  
     
     return true;
diff --git a/Utilities/otbliblas/apps/oci_util.hpp b/Utilities/otbliblas/apps/oci_util.hpp
index f73ab3223241654ffc6f918abf1e31c1edd16ce6..3c42eae090aa144bf4737a49bb3501873bde80aa 100755
--- a/Utilities/otbliblas/apps/oci_util.hpp
+++ b/Utilities/otbliblas/apps/oci_util.hpp
@@ -33,7 +33,7 @@ bool WipeBlockTable(   OWConnection* connection,
                     std::string cloudColumnName);
 std::string to_upper(const std::string&);
 std::string ReadSQLData(std::string filename);
-std::istream* OpenInput(std::string filename, bool bEnd) ;
+std::istream* OpenInput(std::string const& filename, bool bEnd) ;
 
 #ifdef _WIN32
 #define compare_no_case(a,b,n)  _strnicmp( (a), (b), (n) )
diff --git a/Utilities/otbliblas/apps/oci_wrapper.cpp b/Utilities/otbliblas/apps/oci_wrapper.cpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/apps/oci_wrapper.h b/Utilities/otbliblas/apps/oci_wrapper.h
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/apps/ts2las.cpp b/Utilities/otbliblas/apps/ts2las.cpp
index 8bb08e145b4f7c989ab532da4355a556d28397a3..3692a056a5df244320f99eceb01825d27dad8e84 100755
--- a/Utilities/otbliblas/apps/ts2las.cpp
+++ b/Utilities/otbliblas/apps/ts2las.cpp
@@ -120,7 +120,6 @@ bool ReadHeader(ScanHdr* hdr, std::istream* istrm)
         return false;
     }    
 
-    return true;
 }
 
 bool WritePoints(liblas::Writer* writer, std::istream* strm, ScanHdr* hdr) 
@@ -136,9 +135,9 @@ bool WritePoints(liblas::Writer* writer, std::istream* strm, ScanHdr* hdr)
             {
                 // std::cout << "stream position is: " << strm->tellg() << std::endl;
                 if (hdr->HdrVersion == 20020715) {
-                    detail::read_n(*point, *strm, sizeof(ScanPnt));
+                    liblas::detail::read_n(*point, *strm, sizeof(ScanPnt));
                 } else{
-                    detail::read_n(*row, *strm, sizeof(ScanRow));
+                    liblas::detail::read_n(*row, *strm, sizeof(ScanRow));
                     point->Pnt.x = row->x;
                     point->Pnt.y = row->y;
                     point->Pnt.z = row->z;
@@ -149,8 +148,7 @@ bool WritePoints(liblas::Writer* writer, std::istream* strm, ScanHdr* hdr)
                 }
                 Point p;
 
-                p.SetCoordinates(writer->GetHeader(),
-                                    point->Pnt.x,
+                p.SetCoordinates( point->Pnt.x,
                                     point->Pnt.y,
                                     point->Pnt.z);
 
@@ -160,8 +158,8 @@ bool WritePoints(liblas::Writer* writer, std::istream* strm, ScanHdr* hdr)
                 p.SetClassification(point->Code);
                 p.SetIntensity(point->Intensity);
                 if (hdr->Time) {
-                    liblas::uint32_t t = 0xFFFFFFFF;
-                    detail::read_n(t, *strm, sizeof(t));
+                    boost::uint32_t t = 0xFFFFFFFF;
+                    liblas::detail::read_n(t, *strm, sizeof(t));
 
                     // Time stamps are assumed to be GPS week seconds. The 
                     // storage format is a 32 bit unsigned integer where 
@@ -170,15 +168,15 @@ bool WritePoints(liblas::Writer* writer, std::istream* strm, ScanHdr* hdr)
                     p.SetTime(t*0.0002);
                 }
                 if (hdr->Color) {
-                    liblas::uint8_t r, g, b, a = 0;
+                    boost::uint8_t r, g, b, a = 0;
                     liblas::Color color;
-                    detail::read_n(r, *strm, sizeof(r));
-                    detail::read_n(b, *strm, sizeof(b));
-                    detail::read_n(g, *strm, sizeof(g));
+                    liblas::detail::read_n(r, *strm, sizeof(r));
+                    liblas::detail::read_n(b, *strm, sizeof(b));
+                    liblas::detail::read_n(g, *strm, sizeof(g));
                     
                     // TS .bin says to read 4 bytes here for some reason.  Maybe 
                     // this is an alpha value or something
-                    detail::read_n(a, *strm, sizeof(a));
+                    liblas::detail::read_n(a, *strm, sizeof(a));
                     
                     color.SetGreen(g);
                     color.SetBlue(b);
diff --git a/Utilities/otbliblas/apps/ts2las.hpp b/Utilities/otbliblas/apps/ts2las.hpp
index 4b44c5aaf319f2d525e5a1b16f83545400e247c9..dccc1bb10ca3814daacd9f320edeb968cd2f59a5 100755
--- a/Utilities/otbliblas/apps/ts2las.hpp
+++ b/Utilities/otbliblas/apps/ts2las.hpp
@@ -2,9 +2,8 @@
 
 #include <liblas/detail/private_utility.hpp>
 
-#include <liblas/laswriter.hpp>
-#include <liblas/laspoint.hpp>
-#include <liblas/lascolor.hpp>
+#include <liblas/liblas.hpp>
+
 #include <iostream>
 #ifdef _WIN32
 #define compare_no_case(a,b,n)  _strnicmp( (a), (b), (n) )
@@ -25,13 +24,13 @@ struct ScanRow
         z(0)
     {}
 
-    liblas::uint8_t Code;
-    liblas::uint8_t Line;
-    liblas::uint16_t EchoInt;
+    boost::uint8_t Code;
+    boost::uint8_t Line;
+    boost::uint16_t EchoInt;
 
-    liblas::int32_t x;
-    liblas::int32_t y;
-    liblas::int32_t z;
+    boost::int32_t x;
+    boost::int32_t y;
+    boost::int32_t z;
 
 };
 
@@ -44,9 +43,9 @@ struct Point3d
         z(0)
     {}
 
-    liblas::int32_t x;
-    liblas::int32_t y;
-    liblas::int32_t z;
+    boost::int32_t x;
+    boost::int32_t y;
+    boost::int32_t z;
 
 };
 
@@ -62,12 +61,12 @@ struct ScanPnt
     {}
 
     Point3d Pnt;
-    liblas::uint8_t Code;
-    liblas::uint8_t Echo;
-    liblas::uint8_t Flag;
-    liblas::uint8_t Mark;
-    liblas::uint16_t Line;
-    liblas::uint16_t Intensity;
+    boost::uint8_t Code;
+    boost::uint8_t Echo;
+    boost::uint8_t Flag;
+    boost::uint8_t Mark;
+    boost::uint16_t Line;
+    boost::uint16_t Intensity;
 
 };
 
@@ -87,17 +86,17 @@ struct ScanHdr
         Color(0)
     {}
 
-    liblas::int32_t HdrSize;
-    liblas::int32_t HdrVersion;
-    liblas::int32_t Tunniste;
+    boost::int32_t HdrSize;
+    boost::int32_t HdrVersion;
+    boost::int32_t Tunniste;
     char Magic[4];
-    liblas::int32_t PntCnt;
-    liblas::int32_t Units;
+    boost::int32_t PntCnt;
+    boost::int32_t Units;
     double OrgX;
     double OrgY;
     double OrgZ;
-    liblas::int32_t Time;
-    liblas::int32_t Color;
+    boost::int32_t Time;
+    boost::int32_t Color;
 
     // 
     // int HdrSize;
diff --git a/Utilities/otbliblas/buildout/bootstrap.py b/Utilities/otbliblas/buildout/bootstrap.py
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/cmake/modules/BuildOSGeo4W.cmake b/Utilities/otbliblas/cmake/modules/BuildOSGeo4W.cmake
old mode 100755
new mode 100644
index bd609ac97c9cd77e63cb862cfb07fc7274fe701c..53c86b2ae0527f753a9abab30b0abd9bd7a6f563
--- a/Utilities/otbliblas/cmake/modules/BuildOSGeo4W.cmake
+++ b/Utilities/otbliblas/cmake/modules/BuildOSGeo4W.cmake
@@ -7,7 +7,11 @@
 MESSAGE(STATUS "Building osgeo4w binaries")
 set(OSGEO4W_DIR osgeo4w)
 set(OSGEO4W_LIB_DIR ${OSGEO4W_DIR}/lib)
+set(OSGEO4W_ETC_DIR ${OSGEO4W_DIR}/etc)
+set(OSGEO4W_ETC_INI_DIR ${OSGEO4W_DIR}/etc/ini)
+set(OSGEO4W_ETC_POSTINSTALL_DIR ${OSGEO4W_DIR}/etc/postinstall)
 set(OSGEO4W_LIB_BIN_DIR ${OSGEO4W_DIR}/lib/bin)
+set(OSGEO4W_BIN_DIR ${OSGEO4W_DIR}/bin)
 set(OSGEO4W_DEVEL_DIR ${OSGEO4W_DIR}/devel)
 set(OSGEO4W_DEVEL_INCLUDE_DIR ${OSGEO4W_DEVEL_DIR}/include)
 set(OSGEO4W_DEVEL_INCLUDE_LIBLAS_DIR ${OSGEO4W_DEVEL_INCLUDE_DIR}/liblas)
@@ -20,6 +24,9 @@ set(OSGEO4W_PACKAGES ${OSGEO4W_DIR}/packages)
 
 set(OSGEO4W_DIRECTORIES
     ${OSGEO4W_DIR}
+    ${OSGEO4W_ETC_DIR}
+    ${OSGEO4W_ETC_INI_DIR}
+    ${OSGEO4W_ETC_POSTINSTALL_DIR}
     ${OSGEO4W_LIB_DIR}
     ${OSGEO4W_LIB_BIN_DIR}
     ${OSGEO4W_DEVEL_DIR}
@@ -28,14 +35,15 @@ set(OSGEO4W_DIRECTORIES
     ${OSGEO4W_DEVEL_LIB_DIR}
     ${OSGEO4W_PYTHON_DIR}
     ${OSGEO4W_DEVEL_BIN_DIR}
-    ${OSGEO4W_PACKAGES})
+    ${OSGEO4W_PACKAGES}
+    ${OSGEO4W_BIN_DIR})
 
 
 
 add_custom_target(make_osgeo4w_directories
   COMMAND ${CMAKE_COMMAND} -E echo "Building OSGeo4W install directories")
 
-add_dependencies(  make_osgeo4w_directories las2las2  )
+add_dependencies(  make_osgeo4w_directories las2las )
 
 macro (make_directories)
     add_custom_command(
@@ -78,34 +86,62 @@ macro(copy_files GLOBPAT DESTINATION  )
 endmacro(copy_files)
 
 
+macro(copy_directory SOURCE DESTINATION  )
+    
+    MESSAGE(STATUS "   Copying ${SOURCE} to ${DESTINATION}")
+        add_custom_command(
+            TARGET copy
+            COMMAND ${CMAKE_COMMAND} -E copy_directory ${SOURCE} ${DESTINATION}
+        )
+endmacro(copy_directory)
+
+
 add_custom_target(tar
   COMMAND ${CMAKE_COMMAND} -E echo "Tarring OSGeo4W install")
 add_dependencies( tar copy  )
 
-macro (tar_directories source destination base_path)
+macro (tar_directories source destination base_paths)
 
     MESSAGE(STATUS "   Tarring ${source} to ${destination}")
+    
     add_custom_command(
         TARGET tar
-        COMMAND ${CMAKE_COMMAND} -E chdir ${source} cmake -E tar czf  ${destination} ${base_path}/
+        COMMAND ${CMAKE_COMMAND} -E chdir ${source} cmake -E tar cjf  ${destination} ${base_paths}
     )
 
 
 endmacro(tar_directories)
 
 make_directories()
-copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/las* ${OSGEO4W_DEVEL_BIN_DIR}/  )
-copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/*[.${SO_EXT}] ${OSGEO4W_DEVEL_BIN_DIR}/  )
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/lasinfo.exe ${OSGEO4W_BIN_DIR}/lasinfo.exe  )
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/lasinfo-old.exe ${OSGEO4W_BIN_DIR}/lasinfo-old.exe   )
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/las2las.exe ${OSGEO4W_BIN_DIR}/las2las.exe  )
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/las2las-old.exe ${OSGEO4W_BIN_DIR}/las2las-old.exe  )
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/las2ogr.exe ${OSGEO4W_BIN_DIR}/las2ogr.exe   )
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/las2oci.exe ${OSGEO4W_BIN_DIR}/las2oci.exe  )
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/las2txt.exe ${OSGEO4W_BIN_DIR}/las2txt.exe  )
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/lasblock.exe ${OSGEO4W_BIN_DIR}/lasblock.exe   )
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/lasmerge.exe ${OSGEO4W_BIN_DIR}/lasmerge.exe  )
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/txt2las.exe ${OSGEO4W_BIN_DIR}/txt2las.exe  )
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/ts2las.exe ${OSGEO4W_BIN_DIR}/ts2las.exe  )
+
+
+
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/liblas_c.dll ${OSGEO4W_BIN_DIR}/  )
+copy_files(${libLAS_SOURCE_DIR}/liblas-osgeo4w-start.bat.tmpl ${OSGEO4W_BIN_DIR}/liblas.bat.tmpl )
+copy_files(${libLAS_SOURCE_DIR}/liblas-osgeo4w-init.bat ${OSGEO4W_ETC_INI_DIR}/liblas.bat )
+copy_files(${libLAS_SOURCE_DIR}/liblas-osgeo4w-postinstall.bat ${OSGEO4W_ETC_POSTINSTALL_DIR}/liblas.bat )
+
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/liblas.lib ${OSGEO4W_DEVEL_LIB_DIR}/  )
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/liblas_c.lib ${OSGEO4W_DEVEL_LIB_DIR}/  )
 
-copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/*.lib ${OSGEO4W_DEVEL_LIB_DIR}/  )
-copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/*.a ${OSGEO4W_DEVEL_LIB_DIR}/  )
 
-copy_files(./include/liblas/* ${OSGEO4W_DEVEL_INCLUDE_LIBLAS_DIR}/  )
+copy_directory(./include/liblas/ ${OSGEO4W_DEVEL_INCLUDE_LIBLAS_DIR}/  )
 copy_files(./python/liblas/*.py ${OSGEO4W_PYTHON_DIR}/  )
 
-tar_directories(${OSGEO4W_DEVEL_DIR} ${libLAS_SOURCE_DIR}/${OSGEO4W_PACKAGES}/liblas-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.tar.gz bin)
-tar_directories(${OSGEO4W_DIR} ${libLAS_SOURCE_DIR}/${OSGEO4W_PACKAGES}/liblas-python-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.tar.gz apps)
-tar_directories(${OSGEO4W_DIR} ${libLAS_SOURCE_DIR}/${OSGEO4W_PACKAGES}/liblas-devel-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.tar.gz devel)
+tar_directories(${OSGEO4W_DIR} ${libLAS_SOURCE_DIR}/${OSGEO4W_PACKAGES}/liblas-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${OSGEO4W_UPSTREAM_RELEASE}.tar.bz2 "bin/;etc/")
+tar_directories(${OSGEO4W_DIR} ${libLAS_SOURCE_DIR}/${OSGEO4W_PACKAGES}/liblas-python-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${OSGEO4W_UPSTREAM_RELEASE}.tar.bz2 apps)
+tar_directories(${OSGEO4W_DIR}/devel ${libLAS_SOURCE_DIR}/${OSGEO4W_PACKAGES}/liblas-devel-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${OSGEO4W_UPSTREAM_RELEASE}.tar.bz2 "lib/;include")
 
 
 add_custom_target(osgeo4w
diff --git a/Utilities/otbliblas/cmake/modules/FindGDAL.cmake b/Utilities/otbliblas/cmake/modules/FindGDAL.cmake
old mode 100755
new mode 100644
index a6a54c6a6eefa5a6e997e813aefe7df131b9fa4c..3760894f1ba92da4f57851cfa8eff2556ec70875
--- a/Utilities/otbliblas/cmake/modules/FindGDAL.cmake
+++ b/Utilities/otbliblas/cmake/modules/FindGDAL.cmake
@@ -55,6 +55,7 @@ IF(WIN32)
             NAMES gdal.h 
             PATH_PREFIXES gdal gdal-1.6
             PATHS
+            "${OSGEO4W_ROOT_DIR}/apps/gdal-dev/include"
             "$ENV{LIB_DIR}/include/gdal"
             ${OSGEO4W_ROOT_DIR}/include)
 
@@ -66,6 +67,7 @@ IF(WIN32)
             "$ENV{LIB_DIR}/lib"
             /usr/lib
             c:/msys/local/lib
+            "${OSGEO4W_ROOT_DIR}/apps/gdal-dev/lib"            
             ${OSGEO4W_ROOT_DIR}/lib)
         
         IF(GDAL_LIBRARY)
diff --git a/Utilities/otbliblas/cmake/modules/FindGeoTIFF.cmake b/Utilities/otbliblas/cmake/modules/FindGeoTIFF.cmake
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/cmake/modules/FindOracle.cmake b/Utilities/otbliblas/cmake/modules/FindOracle.cmake
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/cmake/modules/FindSpatialIndex.cmake b/Utilities/otbliblas/cmake/modules/FindSpatialIndex.cmake
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/cmake_install.cmake b/Utilities/otbliblas/cmake_install.cmake
old mode 100755
new mode 100644
index 2bd7bb7aa3064f0f49f95d51a0c0038029868718..3c09b670176b7799830d26be0a9f9dd66251f6ae
--- a/Utilities/otbliblas/cmake_install.cmake
+++ b/Utilities/otbliblas/cmake_install.cmake
@@ -1,4 +1,4 @@
-# Install script for directory: /tmp/liblas-main
+# Install script for directory: /tmp/liblas
 
 # Set the install prefix
 IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
@@ -29,19 +29,19 @@ ENDIF(NOT CMAKE_INSTALL_COMPONENT)
 
 IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
   FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/share/liblas/doc" TYPE FILE FILES
-    "/tmp/liblas-main/AUTHORS"
-    "/tmp/liblas-main/COPYING"
-    "/tmp/liblas-main/INSTALL"
-    "/tmp/liblas-main/LICENSE.txt"
-    "/tmp/liblas-main/README.txt"
+    "/tmp/liblas/AUTHORS"
+    "/tmp/liblas/COPYING"
+    "/tmp/liblas/INSTALL"
+    "/tmp/liblas/LICENSE.txt"
+    "/tmp/liblas/README.txt"
     )
 ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
 
 IF(NOT CMAKE_INSTALL_LOCAL_ONLY)
   # Include the install script for each subdirectory.
-  INCLUDE("/tmp/liblas-main/src/cmake_install.cmake")
-  INCLUDE("/tmp/liblas-main/apps/cmake_install.cmake")
-  INCLUDE("/tmp/liblas-main/test/cmake_install.cmake")
+  INCLUDE("/tmp/liblas/src/cmake_install.cmake")
+  INCLUDE("/tmp/liblas/apps/cmake_install.cmake")
+  INCLUDE("/tmp/liblas/test/cmake_install.cmake")
 
 ENDIF(NOT CMAKE_INSTALL_LOCAL_ONLY)
 
@@ -51,7 +51,7 @@ ELSE(CMAKE_INSTALL_COMPONENT)
   SET(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
 ENDIF(CMAKE_INSTALL_COMPONENT)
 
-FILE(WRITE "/tmp/liblas-main/${CMAKE_INSTALL_MANIFEST}" "")
+FILE(WRITE "/tmp/liblas/${CMAKE_INSTALL_MANIFEST}" "")
 FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES})
-  FILE(APPEND "/tmp/liblas-main/${CMAKE_INSTALL_MANIFEST}" "${file}\n")
+  FILE(APPEND "/tmp/liblas/${CMAKE_INSTALL_MANIFEST}" "${file}\n")
 ENDFOREACH(file)
diff --git a/Utilities/otbliblas/csharp/HelloWorldLAS/HelloWorldLAS.csproj b/Utilities/otbliblas/csharp/HelloWorldLAS/HelloWorldLAS.csproj
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/HelloWorldLAS/HelloWorldLAS_Express.csproj b/Utilities/otbliblas/csharp/HelloWorldLAS/HelloWorldLAS_Express.csproj
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/HelloWorldLAS/Program.cs b/Utilities/otbliblas/csharp/HelloWorldLAS/Program.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/HelloWorldLAS/Properties/AssemblyInfo.cs b/Utilities/otbliblas/csharp/HelloWorldLAS/Properties/AssemblyInfo.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/NUnitTest/LASFilesClass.cs b/Utilities/otbliblas/csharp/NUnitTest/LASFilesClass.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/NUnitTest/LASGuidTest.cs b/Utilities/otbliblas/csharp/NUnitTest/LASGuidTest.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/NUnitTest/LASHeaderTest.cs b/Utilities/otbliblas/csharp/NUnitTest/LASHeaderTest.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/NUnitTest/LASPointTest.cs b/Utilities/otbliblas/csharp/NUnitTest/LASPointTest.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/NUnitTest/LASReaderTest.cs b/Utilities/otbliblas/csharp/NUnitTest/LASReaderTest.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/NUnitTest/LASVariableLengthRecordTest.cs b/Utilities/otbliblas/csharp/NUnitTest/LASVariableLengthRecordTest.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/NUnitTest/LASWriterTest.cs b/Utilities/otbliblas/csharp/NUnitTest/LASWriterTest.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/NUnitTest/NUnitTest.csproj b/Utilities/otbliblas/csharp/NUnitTest/NUnitTest.csproj
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/NUnitTest/NUnitTest_Express.csproj b/Utilities/otbliblas/csharp/NUnitTest/NUnitTest_Express.csproj
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/NUnitTest/Properties/AssemblyInfo.cs b/Utilities/otbliblas/csharp/NUnitTest/Properties/AssemblyInfo.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/Samples/Read_Express/ReadLAS.cs b/Utilities/otbliblas/csharp/Samples/Read_Express/ReadLAS.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/Samples/Read_Express/Read_Express.csproj b/Utilities/otbliblas/csharp/Samples/Read_Express/Read_Express.csproj
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/Samples/WriteLAS/Properties/AssemblyInfo.cs b/Utilities/otbliblas/csharp/Samples/WriteLAS/Properties/AssemblyInfo.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/Samples/WriteLAS/Write_Express.csproj b/Utilities/otbliblas/csharp/Samples/WriteLAS/Write_Express.csproj
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/dotnetLibLAS/AssemblyInfo.cs b/Utilities/otbliblas/csharp/dotnetLibLAS/AssemblyInfo.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/dotnetLibLAS/LASException.cs b/Utilities/otbliblas/csharp/dotnetLibLAS/LASException.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/dotnetLibLAS/LASGuid.cs b/Utilities/otbliblas/csharp/dotnetLibLAS/LASGuid.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/dotnetLibLAS/LASHeader.cs b/Utilities/otbliblas/csharp/dotnetLibLAS/LASHeader.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/dotnetLibLAS/LASPoint.cs b/Utilities/otbliblas/csharp/dotnetLibLAS/LASPoint.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/dotnetLibLAS/LASReader.cs b/Utilities/otbliblas/csharp/dotnetLibLAS/LASReader.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/dotnetLibLAS/LASVariableLengthRecord.cs b/Utilities/otbliblas/csharp/dotnetLibLAS/LASVariableLengthRecord.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/dotnetLibLAS/LASWriter.cs b/Utilities/otbliblas/csharp/dotnetLibLAS/LASWriter.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/dotnetLibLAS/LibLASCAPI.cs b/Utilities/otbliblas/csharp/dotnetLibLAS/LibLASCAPI.cs
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/dotnetLibLAS/dotnetLibLAS.csproj b/Utilities/otbliblas/csharp/dotnetLibLAS/dotnetLibLAS.csproj
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/dotnetLibLAS/dotnetLibLAS.dll.config b/Utilities/otbliblas/csharp/dotnetLibLAS/dotnetLibLAS.dll.config
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/dotnetLibLAS/dotnetLibLAS_Express.csproj b/Utilities/otbliblas/csharp/dotnetLibLAS/dotnetLibLAS_Express.csproj
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/dotnetLibLAS/dotnetLibLas.xml b/Utilities/otbliblas/csharp/dotnetLibLAS/dotnetLibLas.xml
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/csharp/dotnetLibLAS/liblas.snk b/Utilities/otbliblas/csharp/dotnetLibLAS/liblas.snk
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/CMakeLists.txt b/Utilities/otbliblas/include/CMakeLists.txt
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/capi/las_config.h b/Utilities/otbliblas/include/liblas/capi/las_config.h
old mode 100755
new mode 100644
index 695878ad0e57bac6dad2e5722699e30e2fdbb27c..f84e15254eb1c84020dc5cea52ad04a91127e46a
--- a/Utilities/otbliblas/include/liblas/capi/las_config.h
+++ b/Utilities/otbliblas/include/liblas/capi/las_config.h
@@ -55,17 +55,9 @@
 #  define LAS_C_END
 #endif
 
-#ifndef LAS_DLL
-#if defined(_MSC_VER) && !defined(LAS_DISABLE_DLL)
-#  define LAS_DLL     __declspec(dllexport)
-#else
-#  if defined(USE_GCC_VISIBILITY_FLAG)
-#    define LAS_DLL     __attribute__ ((visibility("default")))
-#  else
-#    define LAS_DLL
-#  endif
-#endif
-#endif
+LAS_C_START
+#include <liblas/export.hpp>
+LAS_C_END
 
 #ifndef NULL
 #define NULL 0
diff --git a/Utilities/otbliblas/include/liblas/capi/las_version.h b/Utilities/otbliblas/include/liblas/capi/las_version.h
old mode 100755
new mode 100644
index c86d0d126861179be1d75f46938806c6a0d774e2..d67015e3c3d04bc0b61774619ba5dd3093a2160a
--- a/Utilities/otbliblas/include/liblas/capi/las_version.h
+++ b/Utilities/otbliblas/include/liblas/capi/las_version.h
@@ -45,7 +45,7 @@
 #ifndef LIBLAS_VERSION_MAJOR
 #define LIBLAS_VERSION_MAJOR    1
 #define LIBLAS_VERSION_MINOR    6
-#define LIBLAS_VERSION_REV      0b1
+#define LIBLAS_VERSION_REV      0b2
 #define LIBLAS_VERSION_BUILD    0
 #endif
 
@@ -54,11 +54,11 @@
 #endif
 
 #ifndef LIBLAS_RELEASE_DATE
-#define LIBLAS_RELEASE_DATE     20101012
+#define LIBLAS_RELEASE_DATE     20101105
 #endif
 
 #ifndef LIBLAS_RELEASE_NAME
-#define LIBLAS_RELEASE_NAME     "1.6.0b1"
+#define LIBLAS_RELEASE_NAME     "1.6.0b2"
 #endif
 
 #endif /* LAS_VERSION_H_INCLUDED */
diff --git a/Utilities/otbliblas/include/liblas/capi/liblas.h b/Utilities/otbliblas/include/liblas/capi/liblas.h
index c9a5f5923cfe0f032491e39c5838f3e625ed2041..31e178cdfb7471f6ad74266a3a2c4b3a74f2348c 100755
--- a/Utilities/otbliblas/include/liblas/capi/liblas.h
+++ b/Utilities/otbliblas/include/liblas/capi/liblas.h
@@ -46,6 +46,7 @@
 
 #include "las_version.h"
 #include "las_config.h"
+#include <liblas/export.hpp>
 
 typedef struct LASWriterHS *LASWriterH;
 typedef struct LASReaderHS *LASReaderH;
@@ -1154,8 +1155,8 @@ LAS_DLL unsigned int LASSRS_GetVLRCount(const LASSRSH hSRS);
 */
 LAS_DLL void LASString_Free(char* string);
 
-LAS_DLL unsigned short LASSchema_GetByteSize( LASSchemaH hFormat);
-LAS_DLL unsigned short LASSchema_GetBaseByteSize( LASSchemaH hFormat);
+LAS_DLL unsigned int LASSchema_GetByteSize( LASSchemaH hFormat);
+LAS_DLL unsigned int LASSchema_GetBaseByteSize( LASSchemaH hFormat);
 
 
 
diff --git a/Utilities/otbliblas/include/liblas/compatibility.hpp b/Utilities/otbliblas/include/liblas/compatibility.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/detail/file_ptr_stream.hpp b/Utilities/otbliblas/include/liblas/detail/file_ptr_stream.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/detail/index/indexcell.hpp b/Utilities/otbliblas/include/liblas/detail/index/indexcell.hpp
old mode 100755
new mode 100644
index 2b9a16e945706b1a311677e867f39fe26b58b86f..3c0b53282078ca8d6070df2d5ef25e7d78a60c84
--- a/Utilities/otbliblas/include/liblas/detail/index/indexcell.hpp
+++ b/Utilities/otbliblas/include/liblas/detail/index/indexcell.hpp
@@ -55,6 +55,7 @@ typedef boost::uint32_t ElevRange;
 typedef boost::uint8_t	ConsecPtAccumulator;
 typedef std::map<boost::uint32_t, ConsecPtAccumulator> IndexCellData;
 typedef std::map<boost::uint32_t, IndexCellData> IndexSubCellData;
+typedef boost::uint64_t	TempFileOffsetType;
 
 class IndexCell
 {
@@ -62,7 +63,7 @@ public:
 	IndexCell();
 	
 private:
-	boost::uint32_t m_FileOffset;
+	TempFileOffsetType m_FileOffset;
 	boost::uint32_t m_NumPoints;
 	ElevExtrema m_MinZ, m_MaxZ;
 	IndexCellData m_PtRecords;
@@ -70,15 +71,15 @@ private:
 	IndexSubCellData m_SubCellRecords;
 
 public:
-	void SetFileOffset(boost::uint32_t fos);
+	void SetFileOffset(TempFileOffsetType fos);
 	void SetNumPoints(boost::uint32_t nmp);
-	boost::uint32_t GetFileOffset(void) const;
+	TempFileOffsetType GetFileOffset(void) const;
 	boost::uint32_t GetNumRecords(void) const;
 	boost::uint32_t GetNumPoints(void) const;
 	boost::uint32_t GetNumSubCellRecords(void) const;
 	boost::uint32_t GetNumZCellRecords(void) const;
-	ElevExtrema GetMinZ(void) const {return m_MinZ;};
-	ElevExtrema GetMaxZ(void) const {return m_MaxZ;};
+	ElevExtrema GetMinZ(void) const {return m_MinZ;}
+	ElevExtrema GetMaxZ(void) const {return m_MaxZ;}
 	bool RoomToAdd(boost::uint32_t a);
 	void AddPointRecord(boost::uint32_t a);
 	void AddPointRecord(boost::uint32_t a, boost::uint8_t b);
@@ -98,8 +99,6 @@ public:
 	const IndexSubCellData::iterator GetEndSubCell(void);
 	const IndexSubCellData::iterator GetFirstZCellRecord(void);
 	const IndexSubCellData::iterator GetEndZCell(void);
-
-	
 };
 
 }} // namespace liblas::detail
diff --git a/Utilities/otbliblas/include/liblas/detail/index/indexoutput.hpp b/Utilities/otbliblas/include/liblas/detail/index/indexoutput.hpp
old mode 100755
new mode 100644
index 8d13ffc9f878d3cff60432bff2107d7901ed32ff..cd98529d6627b1f74e395e9516dfe27b99a6d511
--- a/Utilities/otbliblas/include/liblas/detail/index/indexoutput.hpp
+++ b/Utilities/otbliblas/include/liblas/detail/index/indexoutput.hpp
@@ -58,8 +58,8 @@ private:
 	liblas::Index *m_index;
 	liblas::VariableRecord m_indexVLRHeaderRecord, m_indexVLRCellRecord;
 	IndexVLRData m_indexVLRHeaderData, m_indexVLRCellPointData, m_indexVLRTempData;
-	boost::uint32_t m_VLRCommonDataSize, m_VLRDataSizeLocation, m_FirstCellLocation, m_LastCellLocation;
-	boost::uint32_t  m_DataRecordSize, m_TempWritePos;
+	boost::uint32_t m_VLRCommonDataSize, m_VLRDataSizeLocation, m_FirstCellLocation, m_LastCellLocation, m_VLRPointCountLocation;
+	boost::uint32_t  m_DataRecordSize, m_TempWritePos, m_DataPointsThisVLR;
 	bool m_FirstCellInVLR, m_SomeDataReadyToWrite;
 	
 protected:
diff --git a/Utilities/otbliblas/include/liblas/detail/pointrecord.hpp b/Utilities/otbliblas/include/liblas/detail/pointrecord.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/detail/private_utility.hpp b/Utilities/otbliblas/include/liblas/detail/private_utility.hpp
old mode 100755
new mode 100644
index 75e63c274b2a94cf474811dae9be7514d8594e2b..fa3ab3491eb3c57778132c9fdf8131b5154fa3a4
--- a/Utilities/otbliblas/include/liblas/detail/private_utility.hpp
+++ b/Utilities/otbliblas/include/liblas/detail/private_utility.hpp
@@ -223,19 +223,6 @@ bool operator!=(Point<T> const& lhs, Point<T> const& rhs)
 //     return (!lhs.equal(rhs));
 // }
 
-template <typename T>
-inline T generate_random_byte()
-{
-    // Requires pseudo-random numbers generator to be initialized
-    // in create_random_based() function - a poor man solution.
-    T const rmin = (std::numeric_limits<T>::min)();
-    T const rmax = (std::numeric_limits<T>::max)();
-    unsigned int const rnd = std::rand() % rmax + rmin;
-
-    assert(rnd <= 255);
-    return static_cast<T>(rnd);
-}
-
 template <typename T> 
 bool compare_distance(const T& actual, const T& expected) 
 { 
diff --git a/Utilities/otbliblas/include/liblas/detail/reader/cachedreader.hpp b/Utilities/otbliblas/include/liblas/detail/reader/cachedreader.hpp
old mode 100755
new mode 100644
index 9861a434ede256de0e7fe36ef0ae21b6ba83b64e..42ac3a2fba375ece7b1326525befc7c81e889dcb
--- a/Utilities/otbliblas/include/liblas/detail/reader/cachedreader.hpp
+++ b/Utilities/otbliblas/include/liblas/detail/reader/cachedreader.hpp
@@ -89,6 +89,7 @@ private:
 
     typedef std::vector<liblas::Point> cache_type;
     cache_type m_cache;
+    bool m_cache_initialized;
 };
 
 
diff --git a/Utilities/otbliblas/include/liblas/detail/reader/point.hpp b/Utilities/otbliblas/include/liblas/detail/reader/point.hpp
index adedad5d6ea2cf93cd9885d5b75255b1ee26805b..8f053fa97d5f380a284b184fab983ca2eb0dad19 100755
--- a/Utilities/otbliblas/include/liblas/detail/reader/point.hpp
+++ b/Utilities/otbliblas/include/liblas/detail/reader/point.hpp
@@ -81,9 +81,6 @@ private:
     HeaderPtr m_header;
     liblas::Point m_point;
     std::vector<boost::uint8_t> m_raw_data;
-    
-    void setup();
-
 };
 
 
diff --git a/Utilities/otbliblas/include/liblas/exception.hpp b/Utilities/otbliblas/include/liblas/exception.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/export.hpp b/Utilities/otbliblas/include/liblas/export.hpp
new file mode 100755
index 0000000000000000000000000000000000000000..11f52af3b4a2c76f2a23ece52a6f95ad49533ed2
--- /dev/null
+++ b/Utilities/otbliblas/include/liblas/export.hpp
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * $Id$
+ *
+ * Project:  libLAS - http://liblas.org - A BSD library for LAS format data.
+ * Purpose:  LAS DLL export macros file
+ * Author:   Howard Butler, hobu@hobu.net
+ *
+ ******************************************************************************
+ * Copyright (c) 2010, Howard Butler
+ *
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following 
+ * conditions are met:
+ * 
+ *     * Redistributions of source code must retain the above copyright 
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright 
+ *       notice, this list of conditions and the following disclaimer in 
+ *       the documentation and/or other materials provided 
+ *       with the distribution.
+ *     * Neither the name of the Martin Isenburg or Iowa Department 
+ *       of Natural Resources nor the names of its contributors may be 
+ *       used to endorse or promote products derived from this software 
+ *       without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
+ * OF SUCH DAMAGE.
+ ****************************************************************************/
+
+#ifndef LASEXPORT_HPP_INCLUDED
+#define LASEXPORT_HPP_INCLUDED
+
+#ifndef LAS_DLL
+#if defined(_MSC_VER) && !defined(LAS_DISABLE_DLL)
+#if defined(LAS_DLL_EXPORT)
+#   define LAS_DLL   __declspec(dllexport)
+#elif defined(LAS_DLL_IMPORT)
+#   define LAS_DLL   __declspec(dllimport)
+#endif
+#else
+#  if defined(USE_GCC_VISIBILITY_FLAG)
+#    define LAS_DLL     __attribute__ ((visibility("default")))
+#  else
+#    define LAS_DLL
+#  endif
+#endif
+#endif
+
+#ifdef _MSC_VER
+#pragma warning(disable:4251 4275)
+#endif // _MSC_VER
+
+#endif // LIBLAS_HPP_INCLUDED
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/exception_implementation.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/exception_implementation.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/file_parser_error.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/file_parser_error.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/info_parser_error.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/info_parser_error.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/info_parser_read.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/info_parser_read.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/info_parser_utils.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/info_parser_utils.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/info_parser_write.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/info_parser_write.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/info_parser_writer_settings.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/info_parser_writer_settings.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/json_parser_error.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/json_parser_error.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/json_parser_read.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/json_parser_read.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/json_parser_write.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/json_parser_write.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/ptree_implementation.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/ptree_implementation.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/ptree_utils.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/ptree_utils.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/rapidxml.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/rapidxml.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/xml_parser_error.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/xml_parser_error.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/xml_parser_flags.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/xml_parser_flags.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/xml_parser_read_rapidxml.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/xml_parser_read_rapidxml.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/xml_parser_utils.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/xml_parser_utils.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/xml_parser_write.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/xml_parser_write.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/detail/xml_parser_writer_settings.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/detail/xml_parser_writer_settings.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/exceptions.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/exceptions.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/id_translator.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/id_translator.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/info_parser.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/info_parser.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/ini_parser.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/ini_parser.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/json_parser.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/json_parser.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/ptree.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/ptree.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/ptree_fwd.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/ptree_fwd.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/ptree_serialization.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/ptree_serialization.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/stream_translator.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/stream_translator.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/string_path.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/string_path.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/external/property_tree/xml_parser.hpp b/Utilities/otbliblas/include/liblas/external/property_tree/xml_parser.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/guid.hpp b/Utilities/otbliblas/include/liblas/guid.hpp
index 9cf2d3e950e30033d016d9ee523bc217f1d2faaf..b54d211d2e38553c5353fb681fb70a0925ded7c5 100755
--- a/Utilities/otbliblas/include/liblas/guid.hpp
+++ b/Utilities/otbliblas/include/liblas/guid.hpp
@@ -61,9 +61,11 @@
 
 #include <liblas/detail/sha1.hpp>
 #include <liblas/detail/private_utility.hpp>
+#include <liblas/export.hpp>
 // boost
 #include <boost/array.hpp>
 #include <boost/cstdint.hpp>
+#include <boost/random.hpp>
 // std
 #include <iosfwd>
 #include <iomanip>
@@ -79,6 +81,28 @@
 
 namespace liblas {
 
+namespace detail {
+
+	inline boost::uint8_t random_byte()
+    {
+        // Change seed to something better?
+
+        typedef boost::mt19937 engine_t;
+        typedef boost::uniform_int<unsigned long> distribution_t;
+        typedef boost::variate_generator<engine_t, distribution_t> generator_t;
+
+        static generator_t generator(
+            engine_t(static_cast<engine_t::result_type>( std::time(0) )),
+            // this line should work and does, but it produces lots of warnings
+            // thus we will use unsigned long and cast it to a uint8_t
+            //distribution_t((std::numeric_limits<uint8_t>::min)(), (std::numeric_limits<uint8_t>::max)()));
+            distribution_t((std::numeric_limits<unsigned long>::min)(), (std::numeric_limits<unsigned long>::max)()));
+
+		return static_cast<boost::uint8_t>(generator() & 0xFF);
+    }
+
+} // namespace detail
+
 /// Definition of Globally Unique Identifier type.
 /// The GUID is a 16-byte (128-bit) number.
 /// This class is used to represent value stored as Project Identifier
@@ -88,7 +112,7 @@ namespace liblas {
 /// uniquely identify every LAS, globally.
 ///
 /// \see About GUID in Wikipedia http://en.wikipedia.org/wiki/Globally_Unique_Identifier 
-class guid
+class LAS_DLL guid
 {
 public:
 
@@ -418,7 +442,7 @@ private:
         
         for (size_t i = 0; i < result.data_.size(); i++)
         {
-            result.data_[i] = detail::generate_random_byte<boost::uint8_t>();
+            result.data_[i] = detail::random_byte();
         }
     
         // set variant
diff --git a/Utilities/otbliblas/include/liblas/iterator.hpp b/Utilities/otbliblas/include/liblas/iterator.hpp
index 05e3f91774d7def8cd1704c293f21250247275a8..def1aa478c6a1869b1809398d3f572bb5a9f684d 100755
--- a/Utilities/otbliblas/include/liblas/iterator.hpp
+++ b/Utilities/otbliblas/include/liblas/iterator.hpp
@@ -45,6 +45,7 @@
 #include <liblas/lasreader.hpp>
 #include <liblas/laswriter.hpp>
 #include <liblas/lasindex.hpp>
+#include <liblas/export.hpp>
 #include <iterator>
 #include <cassert>
 
@@ -56,7 +57,7 @@ namespace liblas {
 /// \sa About Input Iterator at http://www.sgi.com/tech/stl/InputIterator.html
 ///
 template <typename T>
-class reader_iterator
+class LAS_DLL reader_iterator
 {
 public:
 
@@ -157,7 +158,7 @@ bool operator!=(reader_iterator<T> const& lhs, reader_iterator<T> const& rhs)
 /// \sa About Output Iterator at http://www.sgi.com/tech/stl/OutputIterator.html
 ///
 template <typename T>
-class writer_iterator
+class LAS_DLL writer_iterator
 {
 public:
 
@@ -182,8 +183,9 @@ public:
     {
         assert(0 != m_writer);
 
-        bool const ret = m_writer->WritePoint(value);
-        assert(ret); // TODO: Low-level debugging
+        bool ret = false;
+        ret = m_writer->WritePoint(value);
+        assert(ret);
 
         return (*this);
     }
@@ -305,6 +307,12 @@ typedef reader_iterator<Point> lasreader_iterator;
 /// Public specialization of LASWriter output iterator for liblas::LASPoint type.
 typedef writer_iterator<Point> laswriter_iterator;
 
+// Needed for C++ DLL exports
+#ifdef _MSC_VER
+template class LAS_DLL reader_iterator<Point>;
+template class LAS_DLL writer_iterator<Point>;
+#endif
+
 } // namespace liblas
 
 #endif // LIBLAS_ITERATOR_HPP_INCLUDED
diff --git a/Utilities/otbliblas/include/liblas/lasbounds.hpp b/Utilities/otbliblas/include/liblas/lasbounds.hpp
old mode 100755
new mode 100644
index 982cd0ed2ec1e70f46750041e65b88f4c0d8a610..19335c817719dc3cd964074498ab7591e58df6f2
--- a/Utilities/otbliblas/include/liblas/lasbounds.hpp
+++ b/Utilities/otbliblas/include/liblas/lasbounds.hpp
@@ -46,7 +46,7 @@
 #include <liblas/laspoint.hpp>
 #include <liblas/lastransform.hpp>
 #include <liblas/detail/private_utility.hpp>
-
+#include <liblas/export.hpp>
 // boost
 #include <boost/cstdint.hpp>
 
@@ -62,14 +62,16 @@
 namespace liblas {
 
 template <typename T>
-class Range
+class LAS_DLL Range
 {
 public:
     T min;
     T max;
-    
+
+	typedef T value_type;
+
     Range(T mmin=std::numeric_limits<T>::max(), T mmax=std::numeric_limits<T>::min())
-        : min(mmin), max(mmax) {};
+        : min(mmin), max(mmax) {}
     
 
     Range(Range const& other)
@@ -127,7 +129,7 @@ public:
     
     bool empty(void) const 
     {
-        return min==std::numeric_limits<T>::max() && max==std::numeric_limits<T>::min();
+        return detail::compare_distance(min, std::numeric_limits<T>::max()) && detail::compare_distance(max, std::numeric_limits<T>::min());
     }
     
     void shift(T v) 
@@ -157,6 +159,13 @@ public:
         if (v > max)
             max = v;
     }
+
+    void grow(Range const& r) 
+    {
+        grow(r.min);
+        grow(r.max);
+    }
+
     T length() const
     {
         return max - min;
@@ -168,7 +177,7 @@ class Bounds
 {
 public:
 
-
+	typedef T value_type;
     typedef typename std::vector< Range<T> >::size_type size_type;
     
     typedef typename std::vector< Range<T> > RangeVec;
@@ -426,6 +435,8 @@ bool contains(Bounds const& other) const
     for (size_type i = 0; i < dimension(); i++) {
         if ( ranges[i].contains(other.ranges[i]) )
             return true;
+        else // As soon as it is not contains, we're false
+            return false;
     }
     return true;
 }
@@ -524,7 +535,7 @@ void grow(Point const& p)
 
 T volume() const
 {
-    T output;
+    T output = T();
     for (size_type i = 0; i < dimension(); i++) {
         output = output * ranges[i].length();
     }
@@ -576,6 +587,13 @@ Bounds<T> project(liblas::SpatialReference const& in_ref, liblas::SpatialReferen
 };
 
 
+
 } // namespace liblas
 
+// Needed for C++ DLL exports
+#ifdef _MSC_VER
+template class LAS_DLL liblas::Range<double>;
+template class LAS_DLL liblas::Bounds<double>;
+#endif
+
 #endif // ndef LIBLAS_LASBOUNDS_HPP_INCLUDED
diff --git a/Utilities/otbliblas/include/liblas/lasclassification.hpp b/Utilities/otbliblas/include/liblas/lasclassification.hpp
old mode 100755
new mode 100644
index c80bdf21105ef23f476f738d642df3a3550b4e02..635fdc1f1478b5461602060ab4bdf587bacc4a1f
--- a/Utilities/otbliblas/include/liblas/lasclassification.hpp
+++ b/Utilities/otbliblas/include/liblas/lasclassification.hpp
@@ -44,6 +44,7 @@
 
 // boost
 #include <boost/cstdint.hpp>
+#include <liblas/export.hpp>
 // std
 #include <cassert>
 #include <cstddef>
@@ -56,7 +57,7 @@ namespace liblas {
 
 /// Class definition to manipulate properties of point record classification.
 ///
-class Classification
+class LAS_DLL Classification
 {
 public:
 
diff --git a/Utilities/otbliblas/include/liblas/lascolor.hpp b/Utilities/otbliblas/include/liblas/lascolor.hpp
index c894e38c47b96de011b9112fddfb84611120ab61..02e47a91956c6fb984443db61c181462ac106ff7 100755
--- a/Utilities/otbliblas/include/liblas/lascolor.hpp
+++ b/Utilities/otbliblas/include/liblas/lascolor.hpp
@@ -41,6 +41,8 @@
 #ifndef LIBLAS_LASCOLOR_HPP_INCLUDED
 #define LIBLAS_LASCOLOR_HPP_INCLUDED
 
+#include <liblas/export.hpp>
+
 // boost
 #include <boost/array.hpp>
 #include <boost/cstdint.hpp>
@@ -50,7 +52,7 @@
 namespace liblas {
 
 /// RGB color container
-class Color
+class LAS_DLL Color
 {
 public:
 
diff --git a/Utilities/otbliblas/include/liblas/lasdimension.hpp b/Utilities/otbliblas/include/liblas/lasdimension.hpp
old mode 100755
new mode 100644
index a00598c194889f08fee41b5708ab032e731c04b7..97c1e69c80bf525434305186368a22aef9fe6912
--- a/Utilities/otbliblas/include/liblas/lasdimension.hpp
+++ b/Utilities/otbliblas/include/liblas/lasdimension.hpp
@@ -46,6 +46,7 @@
 #include <liblas/external/property_tree/ptree.hpp>
 #include <liblas/lasvariablerecord.hpp>
 #include <liblas/lasversion.hpp>
+#include <liblas/export.hpp>
 // boost
 #include <boost/cstdint.hpp>
 #include <boost/any.hpp>
@@ -59,7 +60,6 @@
 #include <boost/multi_index/hashed_index.hpp>
 #include <boost/multi_index/sequenced_index.hpp>
 
-
 // std
 #include <iosfwd>
 #include <limits>
@@ -71,14 +71,14 @@
 namespace liblas {  
 
 /// Dimension definition
-class Dimension
+class LAS_DLL Dimension
 {
 public:
     Dimension(std::string const& name, std::size_t size_in_bits);
     Dimension& operator=(Dimension const& rhs);
     Dimension(Dimension const& other);
         
-    virtual ~Dimension() {};
+    virtual ~Dimension() {}
         
     inline std::string const& GetName() const { return m_name; }
     
diff --git a/Utilities/otbliblas/include/liblas/laserror.hpp b/Utilities/otbliblas/include/liblas/laserror.hpp
index d7b9aa44d7a5fd8a8b909f0be059cd5de66d49b4..0e3ef0c32a1fe76132d254e4953e89f5eb5fe582 100755
--- a/Utilities/otbliblas/include/liblas/laserror.hpp
+++ b/Utilities/otbliblas/include/liblas/laserror.hpp
@@ -44,6 +44,7 @@
 #ifndef LIBLAS_LASERROR_HPP_INCLUDED
 #define LIBLAS_LASERROR_HPP_INCLUDED
 
+#include <liblas/export.hpp>
 //std
 #include <iosfwd>
 #include <string>
@@ -54,7 +55,7 @@ namespace liblas {
 /// This class describes details of error condition occured in
 /// libLAS core. All errors are stacked by C API layer, so it's
 /// possible to track problem down to its source.
-class Error
+class LAS_DLL Error
 {
 public:
 
@@ -73,9 +74,9 @@ public:
     // TODO - mloskot: What about replacing string return by copy with const char* ?
     //        char const* GetMethod() const { return m_method.c_str(); }, etc.
 
-    int GetCode() const { return m_code; };
-    std::string GetMessage() const { return m_message; };
-    std::string GetMethod() const { return m_method; };    
+    int GetCode() const { return m_code; }
+    std::string GetMessage() const { return m_message; }
+    std::string GetMethod() const { return m_method; }   
 
 private:
 
diff --git a/Utilities/otbliblas/include/liblas/lasfilter.hpp b/Utilities/otbliblas/include/liblas/lasfilter.hpp
old mode 100755
new mode 100644
index 099c13c26e6f65a3340bbb1acb07e4f7e0537460..8d0684adf92eeba9953fb05906a7d608b11d2ea3
--- a/Utilities/otbliblas/include/liblas/lasfilter.hpp
+++ b/Utilities/otbliblas/include/liblas/lasfilter.hpp
@@ -46,6 +46,7 @@
 #include <liblas/lasheader.hpp>
 #include <liblas/laspoint.hpp>
 #include <liblas/detail/fwd.hpp>
+#include <liblas/export.hpp>
 // boost
 #include <boost/cstdint.hpp>
 #include <boost/function.hpp>
@@ -59,7 +60,7 @@
 namespace liblas {
 
 /// Defines public interface to LAS filter implementation.
-class FilterI
+class LAS_DLL FilterI
 {
 public:
     
@@ -83,7 +84,7 @@ public:
     /// Gets the type of filter.
     FilterType GetType() const {return m_type; }
 
-    virtual ~FilterI() {};
+    virtual ~FilterI() {}
 
     /// Base constructor.  Initializes the FilterType
     FilterI(FilterType t) : m_type(t) {}
@@ -100,7 +101,7 @@ typedef boost::shared_ptr<FilterI> FilterPtr;
 
 /// A filter for keeping or rejecting points that fall within a 
 /// specified bounds.
-class BoundsFilter: public FilterI
+class LAS_DLL BoundsFilter: public FilterI
 {
 public:
     
@@ -118,7 +119,7 @@ private:
 };
 
 /// A filter for keeping or rejecting a list of classification ids
-class ClassificationFilter: public FilterI
+class LAS_DLL ClassificationFilter: public FilterI
 {
 public:
     
@@ -136,7 +137,7 @@ private:
 };
 
 /// A filter simple decimation
-class ThinFilter: public liblas::FilterI
+class LAS_DLL ThinFilter: public liblas::FilterI
 {
 public:
     
@@ -156,7 +157,7 @@ private:
 
 
 /// A filter for keeping or rejecting a list of return ids.
-class ReturnFilter: public FilterI
+class LAS_DLL ReturnFilter: public FilterI
 {
 public:
     
@@ -175,7 +176,7 @@ private:
 };
 
 
-class ValidationFilter: public FilterI
+class LAS_DLL ValidationFilter: public FilterI
 {
 public:
 
@@ -194,7 +195,7 @@ private:
 /// from the liblas::Point class.  See laskernel.cpp for examples 
 /// how to use it for filtering intensity and time values.  
 template <typename T>
-class ContinuousValueFilter: public FilterI
+class LAS_DLL ContinuousValueFilter: public FilterI
 {
     
 
@@ -225,10 +226,9 @@ public:
     /// liblas::ContinuousValueFilter<uint16_t>::filter_func f = &liblas::Point::GetIntensity;
     /// liblas::ContinuousValueFilter<uint16_t>* intensity_filter = new liblas::ContinuousValueFilter<uint16_t>(f, 100, c);
     /// intensity_filter->SetType(liblas::FilterI::eInclusion);
-    ContinuousValueFilter(filter_func f, T value, compare_func c) :
-        liblas::FilterI(eInclusion), f(f), c(c),value(value)
-            {};
-
+    ContinuousValueFilter(filter_func f, T value, compare_func c)
+        : liblas::FilterI(eInclusion), f(f), c(c),value(value)
+    {}
 
         
     /// Construct the filter with a filter_func and a simple 
@@ -258,8 +258,8 @@ public:
     /// liblas::ContinuousValueFilter<uint16_t>* intensity_filter = new liblas::ContinuousValueFilter<uint16_t>(f, intensities);
     /// intensity_filter->SetType(liblas::FilterI::eInclusion);
     
-    ContinuousValueFilter(filter_func f, std::string const& filter_string) :
-        liblas::FilterI(eInclusion), f(f) 
+    ContinuousValueFilter(filter_func f, std::string const& filter_string)
+        : liblas::FilterI(eInclusion), f(f)
     {
         compare_func compare;
 
@@ -308,13 +308,10 @@ public:
         
         value =  boost::lexical_cast<T>(out);
         // std::cout << "Value is: " << value << " pos " << pos << " out " << out << std::endl;
-
-
-    };
+    }
             
     bool filter(const liblas::Point& p)
     {
-
         bool output = false;
 
         T v = f(&p);
@@ -369,7 +366,7 @@ private:
 };
 
 /// A filter for color ranges
-class ColorFilter: public FilterI
+class LAS_DLL ColorFilter: public FilterI
 {
 public:
 
diff --git a/Utilities/otbliblas/include/liblas/lasheader.hpp b/Utilities/otbliblas/include/liblas/lasheader.hpp
old mode 100755
new mode 100644
index bcc5e8b39c722141b6cc6af4fbeddc667bd13d60..1ee9f6c5645514ad1f33439a63c70c9a3ba63d41
--- a/Utilities/otbliblas/include/liblas/lasheader.hpp
+++ b/Utilities/otbliblas/include/liblas/lasheader.hpp
@@ -50,6 +50,7 @@
 #include <liblas/lasvariablerecord.hpp>
 #include <liblas/lasversion.hpp>
 #include <liblas/external/property_tree/ptree.hpp>
+#include <liblas/export.hpp>
 // boost
 #include <boost/cstdint.hpp>
 #include <boost/foreach.hpp>
@@ -71,7 +72,7 @@ namespace liblas {
 /// \todo  TODO (low-priority): replace static-size char arrays as data members
 ///        with std::string and return const-reference to string object.
 ///
-class Header
+class LAS_DLL Header
 {
 public:
 
@@ -406,22 +407,23 @@ private:
     Schema m_schema;
 };
 
-std::ostream& operator<<(std::ostream& os, liblas::Header const&);
+LAS_DLL std::ostream& operator<<(std::ostream& os, liblas::Header const&);
 
 /// Singleton used for all empty points upon construction.  If 
 /// a reader creates the point, the HeaderPtr from the file that was 
 /// read will be used, but all stand-alone points will have EmptyHeader 
 /// as their base.
-class DefaultHeader
+class LAS_DLL DefaultHeader
 {
 public:
-    virtual ~DefaultHeader() {};
+    virtual ~DefaultHeader() {}
     
     static Header const& get() 
     {
         static Header object;
         return object;
     }
+
 protected:
     DefaultHeader();
     DefaultHeader( DefaultHeader const&);
@@ -430,8 +432,6 @@ protected:
 };
 
 
-
-
 } // namespace liblas
 
 #endif // LIBLAS_LASHEADER_HPP_INCLUDED
diff --git a/Utilities/otbliblas/include/liblas/lasindex.hpp b/Utilities/otbliblas/include/liblas/lasindex.hpp
index c02457922817916775329aa04d1f19b39642dec8..9ff339e914097305a2097a0ae790a7b87730168d 100755
--- a/Utilities/otbliblas/include/liblas/lasindex.hpp
+++ b/Utilities/otbliblas/include/liblas/lasindex.hpp
@@ -47,6 +47,7 @@
 #include <liblas/lasbounds.hpp>
 #include <liblas/lasvariablerecord.hpp>
 #include <liblas/detail/index/indexcell.hpp>
+#include <liblas/export.hpp>
 
 // std
 #include <stdexcept> // std::out_of_range
@@ -58,13 +59,14 @@
 namespace liblas {
 
 #define LIBLAS_INDEX_MAXMEMDEFAULT	10000000	// 10 megs default
-#define LIBLAS_INDEX_MINMEMDEFAULT	100000	// 1 meg at least has to be allowed
+#define LIBLAS_INDEX_MINMEMDEFAULT	1000000	// 1 meg at least has to be allowed
 #define LIBLAS_INDEX_VERSIONMAJOR	1
-#define LIBLAS_INDEX_VERSIONMINOR	0
+#define LIBLAS_INDEX_VERSIONMINOR	1	// minor version 1 begins 10/12/10
 #define LIBLAS_INDEX_MAXSTRLEN	512
 #define LIBLAS_INDEX_MAXCELLS	250000
 #define LIBLAS_INDEX_OPTPTSPERCELL	100
 #define LIBLAS_INDEX_MAXPTSPERCELL	1000
+#define LIBLAS_INDEX_RESERVEFILTERDEFAULT	1000000	// 1 million points will be reserved on large files for filter result
 
 // define this in order to fix problem with last bytes of last VLR getting corrupted
 // when saved and reloaded from index or las file.
@@ -74,8 +76,8 @@ typedef std::vector<boost::uint8_t> IndexVLRData;
 typedef std::vector<liblas::detail::IndexCell> IndexCellRow;
 typedef std::vector<IndexCellRow>	IndexCellDataBlock;
 
-class liblas::detail::IndexCell;
-class IndexData;
+class LAS_DLL IndexData;
+class LAS_DLL IndexIterator;
 
 // Index class is the fundamental object for building and filtering a spatial index of points in an LAS file.
 // An Index class doesn't do anything until it is configured with an IndexData object (see below).
@@ -114,7 +116,7 @@ class IndexData;
 // Currently only one, two or three dimensional spatial window filters are supported. See IndexData below for 
 //		more info on filtering.
 
-class Index
+class LAS_DLL Index
 {
 public:
 	Index();
@@ -136,15 +138,11 @@ private:
 	Bounds<double> m_bounds;
 	bool m_indexBuilt, m_tempFileStarted, m_readerCreated, m_readOnly, m_writestandaloneindex, m_forceNewIndex;
 	int m_debugOutputLevel;
+	boost::uint8_t m_versionMajor, m_versionMinor;
     boost::uint32_t m_pointRecordsCount, m_maxMemoryUsage, m_cellsX, m_cellsY, m_cellsZ, m_totalCells, 
-		m_tempFileWrittenBytes, m_DataVLR_ID;
-    boost::int32_t m_LowXCellCompletelyIn, m_HighXCellCompletelyIn, m_LowYCellCompletelyIn, m_HighYCellCompletelyIn,
-		m_LowZCellCompletelyIn, m_HighZCellCompletelyIn;
-    boost::int32_t m_LowXBorderCell, m_HighXBorderCell, m_LowYBorderCell, m_HighYBorderCell,
-		m_LowZBorderCell, m_HighZBorderCell;
+		m_DataVLR_ID;
+    liblas::detail::TempFileOffsetType m_tempFileWrittenBytes;
     double m_rangeX, m_rangeY, m_rangeZ, m_cellSizeZ, m_cellSizeX, m_cellSizeY;
-	double m_filterMinXCell, m_filterMaxXCell, m_filterMinYCell, m_filterMaxYCell, m_filterMinZCell, m_filterMaxZCell,
-		m_LowXBorderPartCell, m_HighXBorderPartCell, m_LowYBorderPartCell, m_HighYBorderPartCell;
 	std::string m_tempFileName;	
 	std::string m_indexAuthor;
 	std::string m_indexComment;
@@ -159,9 +157,14 @@ private:
     void ClearOldIndex(void);
 	bool BuildIndex(void);
 	bool Validate(void);
+	boost::uint32_t GetDefaultReserve(void);
 	bool LoadIndexVLR(VariableRecord const& vlr);
-	void SetCellFilterBounds(IndexData const& ParamSrc);
-	bool FilterOneVLR(VariableRecord const& vlr, boost::uint32_t& i, IndexData const& ParamSrc);
+	void SetCellFilterBounds(IndexData & ParamSrc);
+	bool FilterOneVLR(VariableRecord const& vlr, boost::uint32_t& i, IndexData & ParamSrc, bool & VLRDone);
+	bool FilterPointSeries(boost::uint32_t & PointID, boost::uint32_t & PointsScanned, 
+		boost::uint32_t const PointsToIgnore, boost::uint32_t const x, boost::uint32_t const y, boost::uint32_t const z, 
+		liblas::detail::ConsecPtAccumulator const ConsecutivePts, IndexIterator *Iterator, 
+		IndexData const& ParamSrc);
 	bool VLRInteresting(boost::int32_t MinCellX, boost::int32_t MinCellY, boost::int32_t MaxCellX, boost::int32_t MaxCellY, 
 		IndexData const& ParamSrc);
 	bool CellInteresting(boost::int32_t x, boost::int32_t y, IndexData const& ParamSrc);
@@ -190,9 +193,9 @@ private:
 	// Creates a Writer from m_ofs and re-saves LAS header with new index, but not with data point records
 	bool SaveIndexInStandAloneFile(void);
 	// Calculate index bounds dimensions
-	void CalcRangeX(void)	{m_rangeX = m_bounds.max(0) - m_bounds.min(0);};
-	void CalcRangeY(void)	{m_rangeY = m_bounds.max(1) - m_bounds.min(1);};
-	void CalcRangeZ(void)	{m_rangeZ = m_bounds.max(2) - m_bounds.min(2);};
+	void CalcRangeX(void)	{m_rangeX = m_bounds.max(0) - m_bounds.min(0);}
+	void CalcRangeY(void)	{m_rangeY = m_bounds.max(1) - m_bounds.min(1);}
+	void CalcRangeZ(void)	{m_rangeZ = m_bounds.max(2) - m_bounds.min(2);}
 
 	// error messages
 	bool FileError(const char *Reporter);
@@ -211,69 +214,76 @@ private:
 	
 public:
 	// IndexFailed and IndexReady can be used to tell if an Index is ready for a filter operation
-    bool IndexFailed(void)  const {return (! m_indexBuilt);};
-    bool IndexReady(void)  const {return (m_indexBuilt);};
+    bool IndexFailed(void)  const {return (! m_indexBuilt);}
+    bool IndexReady(void)  const {return (m_indexBuilt);}
     // Prep takes the input data and initializes Index values and then either builds or examines the Index
     bool Prep(IndexData const& ParamSrc);
     // Filter performs a point filter using the bounds in ParamSrc
-    const std::vector<boost::uint32_t>& Filter(IndexData const& ParamSrc);
+    const std::vector<boost::uint32_t>& Filter(IndexData & ParamSrc);
+    IndexIterator* Filter(IndexData const& ParamSrc, boost::uint32_t ChunkSize);
+    IndexIterator* Filter(double LowFilterX, double HighFilterX, double LowFilterY, double HighFilterY, 
+		double LowFilterZ, double HighFilterZ, boost::uint32_t ChunkSize);
+    IndexIterator* Filter(Bounds<double> const& BoundsSrc, boost::uint32_t ChunkSize);
+    
     // Return the bounds of the current Index
-	double GetMinX(void) const	{return m_bounds.min(0);};
-	double GetMaxX(void) const	{return m_bounds.max(0);};
-	double GetMinY(void) const	{return m_bounds.min(1);};
-	double GetMaxY(void) const	{return m_bounds.max(1);};
-	double GetMinZ(void) const	{return m_bounds.min(2);};
-	double GetMaxZ(void) const	{return m_bounds.max(2);};
+	double GetMinX(void) const	{return m_bounds.min(0);}
+	double GetMaxX(void) const	{return m_bounds.max(0);}
+	double GetMinY(void) const	{return m_bounds.min(1);}
+	double GetMaxY(void) const	{return m_bounds.max(1);}
+	double GetMinZ(void) const	{return m_bounds.min(2);}
+	double GetMaxZ(void) const	{return m_bounds.max(2);}
 	// Ranges are updated when an index is built or the index header VLR read
-	double GetRangeX(void) const	{return m_rangeX;};
-	double GetRangeY(void) const	{return m_rangeY;};
-	double GetRangeZ(void) const	{return m_rangeZ;};
-	Bounds<double> const& GetBounds(void) const	{return m_bounds;};
+	double GetRangeX(void) const	{return m_rangeX;}
+	double GetRangeY(void) const	{return m_rangeY;}
+	double GetRangeZ(void) const	{return m_rangeZ;}
+	Bounds<double> const& GetBounds(void) const	{return m_bounds;}
 	// Return the number of points used to build the Index
-	boost::uint32_t GetPointRecordsCount(void) const	{return m_pointRecordsCount;};
+	boost::uint32_t GetPointRecordsCount(void) const	{return m_pointRecordsCount;}
 	// Return the number of cells in the Index
-	boost::uint32_t GetCellsX(void) const	{return m_cellsX;};
-	boost::uint32_t GetCellsY(void) const	{return m_cellsY;};
+	boost::uint32_t GetCellsX(void) const	{return m_cellsX;}
+	boost::uint32_t GetCellsY(void) const	{return m_cellsY;}
 	// Return the number of Z-dimension cells in the Index. Value is 1 if no Z-cells were created during Index building
-	boost::uint32_t GetCellsZ(void) const	{return m_cellsZ;};
+	boost::uint32_t GetCellsZ(void) const	{return m_cellsZ;}
 	// 42 is the ID for the Index header VLR and 43 is the normal ID for the Index data VLR's
 	// For future expansion, multiple indexes could assign data VLR ID's of their own choosing
-	boost::uint32_t GetDataVLR_ID(void) const	{return m_DataVLR_ID;};
+	boost::uint32_t GetDataVLR_ID(void) const	{return m_DataVLR_ID;}
 	// Since the user can define a Z cell size it is useful to examine that for an existing index
-	double GetCellSizeZ(void) const	{return m_cellSizeZ;};
+	double GetCellSizeZ(void) const	{return m_cellSizeZ;}
 	// Return values used in building or examining index
-	FILE *GetDebugger(void) const	{return m_debugger;};
-	bool GetReadOnly(void) const	{return m_readOnly;};
-	bool GetStandaloneIndex(void) const	{return m_writestandaloneindex;};
-	bool GetForceNewIndex(void) const	{return m_forceNewIndex;};
-	boost::uint32_t GetMaxMemoryUsage(void) const	{return m_maxMemoryUsage;};
-	int GetDebugOutputLevel(void) const {return m_debugOutputLevel;};
+	FILE *GetDebugger(void) const	{return m_debugger;}
+	bool GetReadOnly(void) const	{return m_readOnly;}
+	bool GetStandaloneIndex(void) const	{return m_writestandaloneindex;}
+	bool GetForceNewIndex(void) const	{return m_forceNewIndex;}
+	boost::uint32_t GetMaxMemoryUsage(void) const	{return m_maxMemoryUsage;}
+	int GetDebugOutputLevel(void) const {return m_debugOutputLevel;}
 	// Not sure if these are more useful than dangerous
-	Header *GetPointHeader(void) {return &m_pointheader;};
-	Header *GetIndexHeader(void) {return &m_idxheader;};
-	Reader *GetReader(void) const {return m_reader;};
-	Reader *GetIndexReader(void) const {return m_idxreader;};
-	const char *GetTempFileName(void) const {return m_tempFileName.c_str();};
+	Header *GetPointHeader(void) {return &m_pointheader;}
+	Header *GetIndexHeader(void) {return &m_idxheader;}
+	Reader *GetReader(void) const {return m_reader;}
+	Reader *GetIndexReader(void) const {return m_idxreader;}
+	const char *GetTempFileName(void) const {return m_tempFileName.c_str();}
 	// Returns the strings set in the index when built
 	const char *GetIndexAuthorStr(void)  const;
 	const char *GetIndexCommentStr(void)  const;
 	const char *GetIndexDateStr(void)  const;
+	boost::uint8_t GetVersionMajor(void) const	{return m_versionMajor;}
+	boost::uint8_t GetVersionMinor(void) const	{return m_versionMinor;}
 	// Methods for setting values used when reading index from file to facilitate moving reading function into
 	// separate IndexInput object at a future time to provide symmetry with IndexOutput
-	void SetDataVLR_ID(boost::uint32_t DataVLR_ID)	{m_DataVLR_ID = DataVLR_ID;};
-	void SetIndexAuthorStr(const char *ias)	{m_indexAuthor = ias;};
-	void SetIndexCommentStr(const char *ics)	{m_indexComment = ics;};
-	void SetIndexDateStr(const char *ids)	{m_indexDate = ids;};
-	void SetMinX(double minX)	{m_bounds.min(0, minX);};
-	void SetMaxX(double maxX)	{m_bounds.max(0, maxX);};
-	void SetMinY(double minY)	{m_bounds.min(1, minY);};
-	void SetMaxY(double maxY)	{m_bounds.max(1, maxY);};
-	void SetMinZ(double minZ)	{m_bounds.min(2, minZ);};
-	void SetMaxZ(double maxZ)	{m_bounds.max(2, maxZ);};
-	void SetPointRecordsCount(boost::uint32_t prc)	{m_pointRecordsCount = prc;};
-	void SetCellsX(boost::uint32_t cellsX)	{m_cellsX = cellsX;};
-	void SetCellsY(boost::uint32_t cellsY)	{m_cellsY = cellsY;};
-	void SetCellsZ(boost::uint32_t cellsZ)	{m_cellsZ = cellsZ;};
+	void SetDataVLR_ID(boost::uint32_t DataVLR_ID)	{m_DataVLR_ID = DataVLR_ID;}
+	void SetIndexAuthorStr(const char *ias)	{m_indexAuthor = ias;}
+	void SetIndexCommentStr(const char *ics)	{m_indexComment = ics;}
+	void SetIndexDateStr(const char *ids)	{m_indexDate = ids;}
+	void SetMinX(double minX)	{m_bounds.min(0, minX);}
+	void SetMaxX(double maxX)	{m_bounds.max(0, maxX);}
+	void SetMinY(double minY)	{m_bounds.min(1, minY);}
+	void SetMaxY(double maxY)	{m_bounds.max(1, maxY);}
+	void SetMinZ(double minZ)	{m_bounds.min(2, minZ);}
+	void SetMaxZ(double maxZ)	{m_bounds.max(2, maxZ);}
+	void SetPointRecordsCount(boost::uint32_t prc)	{m_pointRecordsCount = prc;}
+	void SetCellsX(boost::uint32_t cellsX)	{m_cellsX = cellsX;}
+	void SetCellsY(boost::uint32_t cellsY)	{m_cellsY = cellsY;}
+	void SetCellsZ(boost::uint32_t cellsZ)	{m_cellsZ = cellsZ;}
 	
 }; 
 
@@ -333,9 +343,10 @@ public:
 //		system that a liblas::Header returns with the commands GetMin{X|Y|Z} and a liblas::Point returns with 
 //		Get{X|Y|Z}
 
-class IndexData
+class LAS_DLL IndexData
 {
 friend class Index;
+friend class IndexIterator;
 
 public:
 	IndexData(void);
@@ -383,7 +394,6 @@ public:
 		Index const& index);
 	bool SetFilterValues(Bounds<double> const& src, Index const& index);
 
-    // Blocked copying operations, declared but not defined.
     /// Copy constructor.
     IndexData(IndexData const& other);
     /// Assignment operator.
@@ -392,10 +402,12 @@ public:
 private:
 	void SetValues(void);
 	bool CalcFilterEnablers(void);
+	void Copy(IndexData const& other);
 	
 protected:
 	Reader *m_reader;
 	Reader *m_idxreader;
+	IndexIterator *m_iterator;
 	Bounds<double> m_filter;
 	std::istream *m_ifs;
 	std::ostream *m_ofs;
@@ -404,44 +416,102 @@ protected:
 	const char *m_indexComment;
 	const char *m_indexDate;
 	double m_cellSizeZ;
+	double m_LowXBorderPartCell, m_HighXBorderPartCell, m_LowYBorderPartCell, m_HighYBorderPartCell;
+    boost::int32_t m_LowXCellCompletelyIn, m_HighXCellCompletelyIn, m_LowYCellCompletelyIn, m_HighYCellCompletelyIn,
+		m_LowZCellCompletelyIn, m_HighZCellCompletelyIn;
+    boost::int32_t m_LowXBorderCell, m_HighXBorderCell, m_LowYBorderCell, m_HighYBorderCell,
+		m_LowZBorderCell, m_HighZBorderCell;
 	boost::uint32_t m_maxMemoryUsage;
 	int m_debugOutputLevel;
 	bool m_noFilterX, m_noFilterY, m_noFilterZ, m_readOnly, m_writestandaloneindex, m_forceNewIndex, m_indexValid;
 	FILE *m_debugger;
+
+	void SetIterator(IndexIterator *setIt) {m_iterator = setIt;}
+	IndexIterator *GetIterator(void) {return(m_iterator);}
 	
 public:
-	double GetCellSizeZ(void) const	{return m_cellSizeZ;};
-	FILE *GetDebugger(void) const	{return m_debugger;};
-	bool GetReadOnly(void) const	{return m_readOnly;};
-	bool GetStandaloneIndex(void) const	{return m_writestandaloneindex;};
-	bool GetForceNewIndex(void) const	{return m_forceNewIndex;};
-	boost::uint32_t GetMaxMemoryUsage(void) const	{return m_maxMemoryUsage;};
-	Reader *GetReader(void) const {return m_reader;};
-	int GetDebugOutputLevel(void) const {return m_debugOutputLevel;};
-	const char *GetTempFileName(void) const {return m_tempFileName;};
+	double GetCellSizeZ(void) const	{return m_cellSizeZ;}
+	FILE *GetDebugger(void) const	{return m_debugger;}
+	bool GetReadOnly(void) const	{return m_readOnly;}
+	bool GetStandaloneIndex(void) const	{return m_writestandaloneindex;}
+	bool GetForceNewIndex(void) const	{return m_forceNewIndex;}
+	boost::uint32_t GetMaxMemoryUsage(void) const	{return m_maxMemoryUsage;}
+	Reader *GetReader(void) const {return m_reader;}
+	int GetDebugOutputLevel(void) const {return m_debugOutputLevel;}
+	const char *GetTempFileName(void) const {return m_tempFileName;}
 	const char *GetIndexAuthorStr(void)  const;
 	const char *GetIndexCommentStr(void)  const;
 	const char *GetIndexDateStr(void)  const;
-	double GetMinFilterX(void) const	{return m_filter.min(0);};
-	double GetMaxFilterX(void) const	{return m_filter.max(0);};
-	double GetMinFilterY(void) const	{return m_filter.min(1);};
-	double GetMaxFilterY(void) const	{return m_filter.max(1);};
-	double GetMinFilterZ(void) const	{return m_filter.min(2);};
-	double GetMaxFilterZ(void) const	{return m_filter.max(2);};
+	double GetMinFilterX(void) const	{return m_filter.min(0);}
+	double GetMaxFilterX(void) const	{return m_filter.max(0);}
+	double GetMinFilterY(void) const	{return m_filter.min(1);}
+	double GetMaxFilterY(void) const	{return m_filter.max(1);}
+	double GetMinFilterZ(void) const	{return m_filter.min(2);}
+	double GetMaxFilterZ(void) const	{return m_filter.max(2);}
 	void ClampFilterBounds(Bounds<double> const& m_bounds);
-	void SetReader(Reader *reader)	{m_reader = reader;};
-	void SetIStream(std::istream *ifs)	{m_ifs = ifs;};
-	void SetOStream(std::ostream *ofs)	{m_ofs = ofs;};
-	void SetTmpFileName(const char *tmpfilenme)	{m_tempFileName = tmpfilenme;};
-	void SetIndexAuthor(const char *indexauthor)	{m_indexAuthor = indexauthor;};
-	void SetIndexComment(const char *indexcomment)	{m_indexComment = indexcomment;};
-	void SetIndexDate(const char *indexdate)	{m_indexDate = indexdate;};
-	void SetCellSizeZ(double cellsizez)	{m_cellSizeZ = cellsizez;};
-	void SetMaxMem(boost::uint32_t maxmem)	{m_maxMemoryUsage = maxmem;};
-	void SetDebugOutputLevel(int debugoutputlevel)	{m_debugOutputLevel = debugoutputlevel;};
-	void SetReadOnly(bool readonly)	{m_readOnly = readonly;};
-	void SetStandaloneIndex(bool writestandaloneindex)	{m_writestandaloneindex = writestandaloneindex;};
-	void SetDebugger(FILE *debugger)	{m_debugger = debugger;};
+	void SetReader(Reader *reader)	{m_reader = reader;}
+	void SetIStream(std::istream *ifs)	{m_ifs = ifs;}
+	void SetOStream(std::ostream *ofs)	{m_ofs = ofs;}
+	void SetTmpFileName(const char *tmpfilenme)	{m_tempFileName = tmpfilenme;}
+	void SetIndexAuthor(const char *indexauthor)	{m_indexAuthor = indexauthor;}
+	void SetIndexComment(const char *indexcomment)	{m_indexComment = indexcomment;}
+	void SetIndexDate(const char *indexdate)	{m_indexDate = indexdate;}
+	void SetCellSizeZ(double cellsizez)	{m_cellSizeZ = cellsizez;}
+	void SetMaxMem(boost::uint32_t maxmem)	{m_maxMemoryUsage = maxmem;}
+	void SetDebugOutputLevel(int debugoutputlevel)	{m_debugOutputLevel = debugoutputlevel;}
+	void SetReadOnly(bool readonly)	{m_readOnly = readonly;}
+	void SetStandaloneIndex(bool writestandaloneindex)	{m_writestandaloneindex = writestandaloneindex;}
+	void SetDebugger(FILE *debugger)	{m_debugger = debugger;}
+};
+
+class LAS_DLL IndexIterator
+{
+friend class Index;
+
+protected:
+	IndexData m_indexData;
+	Index *m_index;
+	boost::uint32_t m_chunkSize, m_advance;
+	boost::uint32_t m_curVLR, m_curCellStartPos, m_curCellX, m_curCellY, m_totalPointsScanned, m_ptsScannedCurCell,
+		m_ptsScannedCurVLR;
+	boost::uint32_t m_conformingPtsFound;
+
+public:
+	IndexIterator(Index *IndexSrc, double LowFilterX, double HighFilterX, double LowFilterY, double HighFilterY, 
+		double LowFilterZ, double HighFilterZ, boost::uint32_t ChunkSize);
+	IndexIterator(Index *IndexSrc, IndexData const& IndexDataSrc, boost::uint32_t ChunkSize);
+	IndexIterator(Index *IndexSrc, Bounds<double> const& BoundsSrc, boost::uint32_t ChunkSize);
+    /// Copy constructor.
+ 	IndexIterator(IndexIterator const& other);
+    /// Assignment operator.
+    IndexIterator& operator=(IndexIterator const& rhs);
+private:
+ 	void Copy(IndexIterator const& other);
+	void ResetPosition(void);
+
+public:
+	/// n=0 or n=1 gives next sequence with no gap, n>1 skips n-1 filter-compliant points, n<0 skips backwards
+    const std::vector<boost::uint32_t>& advance(boost::int32_t n);
+    /// returns filter-compliant points beginning with the nth compliant point, 0 and 1 return first set of compliant points
+    const std::vector<boost::uint32_t>& operator()(boost::int32_t n);
+	/// returns next set of filter-compliant points with no skipped points
+	inline const std::vector<boost::uint32_t>& operator++()	{return (advance(1));}
+	/// returns next set of filter-compliant points with no skipped points
+	inline const std::vector<boost::uint32_t>& operator++(int)	{return (advance(1));}
+	/// returns set of filter-compliant points skipping backwards 1 from the end of the last set
+	inline const std::vector<boost::uint32_t>& operator--()	{return (advance(-1));}
+	/// returns set of filter-compliant points skipping backwards 1 from the end of the last set
+	inline const std::vector<boost::uint32_t>& operator--(int)	{return (advance(-1));}
+	/// returns next set of filter-compliant points with n-1 skipped points, for n<0 acts like -=()
+	inline const std::vector<boost::uint32_t>& operator+=(boost::int32_t n)	{return (advance(n));}
+	/// returns next set of filter-compliant points with n-1 skipped points, for n<0 acts like -()
+	inline const std::vector<boost::uint32_t>& operator+(boost::int32_t n)	{return (advance(n));}
+	/// returns set of filter-compliant points beginning n points backwards from the end of the last set, for n<0 acts like +=()
+	inline const std::vector<boost::uint32_t>& operator-=(boost::int32_t n)	{return (advance(-n));}
+	/// returns set of filter-compliant points beginning n points backwards from the end of the last set, for n<0 acts like +()
+	inline const std::vector<boost::uint32_t>& operator-(boost::int32_t n)	{return (advance(-n));}
+    /// returns filter-compliant points beginning with the nth compliant point, 0 and 1 return first set of compliant points
+	inline const std::vector<boost::uint32_t>& operator[](boost::int32_t n)	{return ((*this)(n));}
 };
 
 template <typename T, typename Q>
@@ -489,7 +559,7 @@ inline void ReadVLRDataNoInc_str(char * dest, IndexVLRData const& src, T const s
     if (static_cast<size_t>(pos) + static_cast<size_t>(srclen) > src.size())
 		throw std::out_of_range("liblas::detail::ReadVLRDataNoInc_str: array index out of range");
  	// copy srclen bytes to destination
-	memcpy(dest, &src[pos], srclen);
+    std::memcpy(dest, &src[pos], srclen);
 }
 
 } // namespace liblas
diff --git a/Utilities/otbliblas/include/liblas/laspoint.hpp b/Utilities/otbliblas/include/liblas/laspoint.hpp
index 2337a9ba72bf19f709b93fcc8f3b82712264fb2f..444e7b13f2e324add5361337e50e8d388a4610fc 100755
--- a/Utilities/otbliblas/include/liblas/laspoint.hpp
+++ b/Utilities/otbliblas/include/liblas/laspoint.hpp
@@ -49,6 +49,7 @@
 #include <liblas/detail/private_utility.hpp>
 #include <liblas/external/property_tree/ptree.hpp>
 #include <liblas/lasschema.hpp>
+#include <liblas/export.hpp>
 
 // boost
 #include <boost/array.hpp>
@@ -65,7 +66,7 @@ namespace liblas {
 
 
 /// Point data record composed with X, Y, Z coordinates and attributes.
-class Point
+class LAS_DLL Point
 {
 public:
 
@@ -243,7 +244,7 @@ inline double Point::operator[](std::size_t const& index) const
 }
 
 
-std::ostream& operator<<(std::ostream& os, liblas::Point const&);
+LAS_DLL std::ostream& operator<<(std::ostream& os, liblas::Point const&);
 
 
 } // namespace liblas
diff --git a/Utilities/otbliblas/include/liblas/lasreader.hpp b/Utilities/otbliblas/include/liblas/lasreader.hpp
old mode 100755
new mode 100644
index b1654d34acf92c107fc477721830420ae398d2f3..9a1a25a0585de2b98e5f26b865354d83f9553bfc
--- a/Utilities/otbliblas/include/liblas/lasreader.hpp
+++ b/Utilities/otbliblas/include/liblas/lasreader.hpp
@@ -50,6 +50,7 @@
 #include <liblas/lastransform.hpp>
 #include <liblas/lasfilter.hpp>
 #include <liblas/external/property_tree/ptree.hpp>
+#include <liblas/export.hpp>
 // boost
 #include <boost/cstdint.hpp>
 // std
@@ -63,7 +64,7 @@ namespace liblas {
 
 
 /// Defines public interface to LAS reader implementation.
-class Reader
+class LAS_DLL Reader
 {
 public:
 
@@ -72,14 +73,14 @@ public:
     /// @exception std::runtime_error - on failure state of the input stream.
     Reader(std::istream& ifs);
     Reader(std::istream& ifs, boost::uint32_t cache_size);
-    Reader(std::istream& ifs, boost::uint32_t cache_size, Header& header);
+    Reader(std::istream& ifs, boost::uint32_t cache_size, Header const& header);
     Reader(ReaderI* reader);
     
     
     /// User-defined consructor initializes reader with input stream and
     /// a header to override the values in the file
     /// @exception std::runtime_error - on failure state of the input stream.
-    Reader(std::istream& ifs, Header& header);
+    Reader(std::istream& ifs, Header const& header);
     
     /// Destructor.
     /// @exception nothrow
@@ -188,12 +189,9 @@ private:
     TransformPtr m_reprojection_transform;
 
     SpatialReference m_out_srs;
-    SpatialReference m_in_srs;
-    
+    SpatialReference m_in_srs;  
 };
 
-
-
 } // namespace liblas
 
 #endif // ndef LIBLAS_LASREADER_HPP_INCLUDED
diff --git a/Utilities/otbliblas/include/liblas/lasschema.hpp b/Utilities/otbliblas/include/liblas/lasschema.hpp
old mode 100755
new mode 100644
index e98fdd16fbf1ec4e04ac1aecb20aac82f3d4f3d8..7586da29e5ffb4e5c43d9bc48dbdad94552a8bc4
--- a/Utilities/otbliblas/include/liblas/lasschema.hpp
+++ b/Utilities/otbliblas/include/liblas/lasschema.hpp
@@ -47,6 +47,7 @@
 #include <liblas/lasvariablerecord.hpp>
 #include <liblas/lasversion.hpp>
 #include <liblas/lasdimension.hpp>
+#include <liblas/export.hpp>
 
 // boost
 #include <boost/cstdint.hpp>
@@ -63,7 +64,6 @@
 #include <boost/multi_index/mem_fun.hpp>
 #include <boost/multi_index/random_access_index.hpp>
 
-
 // std
 #include <iosfwd>
 #include <limits>
@@ -93,9 +93,7 @@ typedef multi_index_container<
     random_access<tag<index> >,
     // sort by less<string> on GetName
     hashed_unique<tag<name>, const_mem_fun<Dimension,std::string const&,&Dimension::GetName> >
-    
-
-  >
+      >
 > IndexMap;
 
 typedef IndexMap::index<name>::type index_by_name;
@@ -104,7 +102,7 @@ typedef IndexMap::index<index>::type index_by_index;
 
 
 /// Schema definition
-class Schema
+class LAS_DLL Schema
 {
 public:
     
@@ -114,7 +112,7 @@ public:
     Schema& operator=(Schema const& rhs);
     Schema(Schema const& other);
     
-    ~Schema() {};
+    ~Schema() {}
 
     /// Fetch byte size
     std::size_t GetByteSize() const;
@@ -174,7 +172,7 @@ bool inline sort_dimensions(Dimension i, Dimension j)
     return i < j; 
 }
 
-std::ostream& operator<<(std::ostream& os, liblas::Schema const&);
+LAS_DLL std::ostream& operator<<(std::ostream& os, liblas::Schema const&);
 
 
 } // namespace liblas
diff --git a/Utilities/otbliblas/include/liblas/lasspatialreference.hpp b/Utilities/otbliblas/include/liblas/lasspatialreference.hpp
old mode 100755
new mode 100644
index c6f85a711fb1b14e64e68221a0e5841153adeff7..e52a8fa37c5cebcd12d292db256b54cb23282b96
--- a/Utilities/otbliblas/include/liblas/lasspatialreference.hpp
+++ b/Utilities/otbliblas/include/liblas/lasspatialreference.hpp
@@ -47,15 +47,16 @@
 #include <liblas/lasvariablerecord.hpp>
 #include <liblas/exception.hpp>
 #include <liblas/capi/las_config.h>
+#include <liblas/export.hpp>
 #include <liblas/external/property_tree/ptree.hpp>
 
 // GDAL OSR
 #ifdef HAVE_GDAL
 #include <ogr_srs_api.h>
 #include <cpl_port.h>
-#include <cpl_serv.h>
-#include <geo_tiffp.h>
-#define CPL_ERROR_H_INCLUDED
+//#include <cpl_serv.h>
+//#include <geo_tiffp.h>
+//#define CPL_ERROR_H_INCLUDED
 #include <geo_normalize.h>
 #include <geovalues.h>
 #include <ogr_spatialref.h>
@@ -88,7 +89,7 @@ typedef struct ST_TIFFS *ST_TIFF;
 namespace liblas {
 
 /// Spatial Reference System container for libLAS
-class SpatialReference
+class LAS_DLL SpatialReference
 {
 public:
     enum WKTModeFlag
@@ -147,10 +148,10 @@ public:
     /// range 5100 to 5299 - implied by verticalCSType if that is provided, or 
     /// -1 if no value is available.
     /// \param verticalUnits - the EPSG vertical units code, often 9001 for Metre.
-    void SetVerticalCS(int verticalCSType, 
+    void SetVerticalCS(boost::int32_t verticalCSType, 
                        std::string const& citation = std::string(0),
-                       int verticalDatum = -1,
-                       int verticalUnits = 9001);
+                       boost::int32_t verticalDatum = -1,
+                       boost::int32_t verticalUnits = 9001);
 
     /// Sets the SRS using GDAL's SetFromUserInput function. If GDAL is not linked, this 
     /// operation has no effect.
diff --git a/Utilities/otbliblas/include/liblas/lastransform.hpp b/Utilities/otbliblas/include/liblas/lastransform.hpp
old mode 100755
new mode 100644
index 338feae190863cd61e27c743f2ff7ec4038a62c3..06795e574da8c236d8bfcb6662cf950449ec19fc
--- a/Utilities/otbliblas/include/liblas/lastransform.hpp
+++ b/Utilities/otbliblas/include/liblas/lastransform.hpp
@@ -45,10 +45,12 @@
 #include <liblas/lasversion.hpp>
 #include <liblas/laspoint.hpp>
 #include <liblas/lasspatialreference.hpp>
+#include <liblas/export.hpp>
 // boost
 #include <boost/shared_ptr.hpp>
 // std
 #include <vector>
+#include <string>
 
 namespace liblas {
 
@@ -59,36 +61,106 @@ namespace liblas {
 
 
 /// Defines public interface to LAS transform implementation.
-class TransformI
+class LAS_DLL TransformI
 {
 public:
     
     virtual bool transform(Point& point) = 0;
-    virtual ~TransformI() {};
+    virtual ~TransformI() {}
 };
 
 typedef boost::shared_ptr<liblas::TransformI> TransformPtr;
 
-class ReprojectionTransform: public TransformI
+class LAS_DLL ReprojectionTransform: public TransformI
 {
 public:
     
     ReprojectionTransform(const SpatialReference& inSRS, const SpatialReference& outSRS);    
+    ReprojectionTransform(const SpatialReference& inSRS, const SpatialReference& outSRS, liblas::HeaderPtr new_header);    
     ~ReprojectionTransform();
 
     bool transform(Point& point);
 
 private:
 
-    // FIXME: use shared_ptr with custom deleter and get rid of bloat of OGR manual calls --mloskot
-    OGRCoordinateTransformationH m_transform;
-    OGRSpatialReferenceH m_in_ref;
-    OGRSpatialReferenceH m_out_ref;
+#ifdef HAVE_GDAL
+    struct OGRSpatialReferenceDeleter
+    {
+       template <typename T>
+       void operator()(T* ptr)
+       {
+           ::OSRDestroySpatialReference(ptr);
+       }
+    };
+
+    struct OSRTransformDeleter
+    {
+       template <typename T>
+       void operator()(T* ptr)
+       {
+           ::OCTDestroyCoordinateTransformation(ptr);
+       }
+    };
+
+#endif
+
+    liblas::HeaderPtr m_new_header;
+    
+    typedef boost::shared_ptr<void> ReferencePtr;
+    typedef boost::shared_ptr<void> TransformPtr;
+    ReferencePtr m_in_ref_ptr;
+    ReferencePtr m_out_ref_ptr;
+    TransformPtr m_transform_ptr;
+    
+
 
     ReprojectionTransform(ReprojectionTransform const& other);
     ReprojectionTransform& operator=(ReprojectionTransform const& rhs);
+    
+    void Initialize(SpatialReference const& inSRS, SpatialReference const& outSRS);
 };
 
+class LAS_DLL TranslationTransform: public TransformI
+{
+public:
+    
+    TranslationTransform(std::string const& expression);
+    ~TranslationTransform();
+
+    bool transform(Point& point);
+    
+    enum OPER_TYPE
+    {
+        eOPER_MULTIPLY = 0, 
+        eOPER_DIVIDE = 1, 
+        eOPER_SUBTRACT = 2,  
+        eOPER_ADD = 3,
+        eOPER_NONE = -99
+    };
+
+    // Yes, Mateusz, I'm embarassed by this :)
+    struct operation{
+        OPER_TYPE oper;
+        std::string dimension;
+        double value;
+        std::string expression;
+        
+        operation(std::string name) : oper(eOPER_NONE), dimension(name), value(0.0)
+        {
+        }
+    };
+
+private:
+
+    TranslationTransform(TranslationTransform const& other);
+    TranslationTransform& operator=(TranslationTransform const& rhs);
+    
+    operation GetOperation(std::string const& expression);
+    
+    std::vector<operation> operations;
+    
+    std::string m_expression;
+};
 } // namespace liblas
 
 #endif // ndef LIBLAS_LASTRANSFORM_HPP_INCLUDED
diff --git a/Utilities/otbliblas/include/liblas/lasvariablerecord.hpp b/Utilities/otbliblas/include/liblas/lasvariablerecord.hpp
old mode 100755
new mode 100644
index bc2fe369e1377210c3cc8f6878cbe491089ea2ed..30ac51e107cdaec242fa276eae29e2649785184a
--- a/Utilities/otbliblas/include/liblas/lasvariablerecord.hpp
+++ b/Utilities/otbliblas/include/liblas/lasvariablerecord.hpp
@@ -45,6 +45,7 @@
 
 #include <liblas/detail/private_utility.hpp>
 #include <liblas/external/property_tree/ptree.hpp>
+#include <liblas/export.hpp>
 // boost
 #include <boost/array.hpp>
 #include <boost/cstdint.hpp>
@@ -56,7 +57,7 @@
 namespace liblas {
 
 /// Representation of variable-length record data.
-class VariableRecord
+class LAS_DLL VariableRecord
 {
 public:
 
@@ -151,7 +152,7 @@ inline bool operator!=(VariableRecord const& lhs, VariableRecord const& rhs)
     return (!(lhs == rhs));
 }
 
-std::ostream& operator<<(std::ostream& os, liblas::VariableRecord const&);
+LAS_DLL std::ostream& operator<<(std::ostream& os, liblas::VariableRecord const&);
 
 
 } // namespace liblas
diff --git a/Utilities/otbliblas/include/liblas/lasversion.hpp b/Utilities/otbliblas/include/liblas/lasversion.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/include/liblas/laswriter.hpp b/Utilities/otbliblas/include/liblas/laswriter.hpp
old mode 100755
new mode 100644
index ac5b76ee3c0f09dcf1620947a730914ee799d310..f2fd2c976a65e41227400342c74d457717904fc5
--- a/Utilities/otbliblas/include/liblas/laswriter.hpp
+++ b/Utilities/otbliblas/include/liblas/laswriter.hpp
@@ -47,6 +47,7 @@
 #include <liblas/laspoint.hpp>
 #include <liblas/lastransform.hpp>
 #include <liblas/lasfilter.hpp>
+#include <liblas/export.hpp>
 // boost
 #include <boost/shared_ptr.hpp>
 // std
@@ -59,7 +60,7 @@ namespace liblas {
 
 /// Defines public interface to LAS writer implementation.
 /// This class 
-class Writer
+class LAS_DLL Writer
 {
 public:
 
diff --git a/Utilities/otbliblas/include/liblas/liblas.hpp b/Utilities/otbliblas/include/liblas/liblas.hpp
index 794543c012f878dc49e96fc7976eff9efc40d474..6797dbe37d9ca839da833e1f12a8aae007da7d33 100755
--- a/Utilities/otbliblas/include/liblas/liblas.hpp
+++ b/Utilities/otbliblas/include/liblas/liblas.hpp
@@ -67,6 +67,7 @@
 #include <liblas/detail/endian.hpp>
 #include <liblas/detail/private_utility.hpp>
 #include <liblas/capi/las_version.h>
+#include <liblas/export.hpp>
 
 // booost
 #include <boost/array.hpp>
@@ -130,7 +131,7 @@ public:
     
     virtual std::istream& GetStream() const = 0;
     
-    virtual ~ReaderI() {};    
+    virtual ~ReaderI() {}
 };
 
 class WriterI
@@ -143,11 +144,10 @@ public:
 
     virtual std::ostream& GetStream() const = 0;
 
-    virtual ~WriterI() {};    
+    virtual ~WriterI() {}
 
 };
 
-
 } // namespace liblas
 
 #endif // LIBLAS_HPP_INCLUDED
diff --git a/Utilities/otbliblas/include/liblas/utility.hpp b/Utilities/otbliblas/include/liblas/utility.hpp
index b48bfa61251106ae15e457bc23ebbbe963c38578..578a4cfc0d6d9d2ffb359219c5fff27198f69784 100755
--- a/Utilities/otbliblas/include/liblas/utility.hpp
+++ b/Utilities/otbliblas/include/liblas/utility.hpp
@@ -46,6 +46,7 @@
 #include <liblas/laspoint.hpp>
 #include <liblas/detail/fwd.hpp>
 #include <liblas/external/property_tree/ptree.hpp>
+#include <liblas/export.hpp>
 // boost
 #include <boost/cstdint.hpp>
 #include <boost/foreach.hpp>
@@ -60,7 +61,7 @@ typedef boost::array<boost::uint32_t, 32> classes_type;
 namespace liblas {
 
 /// A summarization utililty for LAS points
-class Summary
+class LAS_DLL Summary
 {
 public:
     
@@ -88,7 +89,7 @@ private:
     bool bHaveHeader; 
 };
 
-std::ostream& operator<<(std::ostream& os, liblas::Summary const& s);
+LAS_DLL std::ostream& operator<<(std::ostream& os, liblas::Summary const& s);
 
 } // namespace liblas
 
diff --git a/Utilities/otbliblas/include/liblas/version.hpp b/Utilities/otbliblas/include/liblas/version.hpp
index 7b7bc5a3274cff2e799473548787ac5cc60ba829..f9193adde829b4e997c14fecbfe5b10da4908ed3 100755
--- a/Utilities/otbliblas/include/liblas/version.hpp
+++ b/Utilities/otbliblas/include/liblas/version.hpp
@@ -50,12 +50,12 @@
 // LIBLAS_VERSION / 100 % 1000 is the minor version
 // LIBLAS_VERSION / 100000 is the major version
 
-#define LIBLAS_VERSION 103000
+#define LIBLAS_VERSION 106000
 
 // LIBLAS_LIB_VERSION must be defined to be the same as LIBLAS_VERSION
 // but as a *string* in the form "x_y[_z]" where x is the major version
 // number, y is the minor version number, and z is the patch level if not 0.
 
-#define LIBLAS_LIB_VERSION "1_3"
+#define LIBLAS_LIB_VERSION "1_6"
 
 #endif // LIBLAS_VERSION_HPP_INCLUDED
diff --git a/Utilities/otbliblas/python/examples/grab_classes.py b/Utilities/otbliblas/python/examples/grab_classes.py
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/python/examples/las_summary.py b/Utilities/otbliblas/python/examples/las_summary.py
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/python/liblas/core.py b/Utilities/otbliblas/python/liblas/core.py
index a71bbb9bd3da9a3d0d31671123e39190d5b5a6ec..d4f5bcfb4ea753e2983a5e1011cd3fa326df8df7 100755
--- a/Utilities/otbliblas/python/liblas/core.py
+++ b/Utilities/otbliblas/python/liblas/core.py
@@ -128,7 +128,7 @@ except ImportError:
 if os.name == 'nt':
 # stolen from Shapely
 # http://trac.gispython.org/projects/PCL/browser/Shapely/trunk/shapely/geos.py
-    lib_name = 'liblas1.dll'
+    lib_name = 'liblas_c.dll'
     try:
         local_dlls = os.path.abspath(os.__file__ + "../../../DLLs")
         original_path = os.environ['PATH']
diff --git a/Utilities/otbliblas/python/scripts/laskdtree.py b/Utilities/otbliblas/python/scripts/laskdtree.py
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/python/setup.py b/Utilities/otbliblas/python/setup.py
index 45fea8e912a79fcfdf23404b2206c905fc46643b..73c3320a29273ca997a343374ef579fe78b43a69 100755
--- a/Utilities/otbliblas/python/setup.py
+++ b/Utilities/otbliblas/python/setup.py
@@ -18,7 +18,7 @@ install_requires = ['setuptools']
 
 import os
 
-version = '1.6.0b1'
+version = '1.6.0b2'
 
 if os.name == 'nt':
     # Windows NT library
diff --git a/Utilities/otbliblas/python/tests/Header.txt b/Utilities/otbliblas/python/tests/Header.txt
index d5004ff78e679e8551420307401617b518e4466b..64e78bd6eaff0565f00d483101f820c03fa2502d 100755
--- a/Utilities/otbliblas/python/tests/Header.txt
+++ b/Utilities/otbliblas/python/tests/Header.txt
@@ -48,7 +48,7 @@
   datetime.datetime(2008, 3, 19, 0, 0)
 
   >>> h.software_id
-  'libLAS 1.2'
+  'libLAS 1.6.0b2'
   >>> h.software_id = 'hobu'
   >>> h.software_id
   'hobu'
diff --git a/Utilities/otbliblas/python/tests/SRS-GDAL.txt b/Utilities/otbliblas/python/tests/SRS-GDAL.txt
index 6823a52cdcf9314ed299064c9b3db8b0eeee0825..72876fc7533374196a0b8687400de77a3afc0ed7 100755
--- a/Utilities/otbliblas/python/tests/SRS-GDAL.txt
+++ b/Utilities/otbliblas/python/tests/SRS-GDAL.txt
@@ -107,7 +107,8 @@ values are 0.01
   >>> del f_project
   >>> f3 = file.File('junk_srs_project.las')
   >>> f3.header.data_offset
-  476L
+  477L
+
   >>> s_utm = srs.SRS()
   >>> s_utm.wkt = utm_wkt
   >>> p3 = f3.read(1)
diff --git a/Utilities/otbliblas/python/tests/SRS-GeoTIFF.txt b/Utilities/otbliblas/python/tests/SRS-GeoTIFF.txt
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/src/CMakeLists.txt b/Utilities/otbliblas/src/CMakeLists.txt
old mode 100755
new mode 100644
index c4a4083a08cfbc56993f8483f5128660a9d7bd9a..687b012af7b2a6161dfa19122640594e20c3f4c3
--- a/Utilities/otbliblas/src/CMakeLists.txt
+++ b/Utilities/otbliblas/src/CMakeLists.txt
@@ -194,28 +194,41 @@ set(LIBLAS_C_SOURCES
   ${LIBLAS_HEADERS_DIR}/capi/liblas.h
   las_c_api.cpp)
 
-# Static libLAS C++ library
-add_library(${LIBLAS_LIB_NAME} STATIC ${LIBLAS_SOURCES})
+# NOTE:
+# This hack is required to correctly link static into shared library.
+# Such practice is not recommended as not portable, instead each library,
+# static and shared should be built from sources separately.
+if(UNIX)
+  add_definitions("-fPIC")
+endif()
+
+if(WIN32)
+    add_definitions("-DLAS_DLL_EXPORT=1")
+endif()
 
-# Shared libLAS C library
+add_library(${LIBLAS_LIB_NAME} SHARED ${LIBLAS_SOURCES})
 add_library(${LIBLAS_C_LIB_NAME} SHARED ${LIBLAS_C_SOURCES})
 
-if (APPLE)
-    set_target_properties(
-    ${LIBLAS_C_LIB_NAME}
-    PROPERTIES
-    INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
-    
-    )
-endif(APPLE)
+target_link_libraries(${LIBLAS_LIB_NAME}
+  ${LIBLAS_LIB_NAME}
+  ${TIFF_LIBRARY}
+  ${GEOTIFF_LIBRARY}
+  ${GDAL_LIBRARY}
+  ${Boost_LIBRARIES})
 
-########
 target_link_libraries(${LIBLAS_C_LIB_NAME}
   ${LIBLAS_LIB_NAME}
   ${TIFF_LIBRARY}
   ${GEOTIFF_LIBRARY}
   ${GDAL_LIBRARY}
-  ${SPATIALINDEX_LIBRARY})
+  ${Boost_LIBRARIES})
+
+if (APPLE)
+  set_target_properties(
+    ${LIBLAS_C_LIB_NAME}
+    PROPERTIES
+    INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+endif()
 
 ###############################################################################
 # Targets installation
diff --git a/Utilities/otbliblas/src/Makefile b/Utilities/otbliblas/src/Makefile
index 22fb8817ddb92db51479a26e1df2910708c4d1f3..0998f931700ee8b1a768449846c9311a3cf86754 100755
--- a/Utilities/otbliblas/src/Makefile
+++ b/Utilities/otbliblas/src/Makefile
@@ -39,10 +39,10 @@ RM = "/Applications/CMake 2.8-0.app/Contents/bin/cmake" -E remove -f
 CMAKE_EDIT_COMMAND = "/Applications/CMake 2.8-0.app/Contents/bin/ccmake"
 
 # The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /tmp/liblas-main
+CMAKE_SOURCE_DIR = /tmp/liblas
 
 # The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /tmp/liblas-main
+CMAKE_BINARY_DIR = /tmp/liblas
 
 #=============================================================================
 # Targets provided globally by CMake.
@@ -101,7 +101,7 @@ list_install_components/fast: list_install_components
 # Special rule for the target package
 package: preinstall
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool..."
-	cd /tmp/liblas-main && "/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackConfig.cmake
+	cd /tmp/liblas && "/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackConfig.cmake
 .PHONY : package
 
 # Special rule for the target package
@@ -111,7 +111,7 @@ package/fast: package
 # Special rule for the target package_source
 package_source:
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool for source..."
-	cd /tmp/liblas-main && "/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackSourceConfig.cmake /tmp/liblas-main/CPackSourceConfig.cmake
+	cd /tmp/liblas && "/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackSourceConfig.cmake /tmp/liblas/CPackSourceConfig.cmake
 .PHONY : package_source
 
 # Special rule for the target package_source
@@ -140,14 +140,14 @@ test/fast: test
 
 # The main all target
 all: cmake_check_build_system
-	cd /tmp/liblas-main && $(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas-main/CMakeFiles /tmp/liblas-main/src/CMakeFiles/progress.marks
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 src/all
-	$(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas-main/CMakeFiles 0
+	cd /tmp/liblas && $(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas/CMakeFiles /tmp/liblas/src/CMakeFiles/progress.marks
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 src/all
+	$(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas/CMakeFiles 0
 .PHONY : all
 
 # The main clean target
 clean:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 src/clean
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 src/clean
 .PHONY : clean
 
 # The main clean target
@@ -156,22 +156,22 @@ clean/fast: clean
 
 # Prepare targets for installation.
 preinstall: all
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall
 .PHONY : preinstall
 
 # Prepare targets for installation.
 preinstall/fast:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall
 .PHONY : preinstall/fast
 
 # clear depends
 depend:
-	cd /tmp/liblas-main && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
+	cd /tmp/liblas && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
 .PHONY : depend
 
 # Convenience name for target.
 src/CMakeFiles/las.dir/rule:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 src/CMakeFiles/las.dir/rule
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 src/CMakeFiles/las.dir/rule
 .PHONY : src/CMakeFiles/las.dir/rule
 
 # Convenience name for target.
@@ -180,12 +180,12 @@ las: src/CMakeFiles/las.dir/rule
 
 # fast build rule for target.
 las/fast:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/build
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/build
 .PHONY : las/fast
 
 # Convenience name for target.
 src/CMakeFiles/las_c.dir/rule:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 src/CMakeFiles/las_c.dir/rule
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 src/CMakeFiles/las_c.dir/rule
 .PHONY : src/CMakeFiles/las_c.dir/rule
 
 # Convenience name for target.
@@ -194,7 +194,7 @@ las_c: src/CMakeFiles/las_c.dir/rule
 
 # fast build rule for target.
 las_c/fast:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las_c.dir/build.make src/CMakeFiles/las_c.dir/build
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las_c.dir/build.make src/CMakeFiles/las_c.dir/build
 .PHONY : las_c/fast
 
 detail/index/indexcell.o: detail/index/indexcell.cpp.o
@@ -202,7 +202,7 @@ detail/index/indexcell.o: detail/index/indexcell.cpp.o
 
 # target to build an object file
 detail/index/indexcell.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/index/indexcell.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/index/indexcell.cpp.o
 .PHONY : detail/index/indexcell.cpp.o
 
 detail/index/indexcell.i: detail/index/indexcell.cpp.i
@@ -210,7 +210,7 @@ detail/index/indexcell.i: detail/index/indexcell.cpp.i
 
 # target to preprocess a source file
 detail/index/indexcell.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/index/indexcell.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/index/indexcell.cpp.i
 .PHONY : detail/index/indexcell.cpp.i
 
 detail/index/indexcell.s: detail/index/indexcell.cpp.s
@@ -218,7 +218,7 @@ detail/index/indexcell.s: detail/index/indexcell.cpp.s
 
 # target to generate assembly for a file
 detail/index/indexcell.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/index/indexcell.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/index/indexcell.cpp.s
 .PHONY : detail/index/indexcell.cpp.s
 
 detail/index/indexoutput.o: detail/index/indexoutput.cpp.o
@@ -226,7 +226,7 @@ detail/index/indexoutput.o: detail/index/indexoutput.cpp.o
 
 # target to build an object file
 detail/index/indexoutput.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/index/indexoutput.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/index/indexoutput.cpp.o
 .PHONY : detail/index/indexoutput.cpp.o
 
 detail/index/indexoutput.i: detail/index/indexoutput.cpp.i
@@ -234,7 +234,7 @@ detail/index/indexoutput.i: detail/index/indexoutput.cpp.i
 
 # target to preprocess a source file
 detail/index/indexoutput.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/index/indexoutput.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/index/indexoutput.cpp.i
 .PHONY : detail/index/indexoutput.cpp.i
 
 detail/index/indexoutput.s: detail/index/indexoutput.cpp.s
@@ -242,7 +242,7 @@ detail/index/indexoutput.s: detail/index/indexoutput.cpp.s
 
 # target to generate assembly for a file
 detail/index/indexoutput.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/index/indexoutput.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/index/indexoutput.cpp.s
 .PHONY : detail/index/indexoutput.cpp.s
 
 detail/reader/cachedreader.o: detail/reader/cachedreader.cpp.o
@@ -250,7 +250,7 @@ detail/reader/cachedreader.o: detail/reader/cachedreader.cpp.o
 
 # target to build an object file
 detail/reader/cachedreader.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/cachedreader.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/cachedreader.cpp.o
 .PHONY : detail/reader/cachedreader.cpp.o
 
 detail/reader/cachedreader.i: detail/reader/cachedreader.cpp.i
@@ -258,7 +258,7 @@ detail/reader/cachedreader.i: detail/reader/cachedreader.cpp.i
 
 # target to preprocess a source file
 detail/reader/cachedreader.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/cachedreader.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/cachedreader.cpp.i
 .PHONY : detail/reader/cachedreader.cpp.i
 
 detail/reader/cachedreader.s: detail/reader/cachedreader.cpp.s
@@ -266,7 +266,7 @@ detail/reader/cachedreader.s: detail/reader/cachedreader.cpp.s
 
 # target to generate assembly for a file
 detail/reader/cachedreader.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/cachedreader.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/cachedreader.cpp.s
 .PHONY : detail/reader/cachedreader.cpp.s
 
 detail/reader/header.o: detail/reader/header.cpp.o
@@ -274,7 +274,7 @@ detail/reader/header.o: detail/reader/header.cpp.o
 
 # target to build an object file
 detail/reader/header.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/header.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/header.cpp.o
 .PHONY : detail/reader/header.cpp.o
 
 detail/reader/header.i: detail/reader/header.cpp.i
@@ -282,7 +282,7 @@ detail/reader/header.i: detail/reader/header.cpp.i
 
 # target to preprocess a source file
 detail/reader/header.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/header.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/header.cpp.i
 .PHONY : detail/reader/header.cpp.i
 
 detail/reader/header.s: detail/reader/header.cpp.s
@@ -290,7 +290,7 @@ detail/reader/header.s: detail/reader/header.cpp.s
 
 # target to generate assembly for a file
 detail/reader/header.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/header.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/header.cpp.s
 .PHONY : detail/reader/header.cpp.s
 
 detail/reader/point.o: detail/reader/point.cpp.o
@@ -298,7 +298,7 @@ detail/reader/point.o: detail/reader/point.cpp.o
 
 # target to build an object file
 detail/reader/point.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/point.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/point.cpp.o
 .PHONY : detail/reader/point.cpp.o
 
 detail/reader/point.i: detail/reader/point.cpp.i
@@ -306,7 +306,7 @@ detail/reader/point.i: detail/reader/point.cpp.i
 
 # target to preprocess a source file
 detail/reader/point.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/point.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/point.cpp.i
 .PHONY : detail/reader/point.cpp.i
 
 detail/reader/point.s: detail/reader/point.cpp.s
@@ -314,7 +314,7 @@ detail/reader/point.s: detail/reader/point.cpp.s
 
 # target to generate assembly for a file
 detail/reader/point.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/point.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/point.cpp.s
 .PHONY : detail/reader/point.cpp.s
 
 detail/reader/reader.o: detail/reader/reader.cpp.o
@@ -322,7 +322,7 @@ detail/reader/reader.o: detail/reader/reader.cpp.o
 
 # target to build an object file
 detail/reader/reader.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/reader.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/reader.cpp.o
 .PHONY : detail/reader/reader.cpp.o
 
 detail/reader/reader.i: detail/reader/reader.cpp.i
@@ -330,7 +330,7 @@ detail/reader/reader.i: detail/reader/reader.cpp.i
 
 # target to preprocess a source file
 detail/reader/reader.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/reader.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/reader.cpp.i
 .PHONY : detail/reader/reader.cpp.i
 
 detail/reader/reader.s: detail/reader/reader.cpp.s
@@ -338,7 +338,7 @@ detail/reader/reader.s: detail/reader/reader.cpp.s
 
 # target to generate assembly for a file
 detail/reader/reader.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/reader.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/reader/reader.cpp.s
 .PHONY : detail/reader/reader.cpp.s
 
 detail/utility.o: detail/utility.cpp.o
@@ -346,7 +346,7 @@ detail/utility.o: detail/utility.cpp.o
 
 # target to build an object file
 detail/utility.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/utility.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/utility.cpp.o
 .PHONY : detail/utility.cpp.o
 
 detail/utility.i: detail/utility.cpp.i
@@ -354,7 +354,7 @@ detail/utility.i: detail/utility.cpp.i
 
 # target to preprocess a source file
 detail/utility.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/utility.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/utility.cpp.i
 .PHONY : detail/utility.cpp.i
 
 detail/utility.s: detail/utility.cpp.s
@@ -362,7 +362,7 @@ detail/utility.s: detail/utility.cpp.s
 
 # target to generate assembly for a file
 detail/utility.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/utility.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/utility.cpp.s
 .PHONY : detail/utility.cpp.s
 
 detail/writer/base.o: detail/writer/base.cpp.o
@@ -370,7 +370,7 @@ detail/writer/base.o: detail/writer/base.cpp.o
 
 # target to build an object file
 detail/writer/base.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/base.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/base.cpp.o
 .PHONY : detail/writer/base.cpp.o
 
 detail/writer/base.i: detail/writer/base.cpp.i
@@ -378,7 +378,7 @@ detail/writer/base.i: detail/writer/base.cpp.i
 
 # target to preprocess a source file
 detail/writer/base.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/base.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/base.cpp.i
 .PHONY : detail/writer/base.cpp.i
 
 detail/writer/base.s: detail/writer/base.cpp.s
@@ -386,7 +386,7 @@ detail/writer/base.s: detail/writer/base.cpp.s
 
 # target to generate assembly for a file
 detail/writer/base.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/base.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/base.cpp.s
 .PHONY : detail/writer/base.cpp.s
 
 detail/writer/header.o: detail/writer/header.cpp.o
@@ -394,7 +394,7 @@ detail/writer/header.o: detail/writer/header.cpp.o
 
 # target to build an object file
 detail/writer/header.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/header.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/header.cpp.o
 .PHONY : detail/writer/header.cpp.o
 
 detail/writer/header.i: detail/writer/header.cpp.i
@@ -402,7 +402,7 @@ detail/writer/header.i: detail/writer/header.cpp.i
 
 # target to preprocess a source file
 detail/writer/header.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/header.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/header.cpp.i
 .PHONY : detail/writer/header.cpp.i
 
 detail/writer/header.s: detail/writer/header.cpp.s
@@ -410,7 +410,7 @@ detail/writer/header.s: detail/writer/header.cpp.s
 
 # target to generate assembly for a file
 detail/writer/header.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/header.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/header.cpp.s
 .PHONY : detail/writer/header.cpp.s
 
 detail/writer/point.o: detail/writer/point.cpp.o
@@ -418,7 +418,7 @@ detail/writer/point.o: detail/writer/point.cpp.o
 
 # target to build an object file
 detail/writer/point.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/point.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/point.cpp.o
 .PHONY : detail/writer/point.cpp.o
 
 detail/writer/point.i: detail/writer/point.cpp.i
@@ -426,7 +426,7 @@ detail/writer/point.i: detail/writer/point.cpp.i
 
 # target to preprocess a source file
 detail/writer/point.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/point.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/point.cpp.i
 .PHONY : detail/writer/point.cpp.i
 
 detail/writer/point.s: detail/writer/point.cpp.s
@@ -434,7 +434,7 @@ detail/writer/point.s: detail/writer/point.cpp.s
 
 # target to generate assembly for a file
 detail/writer/point.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/point.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/point.cpp.s
 .PHONY : detail/writer/point.cpp.s
 
 detail/writer/writer.o: detail/writer/writer.cpp.o
@@ -442,7 +442,7 @@ detail/writer/writer.o: detail/writer/writer.cpp.o
 
 # target to build an object file
 detail/writer/writer.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/writer.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/writer.cpp.o
 .PHONY : detail/writer/writer.cpp.o
 
 detail/writer/writer.i: detail/writer/writer.cpp.i
@@ -450,7 +450,7 @@ detail/writer/writer.i: detail/writer/writer.cpp.i
 
 # target to preprocess a source file
 detail/writer/writer.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/writer.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/writer.cpp.i
 .PHONY : detail/writer/writer.cpp.i
 
 detail/writer/writer.s: detail/writer/writer.cpp.s
@@ -458,7 +458,7 @@ detail/writer/writer.s: detail/writer/writer.cpp.s
 
 # target to generate assembly for a file
 detail/writer/writer.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/writer.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/detail/writer/writer.cpp.s
 .PHONY : detail/writer/writer.cpp.s
 
 las_c_api.o: las_c_api.cpp.o
@@ -466,7 +466,7 @@ las_c_api.o: las_c_api.cpp.o
 
 # target to build an object file
 las_c_api.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las_c.dir/build.make src/CMakeFiles/las_c.dir/las_c_api.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las_c.dir/build.make src/CMakeFiles/las_c.dir/las_c_api.cpp.o
 .PHONY : las_c_api.cpp.o
 
 las_c_api.i: las_c_api.cpp.i
@@ -474,7 +474,7 @@ las_c_api.i: las_c_api.cpp.i
 
 # target to preprocess a source file
 las_c_api.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las_c.dir/build.make src/CMakeFiles/las_c.dir/las_c_api.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las_c.dir/build.make src/CMakeFiles/las_c.dir/las_c_api.cpp.i
 .PHONY : las_c_api.cpp.i
 
 las_c_api.s: las_c_api.cpp.s
@@ -482,7 +482,7 @@ las_c_api.s: las_c_api.cpp.s
 
 # target to generate assembly for a file
 las_c_api.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las_c.dir/build.make src/CMakeFiles/las_c.dir/las_c_api.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las_c.dir/build.make src/CMakeFiles/las_c.dir/las_c_api.cpp.s
 .PHONY : las_c_api.cpp.s
 
 lasclassification.o: lasclassification.cpp.o
@@ -490,7 +490,7 @@ lasclassification.o: lasclassification.cpp.o
 
 # target to build an object file
 lasclassification.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasclassification.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasclassification.cpp.o
 .PHONY : lasclassification.cpp.o
 
 lasclassification.i: lasclassification.cpp.i
@@ -498,7 +498,7 @@ lasclassification.i: lasclassification.cpp.i
 
 # target to preprocess a source file
 lasclassification.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasclassification.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasclassification.cpp.i
 .PHONY : lasclassification.cpp.i
 
 lasclassification.s: lasclassification.cpp.s
@@ -506,7 +506,7 @@ lasclassification.s: lasclassification.cpp.s
 
 # target to generate assembly for a file
 lasclassification.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasclassification.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasclassification.cpp.s
 .PHONY : lasclassification.cpp.s
 
 lascolor.o: lascolor.cpp.o
@@ -514,7 +514,7 @@ lascolor.o: lascolor.cpp.o
 
 # target to build an object file
 lascolor.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lascolor.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lascolor.cpp.o
 .PHONY : lascolor.cpp.o
 
 lascolor.i: lascolor.cpp.i
@@ -522,7 +522,7 @@ lascolor.i: lascolor.cpp.i
 
 # target to preprocess a source file
 lascolor.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lascolor.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lascolor.cpp.i
 .PHONY : lascolor.cpp.i
 
 lascolor.s: lascolor.cpp.s
@@ -530,7 +530,7 @@ lascolor.s: lascolor.cpp.s
 
 # target to generate assembly for a file
 lascolor.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lascolor.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lascolor.cpp.s
 .PHONY : lascolor.cpp.s
 
 lasdimension.o: lasdimension.cpp.o
@@ -538,7 +538,7 @@ lasdimension.o: lasdimension.cpp.o
 
 # target to build an object file
 lasdimension.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasdimension.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasdimension.cpp.o
 .PHONY : lasdimension.cpp.o
 
 lasdimension.i: lasdimension.cpp.i
@@ -546,7 +546,7 @@ lasdimension.i: lasdimension.cpp.i
 
 # target to preprocess a source file
 lasdimension.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasdimension.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasdimension.cpp.i
 .PHONY : lasdimension.cpp.i
 
 lasdimension.s: lasdimension.cpp.s
@@ -554,7 +554,7 @@ lasdimension.s: lasdimension.cpp.s
 
 # target to generate assembly for a file
 lasdimension.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasdimension.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasdimension.cpp.s
 .PHONY : lasdimension.cpp.s
 
 laserror.o: laserror.cpp.o
@@ -562,7 +562,7 @@ laserror.o: laserror.cpp.o
 
 # target to build an object file
 laserror.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laserror.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laserror.cpp.o
 .PHONY : laserror.cpp.o
 
 laserror.i: laserror.cpp.i
@@ -570,7 +570,7 @@ laserror.i: laserror.cpp.i
 
 # target to preprocess a source file
 laserror.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laserror.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laserror.cpp.i
 .PHONY : laserror.cpp.i
 
 laserror.s: laserror.cpp.s
@@ -578,7 +578,7 @@ laserror.s: laserror.cpp.s
 
 # target to generate assembly for a file
 laserror.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laserror.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laserror.cpp.s
 .PHONY : laserror.cpp.s
 
 lasfilter.o: lasfilter.cpp.o
@@ -586,7 +586,7 @@ lasfilter.o: lasfilter.cpp.o
 
 # target to build an object file
 lasfilter.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasfilter.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasfilter.cpp.o
 .PHONY : lasfilter.cpp.o
 
 lasfilter.i: lasfilter.cpp.i
@@ -594,7 +594,7 @@ lasfilter.i: lasfilter.cpp.i
 
 # target to preprocess a source file
 lasfilter.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasfilter.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasfilter.cpp.i
 .PHONY : lasfilter.cpp.i
 
 lasfilter.s: lasfilter.cpp.s
@@ -602,7 +602,7 @@ lasfilter.s: lasfilter.cpp.s
 
 # target to generate assembly for a file
 lasfilter.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasfilter.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasfilter.cpp.s
 .PHONY : lasfilter.cpp.s
 
 lasheader.o: lasheader.cpp.o
@@ -610,7 +610,7 @@ lasheader.o: lasheader.cpp.o
 
 # target to build an object file
 lasheader.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasheader.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasheader.cpp.o
 .PHONY : lasheader.cpp.o
 
 lasheader.i: lasheader.cpp.i
@@ -618,7 +618,7 @@ lasheader.i: lasheader.cpp.i
 
 # target to preprocess a source file
 lasheader.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasheader.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasheader.cpp.i
 .PHONY : lasheader.cpp.i
 
 lasheader.s: lasheader.cpp.s
@@ -626,7 +626,7 @@ lasheader.s: lasheader.cpp.s
 
 # target to generate assembly for a file
 lasheader.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasheader.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasheader.cpp.s
 .PHONY : lasheader.cpp.s
 
 lasindex.o: lasindex.cpp.o
@@ -634,7 +634,7 @@ lasindex.o: lasindex.cpp.o
 
 # target to build an object file
 lasindex.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasindex.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasindex.cpp.o
 .PHONY : lasindex.cpp.o
 
 lasindex.i: lasindex.cpp.i
@@ -642,7 +642,7 @@ lasindex.i: lasindex.cpp.i
 
 # target to preprocess a source file
 lasindex.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasindex.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasindex.cpp.i
 .PHONY : lasindex.cpp.i
 
 lasindex.s: lasindex.cpp.s
@@ -650,7 +650,7 @@ lasindex.s: lasindex.cpp.s
 
 # target to generate assembly for a file
 lasindex.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasindex.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasindex.cpp.s
 .PHONY : lasindex.cpp.s
 
 laspoint.o: laspoint.cpp.o
@@ -658,7 +658,7 @@ laspoint.o: laspoint.cpp.o
 
 # target to build an object file
 laspoint.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laspoint.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laspoint.cpp.o
 .PHONY : laspoint.cpp.o
 
 laspoint.i: laspoint.cpp.i
@@ -666,7 +666,7 @@ laspoint.i: laspoint.cpp.i
 
 # target to preprocess a source file
 laspoint.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laspoint.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laspoint.cpp.i
 .PHONY : laspoint.cpp.i
 
 laspoint.s: laspoint.cpp.s
@@ -674,7 +674,7 @@ laspoint.s: laspoint.cpp.s
 
 # target to generate assembly for a file
 laspoint.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laspoint.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laspoint.cpp.s
 .PHONY : laspoint.cpp.s
 
 lasreader.o: lasreader.cpp.o
@@ -682,7 +682,7 @@ lasreader.o: lasreader.cpp.o
 
 # target to build an object file
 lasreader.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasreader.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasreader.cpp.o
 .PHONY : lasreader.cpp.o
 
 lasreader.i: lasreader.cpp.i
@@ -690,7 +690,7 @@ lasreader.i: lasreader.cpp.i
 
 # target to preprocess a source file
 lasreader.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasreader.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasreader.cpp.i
 .PHONY : lasreader.cpp.i
 
 lasreader.s: lasreader.cpp.s
@@ -698,7 +698,7 @@ lasreader.s: lasreader.cpp.s
 
 # target to generate assembly for a file
 lasreader.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasreader.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasreader.cpp.s
 .PHONY : lasreader.cpp.s
 
 lasschema.o: lasschema.cpp.o
@@ -706,7 +706,7 @@ lasschema.o: lasschema.cpp.o
 
 # target to build an object file
 lasschema.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasschema.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasschema.cpp.o
 .PHONY : lasschema.cpp.o
 
 lasschema.i: lasschema.cpp.i
@@ -714,7 +714,7 @@ lasschema.i: lasschema.cpp.i
 
 # target to preprocess a source file
 lasschema.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasschema.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasschema.cpp.i
 .PHONY : lasschema.cpp.i
 
 lasschema.s: lasschema.cpp.s
@@ -722,7 +722,7 @@ lasschema.s: lasschema.cpp.s
 
 # target to generate assembly for a file
 lasschema.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasschema.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasschema.cpp.s
 .PHONY : lasschema.cpp.s
 
 lasspatialreference.o: lasspatialreference.cpp.o
@@ -730,7 +730,7 @@ lasspatialreference.o: lasspatialreference.cpp.o
 
 # target to build an object file
 lasspatialreference.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasspatialreference.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasspatialreference.cpp.o
 .PHONY : lasspatialreference.cpp.o
 
 lasspatialreference.i: lasspatialreference.cpp.i
@@ -738,7 +738,7 @@ lasspatialreference.i: lasspatialreference.cpp.i
 
 # target to preprocess a source file
 lasspatialreference.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasspatialreference.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasspatialreference.cpp.i
 .PHONY : lasspatialreference.cpp.i
 
 lasspatialreference.s: lasspatialreference.cpp.s
@@ -746,7 +746,7 @@ lasspatialreference.s: lasspatialreference.cpp.s
 
 # target to generate assembly for a file
 lasspatialreference.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasspatialreference.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasspatialreference.cpp.s
 .PHONY : lasspatialreference.cpp.s
 
 lastransform.o: lastransform.cpp.o
@@ -754,7 +754,7 @@ lastransform.o: lastransform.cpp.o
 
 # target to build an object file
 lastransform.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lastransform.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lastransform.cpp.o
 .PHONY : lastransform.cpp.o
 
 lastransform.i: lastransform.cpp.i
@@ -762,7 +762,7 @@ lastransform.i: lastransform.cpp.i
 
 # target to preprocess a source file
 lastransform.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lastransform.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lastransform.cpp.i
 .PHONY : lastransform.cpp.i
 
 lastransform.s: lastransform.cpp.s
@@ -770,7 +770,7 @@ lastransform.s: lastransform.cpp.s
 
 # target to generate assembly for a file
 lastransform.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lastransform.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lastransform.cpp.s
 .PHONY : lastransform.cpp.s
 
 lasvariablerecord.o: lasvariablerecord.cpp.o
@@ -778,7 +778,7 @@ lasvariablerecord.o: lasvariablerecord.cpp.o
 
 # target to build an object file
 lasvariablerecord.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasvariablerecord.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasvariablerecord.cpp.o
 .PHONY : lasvariablerecord.cpp.o
 
 lasvariablerecord.i: lasvariablerecord.cpp.i
@@ -786,7 +786,7 @@ lasvariablerecord.i: lasvariablerecord.cpp.i
 
 # target to preprocess a source file
 lasvariablerecord.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasvariablerecord.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasvariablerecord.cpp.i
 .PHONY : lasvariablerecord.cpp.i
 
 lasvariablerecord.s: lasvariablerecord.cpp.s
@@ -794,7 +794,7 @@ lasvariablerecord.s: lasvariablerecord.cpp.s
 
 # target to generate assembly for a file
 lasvariablerecord.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasvariablerecord.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/lasvariablerecord.cpp.s
 .PHONY : lasvariablerecord.cpp.s
 
 laswriter.o: laswriter.cpp.o
@@ -802,7 +802,7 @@ laswriter.o: laswriter.cpp.o
 
 # target to build an object file
 laswriter.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laswriter.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laswriter.cpp.o
 .PHONY : laswriter.cpp.o
 
 laswriter.i: laswriter.cpp.i
@@ -810,7 +810,7 @@ laswriter.i: laswriter.cpp.i
 
 # target to preprocess a source file
 laswriter.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laswriter.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laswriter.cpp.i
 .PHONY : laswriter.cpp.i
 
 laswriter.s: laswriter.cpp.s
@@ -818,7 +818,7 @@ laswriter.s: laswriter.cpp.s
 
 # target to generate assembly for a file
 laswriter.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laswriter.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/laswriter.cpp.s
 .PHONY : laswriter.cpp.s
 
 utility.o: utility.cpp.o
@@ -826,7 +826,7 @@ utility.o: utility.cpp.o
 
 # target to build an object file
 utility.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/utility.cpp.o
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/utility.cpp.o
 .PHONY : utility.cpp.o
 
 utility.i: utility.cpp.i
@@ -834,7 +834,7 @@ utility.i: utility.cpp.i
 
 # target to preprocess a source file
 utility.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/utility.cpp.i
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/utility.cpp.i
 .PHONY : utility.cpp.i
 
 utility.s: utility.cpp.s
@@ -842,7 +842,7 @@ utility.s: utility.cpp.s
 
 # target to generate assembly for a file
 utility.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/utility.cpp.s
+	cd /tmp/liblas && $(MAKE) -f src/CMakeFiles/las.dir/build.make src/CMakeFiles/las.dir/utility.cpp.s
 .PHONY : utility.cpp.s
 
 # Help Target
@@ -954,6 +954,6 @@ help:
 # No rule that depends on this can have commands that come from listfiles
 # because they might be regenerated.
 cmake_check_build_system:
-	cd /tmp/liblas-main && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
+	cd /tmp/liblas && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
 .PHONY : cmake_check_build_system
 
diff --git a/Utilities/otbliblas/src/detail/index/indexcell.cpp b/Utilities/otbliblas/src/detail/index/indexcell.cpp
old mode 100755
new mode 100644
index 1fb34d3055a616cbff5d433239e51a9bf1d0ff71..550b3f6a8f52416b22d5f8b98c4ae278d1b010be
--- a/Utilities/otbliblas/src/detail/index/indexcell.cpp
+++ b/Utilities/otbliblas/src/detail/index/indexcell.cpp
@@ -57,7 +57,7 @@ IndexCell::IndexCell() :
 } // IndexCell::IndexCell
 
 
-void IndexCell::SetFileOffset(boost::uint32_t fos)
+void IndexCell::SetFileOffset(TempFileOffsetType fos)
 {
 	m_FileOffset = fos;
 } // IndexCell::SetFileOffset
@@ -67,7 +67,7 @@ void IndexCell::SetNumPoints(boost::uint32_t nmp)
 	m_NumPoints = nmp;
 } // IndexCell::SetNumPoints
 
-boost::uint32_t IndexCell::GetFileOffset(void) const
+TempFileOffsetType IndexCell::GetFileOffset(void) const
 {
 	return(m_FileOffset);
 } // IndexCell::GetFileOffset
diff --git a/Utilities/otbliblas/src/detail/index/indexoutput.cpp b/Utilities/otbliblas/src/detail/index/indexoutput.cpp
old mode 100755
new mode 100644
index 6236928c1e9c0c0ffd02899994dcc4fcfdb11309..60a60e6b8d6003b164faf98ea51868ee12a2b694
--- a/Utilities/otbliblas/src/detail/index/indexoutput.cpp
+++ b/Utilities/otbliblas/src/detail/index/indexoutput.cpp
@@ -49,20 +49,22 @@ namespace liblas { namespace detail {
 
 IndexOutput::IndexOutput(liblas::Index *indexsource) :
 	m_index(indexsource), 
-	m_VLRCommonDataSize(5 * sizeof(boost::uint32_t)),
+	m_VLRCommonDataSize(6 * sizeof(boost::uint32_t)),
 	m_VLRDataSizeLocation(4 * sizeof(boost::uint32_t)),
 	m_FirstCellLocation(0),
-	m_LastCellLocation(sizeof(boost::uint32_t) * 2)
+	m_LastCellLocation(sizeof(boost::uint32_t) * 2),
+	m_VLRPointCountLocation(5 * sizeof(boost::uint32_t)),
+	m_DataPointsThisVLR(0)
 {
 } // IndexOutput::IndexOutput
 
 bool IndexOutput::InitiateOutput(void)
 {
 
-	boost::uint8_t VersionMajor = LIBLAS_INDEX_VERSIONMAJOR, VersionMinor = LIBLAS_INDEX_VERSIONMINOR;
+	boost::uint8_t Version;
 	char DestStr[LIBLAS_INDEX_MAXSTRLEN];
 	boost::uint16_t StringLen;
-	boost::uint16_t WritePos = 0;
+	boost::uint32_t WritePos = 0;
 	
 	try {
 		// write a header in standard VLR format
@@ -72,8 +74,10 @@ bool IndexOutput::InitiateOutput(void)
 		m_indexVLRHeaderRecord.SetDescription("LibLAS Index Header");
 		// set the header data into the header data string
 		// Index file version
-		WriteVLRData_n(m_indexVLRHeaderData, VersionMajor, WritePos);
-		WriteVLRData_n(m_indexVLRHeaderData, VersionMinor, WritePos);
+		Version = m_index->GetVersionMajor();
+		WriteVLRData_n(m_indexVLRHeaderData, Version, WritePos);
+		Version = m_index->GetVersionMinor();
+		WriteVLRData_n(m_indexVLRHeaderData, Version, WritePos);
 		// creator		
 		strncpy(DestStr, m_index->GetIndexAuthorStr(), LIBLAS_INDEX_MAXSTRLEN - 1);
 		DestStr[LIBLAS_INDEX_MAXSTRLEN - 1] = 0;
@@ -107,7 +111,7 @@ bool IndexOutput::InitiateOutput(void)
 		TempData = m_index->GetMaxZ();
 		WriteVLRData_n(m_indexVLRHeaderData, TempData, WritePos);
 
-		// ID number of associated data VLR's - normally 43 but may use heigher numbers
+		// ID number of associated data VLR's - normally 43 but may use higher numbers
 		// in order to store more than one index in a file
 		boost::uint32_t TempLong = m_index->GetDataVLR_ID();
 		WriteVLRData_n(m_indexVLRHeaderData, TempLong, WritePos);
@@ -122,8 +126,9 @@ bool IndexOutput::InitiateOutput(void)
 		TempLong = m_index->GetCellsZ();
 		WriteVLRData_n(m_indexVLRHeaderData, TempLong, WritePos);
 		
-		// record length		
-		m_indexVLRHeaderRecord.SetRecordLength(WritePos);
+		// record length
+		assert(WritePos <= std::numeric_limits<boost::uint16_t>::max());		
+		m_indexVLRHeaderRecord.SetRecordLength(static_cast<boost::uint16_t>(WritePos));
 		m_indexVLRHeaderData.resize(WritePos);
 		m_indexVLRHeaderRecord.SetData(m_indexVLRHeaderData);
 		m_index->GetIndexHeader()->AddVLR(m_indexVLRHeaderRecord);
@@ -166,9 +171,15 @@ bool IndexOutput::OutputCell(liblas::detail::IndexCell *CellBlock, boost::uint32
 		NumPts = CellBlock->GetNumPoints();
 		if (NumPts)
 		{
+			// keep track of the number of points in this VLR - added in Index version 1.1
+			m_DataPointsThisVLR += NumPts;
+			
 			// current cell, x, y
 			WriteVLRData_n(m_indexVLRTempData, x, m_TempWritePos);
 			WriteVLRData_n(m_indexVLRTempData, y, m_TempWritePos);
+			// number of points in this cell - added in Index version 1.1
+			WriteVLRData_n(m_indexVLRTempData, NumPts, m_TempWritePos);
+
 			// min and max Z
 			ElevExtrema ExtremaZ = CellBlock->GetMinZ();
 			WriteVLRData_n(m_indexVLRTempData, ExtremaZ, m_TempWritePos);
@@ -182,6 +193,7 @@ bool IndexOutput::OutputCell(liblas::detail::IndexCell *CellBlock, boost::uint32
 			WriteVLRData_n(m_indexVLRTempData, SubCellsXY, m_TempWritePos);
 			SubCellsZ = CellBlock->GetNumZCellRecords();
 			WriteVLRData_n(m_indexVLRTempData, SubCellsZ, m_TempWritePos);
+			
 
 			// <<<>>> prevent array overruns
 			// compile data into one long vector m_indexVLRTempData
@@ -264,6 +276,8 @@ bool IndexOutput::OutputCell(liblas::detail::IndexCell *CellBlock, boost::uint32
 				// update data record size
 				m_DataRecordSize += m_TempWritePos;
 				WriteVLRDataNoInc_n(m_indexVLRCellPointData, m_DataRecordSize, m_VLRDataSizeLocation);
+				// number of points in this VLR - added in Index version 1.1
+				WriteVLRDataNoInc_n(m_indexVLRCellPointData, m_DataPointsThisVLR, m_VLRPointCountLocation);
 				WriteVLRDataNoInc_str(m_indexVLRCellPointData, (char * const)&m_indexVLRTempData[0], m_TempWritePos, WritePos);
 				m_SomeDataReadyToWrite = true;
 				// rewind counter to start new cell data
@@ -288,6 +302,8 @@ bool IndexOutput::OutputCell(liblas::detail::IndexCell *CellBlock, boost::uint32
 				if (m_indexVLRCellPointData.size() != numeric_limits<unsigned short>::max())
 					m_indexVLRCellPointData.resize(numeric_limits<unsigned short>::max());
 				WriteVLRDataNoInc_n(m_indexVLRCellPointData, m_DataRecordSize, m_VLRDataSizeLocation);
+				// number of points in this VLR - added in Index version 1.1
+				WriteVLRDataNoInc_n(m_indexVLRCellPointData, m_DataPointsThisVLR, m_VLRPointCountLocation);
 				
 				// write out the part that fits in this VLR (excluding the common data)
 				boost::uint32_t WrittenBytes = numeric_limits<unsigned short>::max() - WritePos;
@@ -334,6 +350,7 @@ bool IndexOutput::InitializeVLRData(boost::uint32_t CurCellX, boost::uint32_t Cu
 		m_indexVLRCellPointData.resize(numeric_limits<unsigned short>::max());
 
 		m_DataRecordSize = m_VLRCommonDataSize;
+		m_DataPointsThisVLR = 0;
 		// 1st cell in VLR, x, y
 		WriteVLRDataNoInc_n(m_indexVLRCellPointData, CurCellX, m_FirstCellLocation);
 		WriteVLRDataNoInc_n(m_indexVLRCellPointData, CurCellY, m_FirstCellLocation + sizeof(boost::uint32_t));
@@ -342,6 +359,8 @@ bool IndexOutput::InitializeVLRData(boost::uint32_t CurCellX, boost::uint32_t Cu
 		WriteVLRDataNoInc_n(m_indexVLRCellPointData, CurCellY, m_LastCellLocation + sizeof(boost::uint32_t));
 		// data record size
 		WriteVLRDataNoInc_n(m_indexVLRCellPointData, m_DataRecordSize, m_VLRDataSizeLocation);
+		// number of points in this VLR - added in Index version 1.1
+		WriteVLRDataNoInc_n(m_indexVLRCellPointData, m_DataPointsThisVLR, m_VLRPointCountLocation);
 		m_FirstCellInVLR = false;
 		m_SomeDataReadyToWrite = false;
 
diff --git a/Utilities/otbliblas/src/detail/reader/cachedreader.cpp b/Utilities/otbliblas/src/detail/reader/cachedreader.cpp
old mode 100755
new mode 100644
index 6fc9e6100e0bcda66e8af4db80c38dcb26299732..ee50baa54ea6df391f97ece6474923c98a5e188c
--- a/Utilities/otbliblas/src/detail/reader/cachedreader.cpp
+++ b/Utilities/otbliblas/src/detail/reader/cachedreader.cpp
@@ -66,6 +66,7 @@ CachedReaderImpl::CachedReaderImpl(std::istream& ifs , std::size_t size)
     , m_cache_size(size)
     , m_cache_start_position(0)
     , m_cache_read_position(0)
+    , m_cache_initialized(false)
 {
 }
 
@@ -81,13 +82,13 @@ HeaderPtr CachedReaderImpl::ReadHeader()
     if (m_cache_size > hptr->GetPointRecordsCount()) {
         m_cache_size = hptr->GetPointRecordsCount();
     }
-    m_cache.resize(m_cache_size);
-    
-    // Mark all positions as uncached and build up the mask
-    // to the size of the number of points in the file
-    for (boost::uint32_t i = 0; i < hptr->GetPointRecordsCount(); ++i) {
-        m_mask.push_back(0);
-    }
+    // // FIXME: Note, vector::resize never shrinks the container and frees memory! Are we aware of this fact here? --mloskot
+    // m_cache.resize(m_cache_size);
+    // 
+    // // Mark all positions as uncached and build up the mask
+    // // to the size of the number of points in the file
+    // boost::uint8_t const uncached_mask = 0;
+    // cache_mask_type(hptr->GetPointRecordsCount(), uncached_mask).swap(m_mask);
     
     return hptr;
 }
@@ -138,6 +139,21 @@ liblas::Point const& CachedReaderImpl::ReadCachedPoint(boost::uint32_t position,
     // }
     // std::cout << std::endl;
 
+    // If our point cache and mask have not yet been initialized, we 
+    // should do so before tyring to read any points.  We don't want to do 
+    // this in ::Reset or ::ReadHeader, as these functions may be called 
+    // multiple times and screw up our assumptions.
+    if (!m_cache_initialized) 
+    {
+        m_cache = cache_type(m_cache_size);
+    
+        // Mark all positions as uncached and build up the mask
+        // to the size of the number of points in the file
+        boost::uint8_t const uncached_mask = 0;
+        cache_mask_type(header->GetPointRecordsCount(), uncached_mask).swap(m_mask);
+ 
+        m_cache_initialized = true;
+    }
     if (m_mask[position] == 1) {
         m_cache_read_position = position;
         return m_cache[cache_position];
@@ -206,7 +222,7 @@ liblas::Point const& CachedReaderImpl::ReadPointAt(std::size_t n, HeaderPtr head
         std::string out(output.str());
         throw std::runtime_error(out);
     }
-
+    
     liblas::Point const& p = ReadCachedPoint(n, header);
     m_cache_read_position = n;
     return p;
@@ -215,7 +231,10 @@ liblas::Point const& CachedReaderImpl::ReadPointAt(std::size_t n, HeaderPtr head
 void CachedReaderImpl::Reset(HeaderPtr header)
 {
     if (m_mask.empty())
+    {    
+        ReaderImpl::Reset(header);
         return;
+    }
 
     typedef cache_mask_type::size_type size_type;
     size_type old_cache_start_position = m_cache_start_position;
@@ -232,6 +251,7 @@ void CachedReaderImpl::Reset(HeaderPtr header)
 
     m_cache_start_position = 0;
     m_cache_read_position = 0;
+    m_cache_initialized = false;
 
     ReaderImpl::Reset(header);
 }
diff --git a/Utilities/otbliblas/src/detail/reader/header.cpp b/Utilities/otbliblas/src/detail/reader/header.cpp
index 92883c7bec348866d27672d98dfff87a6458dceb..2187d980854345b3e08be38fe0ea55ff7181d656 100755
--- a/Utilities/otbliblas/src/detail/reader/header.cpp
+++ b/Utilities/otbliblas/src/detail/reader/header.cpp
@@ -203,14 +203,11 @@ void Header::read()
     m_header->SetPointRecordsCount(n4);
 
     // 20. Number of points by return
-    // The committee in its infinite stupidity decided to increase the 
-    // size of this array at 1.3.  Yay for complex code.
+    // A few versions of the spec had this as 7, but 
+    // https://lidarbb.cr.usgs.gov/index.php?showtopic=11388 says 
+    // it is supposed to always be 5
     std::vector<uint32_t>::size_type  return_count_length;
-    if (m_header->GetVersionMinor() > 2) {
-        return_count_length = 7;
-    } else {
-        return_count_length = 5;
-    }
+    return_count_length = 5;
 
     uint32_t* point_counts = new uint32_t[return_count_length];
     for (uint32_t i = 0; i < return_count_length; ++i) {
@@ -280,41 +277,64 @@ void Header::read()
     if (m_ifs.eof())
         m_ifs.clear();
     
-    // NOTE: This section is commented out because we now have to believe 
-    // the header's GetPointRecordsCount due to the fact that the LAS 1.3 
-    // specification no longer mandates that the end of the file is the end
-    // of the points.  See http://trac.liblas.org/ticket/147 for more 
-    // details on this issue and why the seek is a problem in the windows 
-    // case.
-    // // Seek to the beginning
-    // m_ifs.seekg(0, std::ios::beg);
-    // std::ios::pos_type beginning = m_ifs.tellg();
-    // 
-    // // Seek to the end
-    // m_ifs.seekg(0, std::ios::end);
-    // std::ios::pos_type end = m_ifs.tellg();
-    // std::ios::off_type size = end - beginning;
-    //  
-    // // Figure out how many points we have 
-    // std::ios::off_type count = (end - static_cast<std::ios::off_type>(m_header->GetDataOffset())) / 
-    //                              static_cast<std::ios::off_type>(m_header->GetDataRecordLength());
-    // 
-    // if ( m_header->GetPointRecordsCount() != static_cast<uint32_t>(count)) {
-    //     std::ostringstream msg; 
-    //     msg <<  "The number of points in the header that was set "
-    //             "by the software '" << m_header->GetSoftwareId() <<
-    //             "' does not match the actual number of points in the file "
-    //             "as determined by subtracting the data offset (" 
-    //             <<m_header->GetDataOffset() << ") from the file length (" 
-    //             << size <<  ") and dividing by the point record length(" 
-    //             << m_header->GetDataRecordLength() << "). "
-    //             " Actual number of points: " << count << 
-    //             " Header-specified number of points: " 
-    //             << m_header->GetPointRecordsCount() ;
-    //     throw std::runtime_error(msg.str());
-    //     
-    // }
+    // LAS 1.3 specification no longer mandates that the end of the file is the
+    // end of the points. See http://trac.liblas.org/ticket/147 for more details
+    // on this issue and why the seek can be trouble in the windows case.  
+    // If you are having trouble properly seeking to the end of the stream on 
+    // windows, use boost's iostreams or similar, which do not have an overflow 
+    // problem.
+    
+    if (m_header->GetVersionMinor() < 3) 
+    {
+        // Seek to the beginning 
+        m_ifs.seekg(0, std::ios::beg);
+        std::ios::pos_type beginning = m_ifs.tellg();
     
+        // Seek to the end
+        m_ifs.seekg(0, std::ios::end);
+        std::ios::pos_type end = m_ifs.tellg();
+        std::ios::off_type size = end - beginning;
+        std::ios::off_type offset = static_cast<std::ios::off_type>(m_header->GetDataOffset());
+        std::ios::off_type length = static_cast<std::ios::off_type>(m_header->GetDataRecordLength());
+        std::ios::off_type point_bytes = end - offset;
+
+        // Figure out how many points we have and whether or not we have 
+        // extra slop in there.
+        std::ios::off_type count = point_bytes / length;
+        std::ios::off_type remainder = point_bytes % length;
+        
+
+        if ( m_header->GetPointRecordsCount() != static_cast<uint32_t>(count)) {
+            if (remainder == 0)
+            {
+                // The point bytes are exactly long enough, let's use it
+                // Set the count to what we calculated
+                m_header->SetPointRecordsCount(static_cast<boost::uint32_t>(count));
+                
+            } 
+            else 
+            {
+                std::ostringstream msg; 
+                msg <<  "The number of points in the header that was set "
+                        "by the software '" << m_header->GetSoftwareId() <<
+                        "' does not match the actual number of points in the file "
+                        "as determined by subtracting the data offset (" 
+                        <<m_header->GetDataOffset() << ") from the file length (" 
+                        << size <<  ") and dividing by the point record length (" 
+                        << m_header->GetDataRecordLength() << ")."
+                        " It also does not perfectly contain an exact number of"
+                        " point data and we cannot infer a point count."
+                        " Calculated number of points: " << count << 
+                        " Header-specified number of points: " 
+                        << m_header->GetPointRecordsCount() <<
+                        " Point data remainder: " << remainder;
+                throw std::runtime_error(msg.str());                
+            }
+
+
+        
+        }
+    }
     // Seek to the data offset so we can start reading points
     m_ifs.seekg(m_header->GetDataOffset());
 
diff --git a/Utilities/otbliblas/src/detail/reader/point.cpp b/Utilities/otbliblas/src/detail/reader/point.cpp
index bfdfc61acc79a3a70cc77092c2b2658769da008b..381348d21b326709fdf91d018918bfdd8f1a2a98 100755
--- a/Utilities/otbliblas/src/detail/reader/point.cpp
+++ b/Utilities/otbliblas/src/detail/reader/point.cpp
@@ -58,9 +58,9 @@ namespace liblas { namespace detail { namespace reader {
 Point::Point(std::istream& ifs, HeaderPtr header)
     : m_ifs(ifs)
     , m_header(header)
-
+    , m_point(m_header)
+    , m_raw_data(m_header->GetSchema().GetByteSize())
 {
-    setup();
 }
 
 Point::~Point()
@@ -74,23 +74,21 @@ std::istream& Point::GetStream() const
 
 void Point::read()
 {
-    
+    assert(m_header);
+    assert(m_point.GetHeaderPtr());
+    assert(m_raw_data.size() > 0);
+
     try
     {
         detail::read_n(m_raw_data.front(), m_ifs, m_raw_data.size());
     }
     catch (std::out_of_range const& e) // we reached the end of the file
     {
+        // FIXME: Why do we kill the error? It cause setting m_point with invali data, doesn't it? --mloskot
         std::cerr << e.what() << std::endl;
     }    
     
     m_point.SetData(m_raw_data);
 }
 
-void Point::setup()
-{
-    m_raw_data.resize(m_header->GetSchema().GetByteSize());
-    m_point.SetHeaderPtr(m_header);
-}
-
 }}} // namespace liblas::detail::reader
diff --git a/Utilities/otbliblas/src/detail/writer/point.cpp b/Utilities/otbliblas/src/detail/writer/point.cpp
index 40ee2caf0677701a274edf9d513fa2f42b894630..bd363823deb7bb7c83c70476e01160d02bca1edb 100755
--- a/Utilities/otbliblas/src/detail/writer/point.cpp
+++ b/Utilities/otbliblas/src/detail/writer/point.cpp
@@ -77,12 +77,9 @@ void Point::setup()
     // that we can write into the file as necessary.  We make it 
     // here instead of at each ::write() invocation to save the 
     // allocation and writing of the array
-    if (m_format.GetByteSize() != m_format.GetBaseByteSize()) {
-        std::size_t size = m_format.GetByteSize() - m_format.GetBaseByteSize();
-        
-        if (size < 0) {
-            throw std::runtime_error("ByteSize of format was less than BaseByteSize, this cannot happen!");
-        }
+    if (m_format.GetByteSize() != m_format.GetBaseByteSize())
+	{
+        std::size_t const size = m_format.GetByteSize() - m_format.GetBaseByteSize();
         
         m_blanks.resize(size);
         m_blanks.assign(size, 0);
diff --git a/Utilities/otbliblas/src/gt_citation.cpp b/Utilities/otbliblas/src/gt_citation.cpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/src/gt_wkt_srs.cpp b/Utilities/otbliblas/src/gt_wkt_srs.cpp
old mode 100755
new mode 100644
index f66a4ec53b6aad9bba8246dcdd69572bf17401f6..bbfd2b87f8288aeea70cba65a785587189b7889e
--- a/Utilities/otbliblas/src/gt_wkt_srs.cpp
+++ b/Utilities/otbliblas/src/gt_wkt_srs.cpp
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: gt_wkt_srs.cpp 20480 2010-08-28 21:20:15Z rouault $
+ * $Id$
  *
  * Project:  GeoTIFF Driver
  * Purpose:  Implements translation between GeoTIFF normalized projection
@@ -42,7 +42,7 @@
 #include "xtiffio.h"
 #include "cpl_multiproc.h"
 
-CPL_CVSID("$Id: gt_wkt_srs.cpp 20480 2010-08-28 21:20:15Z rouault $")
+CPL_CVSID("$Id$")
 
 CPL_C_START
 int CPL_DLL VSIFCloseL( FILE * );
@@ -65,6 +65,12 @@ CPLErr CPL_DLL GTIFMemBufFromWkt( const char *pszWKT,
 CPLErr CPL_DLL GTIFWktFromMemBuf( int nSize, unsigned char *pabyBuffer, 
                           char **ppszWKT, double *padfGeoTransform,
                           int *pnGCPCount, GDAL_GCP **ppasGCPList );
+
+#undef CSVReadParseLine
+char CPL_DLL  **CSVReadParseLine( FILE *fp);
+#undef CSLDestroy
+void CPL_DLL CPL_STDCALL CSLDestroy(char **papszStrList);
+
 CPL_C_END
 
 TIFF* VSI_TIFFOpen(const char* name, const char* mode);
@@ -101,6 +107,24 @@ void GetGeogCSFromCitation(char* szGCSName, int nGCSName,
                           char	**ppszSpheroidName,
                           char	**ppszAngularUnits);
 
+/************************************************************************/
+/*                       GTIFToCPLRecyleString()                        */
+/*                                                                      */
+/*      This changes a string from the libgeotiff heap to the GDAL      */
+/*      heap.                                                           */
+/************************************************************************/
+
+static void GTIFToCPLRecycleString( char **ppszTarget )
+
+{
+    if( *ppszTarget == NULL )
+        return;
+
+    char *pszTempString = CPLStrdup(*ppszTarget);
+    GTIFFreeMemory( *ppszTarget );
+    *ppszTarget = pszTempString;
+}
+
 /************************************************************************/
 /*                          WKTMassageDatum()                           */
 /*                                                                      */
@@ -114,14 +138,7 @@ static void WKTMassageDatum( char ** ppszDatum )
     int		i, j;
     char	*pszDatum;
 
-/* -------------------------------------------------------------------- */
-/*      First copy string and allocate with our CPLStrdup() to so we    */
-/*      know when we are done this function we will have a CPL          */
-/*      string, not a GTIF one.                                         */
-/* -------------------------------------------------------------------- */
-    pszDatum = CPLStrdup(*ppszDatum);
-    GTIFFreeMemory( *ppszDatum );
-    *ppszDatum = pszDatum;
+    pszDatum = *ppszDatum;
     if (pszDatum[0] == '\0')
         return;
 
@@ -179,11 +196,11 @@ static void WKTMassageDatum( char ** ppszDatum )
 /************************************************************************/
 
 /* For example:
-   GTCitationGeoKey (Ascii,215): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision: 20480 $ $Date: 2010-08-28 17:20:15 -0400 (Sat, 28 Aug 2010) $\nProjection Name = UTM\nUnits = meters\nGeoTIFF Units = meters"
+   GTCitationGeoKey (Ascii,215): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision$ $Date$\nProjection Name = UTM\nUnits = meters\nGeoTIFF Units = meters"
 
-   GeogCitationGeoKey (Ascii,267): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision: 20480 $ $Date: 2010-08-28 17:20:15 -0400 (Sat, 28 Aug 2010) $\nUnable to match Ellipsoid (Datum) to a GeographicTypeGeoKey value\nEllipsoid = Clarke 1866\nDatum = NAD27 (CONUS)"
+   GeogCitationGeoKey (Ascii,267): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision$ $Date$\nUnable to match Ellipsoid (Datum) to a GeographicTypeGeoKey value\nEllipsoid = Clarke 1866\nDatum = NAD27 (CONUS)"
 
-   PCSCitationGeoKey (Ascii,214): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision: 20480 $ $Date: 2010-08-28 17:20:15 -0400 (Sat, 28 Aug 2010) $\nUTM Zone 10N\nEllipsoid = Clarke 1866\nDatum = NAD27 (CONUS)"
+   PCSCitationGeoKey (Ascii,214): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision$ $Date$\nUTM Zone 10N\nEllipsoid = Clarke 1866\nDatum = NAD27 (CONUS)"
  
 */
 
@@ -354,23 +371,36 @@ char *GTIFGetOGISDefn( GTIF *hGTIF, GTIFDefn * psDefn )
         && hGTIF != NULL 
         && GTIFKeyGet( hGTIF, GeogCitationGeoKey, szGCSName, 0, 
                        sizeof(szGCSName)) )
-      GetGeogCSFromCitation(szGCSName, sizeof(szGCSName),
-                            GeogCitationGeoKey, 
-                          &pszGeogName, &pszDatumName,
-                          &pszPMName, &pszSpheroidName,
-                          &pszAngularUnits);
-
+    {
+        GetGeogCSFromCitation(szGCSName, sizeof(szGCSName),
+                              GeogCitationGeoKey, 
+                              &pszGeogName, &pszDatumName,
+                              &pszPMName, &pszSpheroidName,
+                              &pszAngularUnits);
+    }
+    else
+        GTIFToCPLRecycleString( &pszGeogName );
+        
     if( !pszDatumName )
+    {
       GTIFGetDatumInfo( psDefn->Datum, &pszDatumName, NULL );
+      GTIFToCPLRecycleString( &pszDatumName );
+    }
     if( !pszSpheroidName )
+    {
       GTIFGetEllipsoidInfo( psDefn->Ellipsoid, &pszSpheroidName, NULL, NULL );
+      GTIFToCPLRecycleString( &pszSpheroidName );
+    }
     else
     {
       GTIFKeyGet(hGTIF, GeogSemiMajorAxisGeoKey, &(psDefn->SemiMajor), 0, 1 );
       GTIFKeyGet(hGTIF, GeogInvFlatteningGeoKey, &dfInvFlattening, 0, 1 );
     }
     if( !pszPMName )
-      GTIFGetPMInfo( psDefn->PM, &pszPMName, NULL );
+    {
+        GTIFGetPMInfo( psDefn->PM, &pszPMName, NULL );
+        GTIFToCPLRecycleString( &pszPMName );
+    }
     else
       GTIFKeyGet(hGTIF, GeogPrimeMeridianLongGeoKey, &(psDefn->PMLongToGreenwich), 0, 1 );
     
@@ -379,6 +409,8 @@ char *GTIFGetOGISDefn( GTIF *hGTIF, GTIFDefn * psDefn )
       GTIFGetUOMAngleInfo( psDefn->UOMAngle, &pszAngularUnits, NULL );
       if( pszAngularUnits == NULL )
           pszAngularUnits = CPLStrdup("unknown");
+      else
+          GTIFToCPLRecycleString( &pszAngularUnits );
     }
     else
     {
@@ -386,8 +418,8 @@ char *GTIFGetOGISDefn( GTIF *hGTIF, GTIFDefn * psDefn )
       aUnitGot = TRUE;
     }
 
-    if( pszDatumName != NULL )            /* was a GTIFFreeMemory'able string */
-        WKTMassageDatum( &pszDatumName ); /* now a CPLFree'able string */
+    if( pszDatumName != NULL )
+        WKTMassageDatum( &pszDatumName );
 
     dfSemiMajor = psDefn->SemiMajor;
     if( dfSemiMajor == 0.0 )
@@ -408,9 +440,10 @@ char *GTIFGetOGISDefn( GTIF *hGTIF, GTIFDefn * psDefn )
     }
     if(!pszGeogName || strlen(pszGeogName) == 0)
     {
-      GTIFFreeMemory(pszGeogName);             /* was a GTIFFreeMemory'able string */
-      pszGeogName = CPLStrdup( pszDatumName ); /* now a CPLFree'able string */
+        CPLFree(pszGeogName);
+        pszGeogName = CPLStrdup( pszDatumName );
     }
+
     if(aUnitGot)
       oSRS.SetGeogCS( pszGeogName, pszDatumName, 
                       pszSpheroidName, dfSemiMajor, dfInvFlattening,
@@ -437,9 +470,9 @@ char *GTIFGetOGISDefn( GTIF *hGTIF, GTIFDefn * psDefn )
 
     CPLFree( pszGeogName );
     CPLFree( pszDatumName );
-    GTIFFreeMemory( pszPMName );
-    GTIFFreeMemory( pszSpheroidName );
-    GTIFFreeMemory( pszAngularUnits );
+    CPLFree( pszSpheroidName );
+    CPLFree( pszPMName );
+    CPLFree( pszAngularUnits );
         
 /* ==================================================================== */
 /*      Handle projection parameters.                                   */
@@ -895,6 +928,7 @@ static int OGCDatumName2EPSGDatumCode( const char * pszOGCName )
     char	**papszTokens;
     int		nReturn = KvUserDefined;
 
+
 /* -------------------------------------------------------------------- */
 /*      Do we know it as a built in?                                    */
 /* -------------------------------------------------------------------- */
@@ -909,7 +943,7 @@ static int OGCDatumName2EPSGDatumCode( const char * pszOGCName )
         return Datum_WGS84;
     else if( EQUAL(pszOGCName,"WGS72") || EQUAL(pszOGCName,"WGS_1972") )
         return Datum_WGS72;
-    
+
 /* -------------------------------------------------------------------- */
 /*      Open the table if possible.                                     */
 /* -------------------------------------------------------------------- */
diff --git a/Utilities/otbliblas/src/las_c_api.cpp b/Utilities/otbliblas/src/las_c_api.cpp
old mode 100755
new mode 100644
index cce5b70dfb2c7dd6ae744dff60f332555da448bf..898fc65086e7411f75c383ded3c6766e8a19a194
--- a/Utilities/otbliblas/src/las_c_api.cpp
+++ b/Utilities/otbliblas/src/las_c_api.cpp
@@ -2038,23 +2038,21 @@ LAS_DLL LASSchemaH LASSchema_Create(  liblas::PointFormatName point_format) {
 }
 
 
-LAS_DLL boost::uint16_t LASSchema_GetByteSize( LASSchemaH hFormat)
+LAS_DLL unsigned int LASSchema_GetByteSize( LASSchemaH hFormat)
 {
     VALIDATE_LAS_POINTER1(hFormat, "LASSchema_GetByteSize", 0);
     
     liblas::Schema* format = ((liblas::Schema*) hFormat);
-    // TODO: I'd advise to change API to return built-in C type size_t --mloskot
-    return format->GetByteSize();    
+    return static_cast<unsigned int>(format->GetByteSize());    
 }
 
 
-LAS_DLL boost::uint16_t LASSchema_GetBaseByteSize( LASSchemaH hFormat)
+LAS_DLL unsigned int LASSchema_GetBaseByteSize( LASSchemaH hFormat)
 {
     VALIDATE_LAS_POINTER1(hFormat, "LASSchema_GetBaseByteSize", 0);
     
     liblas::Schema* format = ((liblas::Schema*) hFormat);
-    // TODO: I'd advise to change API to return built-in C type size_t --mloskot
-    return format->GetByteSize();    
+    return static_cast<unsigned int>(format->GetBaseByteSize());    
 }
 
 
diff --git a/Utilities/otbliblas/src/lasclassification.cpp b/Utilities/otbliblas/src/lasclassification.cpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/src/lasdimension.cpp b/Utilities/otbliblas/src/lasdimension.cpp
old mode 100755
new mode 100644
index db2f144670fe1e2ed376743b698173f9d5957fa6..f48fe86ca10596fd1dbde05bd1fdf541fb7bb89e
--- a/Utilities/otbliblas/src/lasdimension.cpp
+++ b/Utilities/otbliblas/src/lasdimension.cpp
@@ -77,12 +77,11 @@ Dimension::Dimension(std::string const& name, std::size_t size_in_bits) :
     m_byte_offset(0),
     m_bit_offset(0)
 {
-     if (size_in_bits == 0) {
-        std::ostringstream oss;
-        oss << "The bit size of the dimension is 0, the dimension is invalid.";
-        throw std::runtime_error(oss.str());
+     if (0 == size_in_bits)
+	 {
+        throw std::runtime_error("The bit size of the dimension is 0, the dimension is invalid.");
      }
-};
+}
 
 /// copy constructor
 Dimension::Dimension(Dimension const& other) :
@@ -101,8 +100,8 @@ Dimension::Dimension(Dimension const& other) :
     , m_bit_offset(other.m_bit_offset)
 {
 }
-// 
-// // assignment constructor
+ 
+/// assignment operator
 Dimension& Dimension::operator=(Dimension const& rhs)
 {
     if (&rhs != this)
@@ -127,9 +126,9 @@ Dimension& Dimension::operator=(Dimension const& rhs)
 
 std::size_t Dimension::GetByteSize() const 
 {
-
-    std::size_t bit_position = m_bit_size % 8;
-    if (bit_position > 0) {
+    std::size_t const bit_position = m_bit_size % 8;
+    if (bit_position > 0)
+	{
         // For dimensions that are not byte aligned,
         // we need to determine how many bytes they 
         // will take.  We have to read at least one byte if the 
@@ -160,9 +159,10 @@ liblas::property_tree::ptree Dimension::GetPTree() const
     dim.put("bitoffset" , GetBitOffset());
     dim.put("bytesize", GetByteSize());
     
-   if (IsNumeric()) {
+   if (IsNumeric())
+   {
        if (! (detail::compare_distance(GetMinimum(), GetMaximum() ) 
-            && detail::compare_distance(0.0, GetMaximum())))
+           && detail::compare_distance(0.0, GetMaximum())))
        {
            dim.put("minimum", GetMinimum());
            dim.put("maximum", GetMaximum());
@@ -174,15 +174,22 @@ liblas::property_tree::ptree Dimension::GetPTree() const
 
 std::ostream& operator<<(std::ostream& os, liblas::Dimension const& d)
 {
-    
     using liblas::property_tree::ptree;
     ptree tree = d.GetPTree();
     
-    std::string name = tree.get<std::string>("name");
-    
+    std::string const name = tree.get<std::string>("name");
 
-    os << "'" << name << "'" << " -- ";
-    os << " size: " << tree.get<boost::uint32_t>("size");
+    std::ostringstream quoted_name;
+    quoted_name << "'" << name << "'";
+    std::ostringstream pad;
+    std::string const& cur = quoted_name.str();
+    std::string::size_type size = cur.size();
+    std::string::size_type pad_size = 30 - size;
+    
+    for (std::string::size_type i=0; i != pad_size; i++ ) {
+        pad << " ";
+    }
+    os << quoted_name.str() << pad.str() <<" -- "<< " size: " << tree.get<boost::uint32_t>("size");
     os << " offset: " << tree.get<boost::uint32_t>("byteoffset");
     os << std::endl;
     
diff --git a/Utilities/otbliblas/src/lasfilter.cpp b/Utilities/otbliblas/src/lasfilter.cpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/src/lasheader.cpp b/Utilities/otbliblas/src/lasheader.cpp
old mode 100755
new mode 100644
index 7daebc2f2e66246ec8d709eb33f8891198c581d1..652555e8f6ce5c84577bd015d753004b3acc6307
--- a/Utilities/otbliblas/src/lasheader.cpp
+++ b/Utilities/otbliblas/src/lasheader.cpp
@@ -64,7 +64,7 @@ namespace liblas {
 
 char const* const Header::FileSignature = "LASF";
 char const* const Header::SystemIdentifier = "libLAS";
-char const* const Header::SoftwareIdentifier = "libLAS 1.2";
+char const* const Header::SoftwareIdentifier = "libLAS 1.6.0b2";
 
 
 Header::Header() : m_schema(ePointFormat3)
@@ -439,10 +439,11 @@ double Header::GetScaleZ() const
 
 void Header::SetScale(double x, double y, double z)
 {
+
     double const minscale = 0.01;
-    m_scales.x = (0 == x) ? minscale : x;
-    m_scales.y = (0 == y) ? minscale : y;
-    m_scales.z = (0 == z) ? minscale : z;
+    m_scales.x = (detail::compare_distance(0.0, x)) ? minscale : x;
+    m_scales.y = (detail::compare_distance(0.0, y)) ? minscale : y;
+    m_scales.z = (detail::compare_distance(0.0, z)) ? minscale : z;
 }
 
 double Header::GetOffsetX() const
@@ -827,34 +828,54 @@ void Header::to_rst(std::ostream& os) const
     os << "  Number of Points by Return:  " << returns_oss.str() << std::endl;
 
     os.setf(std::ios_base::fixed, std::ios_base::floatfield);
-    double scale = tree.get<double>("scale.z");
+    double x_scale = tree.get<double>("scale.x");
+    double y_scale = tree.get<double>("scale.y");
+    double z_scale = tree.get<double>("scale.z");
 
+    boost::uint32_t x_precision = 6;
+    boost::uint32_t y_precision = 6;
+    boost::uint32_t z_precision = 6;
     double frac = 0;
     double integer = 0;
-    frac = std::modf(scale, &integer);
-
-    boost::uint32_t prec = static_cast<boost::uint32_t>(std::fabs(std::floor(std::log10(frac))));
-    os.precision(prec);
-
-    os << "  Scale Factor X Y Z:          " 
-     << tree.get<double>("scale.x") << " " 
-     << tree.get<double>("scale.y") << " " 
-     << tree.get<double>("scale.z") << std::endl;
-
-    os << "  Offset X Y Z:                " 
-     << tree.get<double>("offset.x") << " " 
-     << tree.get<double>("offset.y") << " " 
-     << tree.get<double>("offset.z") << std::endl;
-
-    os << "  Min X Y Z:                   " 
-     << tree.get<double>("minimum.x") << " " 
-     << tree.get<double>("minimum.y") << " " 
-     << tree.get<double>("minimum.z") << std::endl;
-
-    os << "  Max X Y Z:                   " 
-     << tree.get<double>("maximum.x") << " " 
-     << tree.get<double>("maximum.y") << " " 
-     << tree.get<double>("maximum.z") << std::endl;         
+    
+    frac = std::modf(x_scale, &integer);
+    x_precision = static_cast<boost::uint32_t>(std::fabs(std::floor(std::log10(frac))));
+    frac = std::modf(y_scale, &integer);
+    y_precision = static_cast<boost::uint32_t>(std::fabs(std::floor(std::log10(frac))));
+    frac = std::modf(z_scale, &integer);
+    z_precision = static_cast<boost::uint32_t>(std::fabs(std::floor(std::log10(frac))));
+
+    os << "  Scale Factor X Y Z:          ";
+    os.precision(x_precision);
+    os << tree.get<double>("scale.x") << " "; 
+    os.precision(y_precision);
+    os << tree.get<double>("scale.y") << " "; 
+    os.precision(z_precision);
+    os << tree.get<double>("scale.z") << std::endl;
+
+    os << "  Offset X Y Z:                ";
+    os.precision(x_precision);
+    os << tree.get<double>("offset.x") << " ";
+    os.precision(y_precision);
+    os << tree.get<double>("offset.y") << " ";
+    os.precision(z_precision);
+    os << tree.get<double>("offset.z") << std::endl;
+
+    os << "  Min X Y Z:                   ";
+    os.precision(x_precision);
+    os << tree.get<double>("minimum.x") << " "; 
+    os.precision(y_precision);
+    os << tree.get<double>("minimum.y") << " ";
+    os.precision(z_precision);
+    os << tree.get<double>("minimum.z") << std::endl;
+
+    os << "  Max X Y Z:                   ";
+    os.precision(x_precision);
+    os << tree.get<double>("maximum.x") << " ";
+    os.precision(y_precision);
+    os << tree.get<double>("maximum.y") << " ";
+    os.precision(z_precision);
+    os << tree.get<double>("maximum.z") << std::endl;         
 
     os << "  Spatial Reference:  " << std::endl;
     os << tree.get<std::string>("srs.prettywkt") << std::endl;
diff --git a/Utilities/otbliblas/src/lasindex.cpp b/Utilities/otbliblas/src/lasindex.cpp
index 48a3b6807f15a057eea5cb54c5d6177c188c5b01..59cff67d8219f4119c94c65ce8889eed66a68e82 100755
--- a/Utilities/otbliblas/src/lasindex.cpp
+++ b/Utilities/otbliblas/src/lasindex.cpp
@@ -113,6 +113,8 @@ void Index::SetValues(void)
 	m_indexAuthor = "";
 	m_indexComment = "";
 	m_indexDate = "";
+	m_versionMajor = LIBLAS_INDEX_VERSIONMAJOR;
+	m_versionMinor = LIBLAS_INDEX_VERSIONMINOR;
 	m_cellSizeZ = 0.0;
 	m_debugger = stderr;
 	m_readOnly = false;
@@ -120,13 +122,8 @@ void Index::SetValues(void)
 	m_DataVLR_ID = 43;
 	m_maxMemoryUsage = LIBLAS_INDEX_MAXMEMDEFAULT;
     m_rangeX = m_rangeY = m_rangeZ = m_cellSizeZ = m_cellSizeX = m_cellSizeY = 
-		m_filterMinXCell = m_filterMaxXCell = m_filterMinYCell = m_filterMaxYCell = m_filterMinZCell = m_filterMaxZCell = 
-		m_LowXBorderPartCell = m_HighXBorderPartCell = m_LowYBorderPartCell = m_HighYBorderPartCell = 0.0;
-    m_pointRecordsCount = m_maxMemoryUsage = m_cellsX = m_cellsY = m_cellsZ = m_totalCells = m_tempFileWrittenBytes = 0;
-    m_LowXCellCompletelyIn = m_HighXCellCompletelyIn = m_LowYCellCompletelyIn = m_HighYCellCompletelyIn = 
-		m_LowZCellCompletelyIn = m_HighZCellCompletelyIn =
-		m_LowXBorderCell = m_HighXBorderCell = m_LowYBorderCell = m_HighYBorderCell = 
-		m_LowZBorderCell = m_HighZBorderCell = 0;
+		m_pointRecordsCount = m_maxMemoryUsage = m_cellsX = m_cellsY = m_cellsZ = m_totalCells = 0;
+    m_tempFileWrittenBytes = 0;
 	m_indexBuilt = m_tempFileStarted = m_readerCreated = false;
 } // Index::SetValues
 
@@ -253,102 +250,187 @@ bool Index::Validate(void)
 	
 } // Index::Validate
 
-const std::vector<boost::uint32_t>& Index::Filter(IndexData const& ParamSrc)
+boost::uint32_t Index::GetDefaultReserve(void)
 {
+	return (GetPointRecordsCount() < LIBLAS_INDEX_RESERVEFILTERDEFAULT ? GetPointRecordsCount(): LIBLAS_INDEX_RESERVEFILTERDEFAULT);
+} // Index::GetDefaultReserve
 
-	// if there is already a list, get rid of it
-	m_filterResult.resize(0);
-	if (m_reader)
-	{
-		for (boost::uint32_t i = 0; i < m_idxheader.GetRecordsCount(); ++i)
+const std::vector<boost::uint32_t>& Index::Filter(IndexData & ParamSrc)
+{
+
+	try {
+		// if there is already a list, get rid of it
+		m_filterResult.resize(0);
+		// are we asked to advance beyond the number of points in the file? that would be a mistake and waste of time.
+		if (ParamSrc.m_iterator && 
+			(ParamSrc.m_iterator->m_advance + ParamSrc.m_iterator->m_totalPointsScanned > GetPointRecordsCount()))
+			return (m_filterResult);
+			
+		m_filterResult.reserve(ParamSrc.m_iterator ? ParamSrc.m_iterator->m_chunkSize: GetDefaultReserve());
+		if (m_reader)
 		{
-			VariableRecord const& vlr = m_idxheader.GetVLR(i);
-			// a combination of "liblas" and 42 denotes that this is a liblas spatial index id
-			if (std::string(vlr.GetUserId(false)) == std::string("liblas"))
+			boost::uint32_t i;
+			i = ParamSrc.m_iterator ? ParamSrc.m_iterator->m_curVLR: 0;
+			for (; i < m_idxheader.GetRecordsCount(); ++i)
 			{
-				boost::uint16_t RecordID = vlr.GetRecordId();
-				if (RecordID == 42)
+				VariableRecord const& vlr = m_idxheader.GetVLR(i);
+				// a combination of "liblas" and 42 denotes that this is a liblas spatial index id
+				if (std::string(vlr.GetUserId(false)) == std::string("liblas"))
 				{
-					if (! LoadIndexVLR(vlr))
-						break;
-					// Beyond the first record would be more VLR's with the actual index data
-					// some cells will fall completely inside, some outside and some straddling the filter bounds	
-					SetCellFilterBounds(ParamSrc);
-					if (! m_bounds.intersects(ParamSrc.m_filter))
+					boost::uint16_t RecordID = vlr.GetRecordId();
+					if (RecordID == 42)
 					{
-						if (m_debugOutputLevel > 1)
-							fprintf(m_debugger, "Index bounds do not intersect filter bounds.\n");
-						break;
-					} // if
-				} // if 42
-				else if (RecordID == m_DataVLR_ID)
-				{
-					// some of our data is in this record
-					if (! FilterOneVLR(vlr, i, ParamSrc))
-						break;
-				} // else if ID matches ID stored in index header
+						if (! LoadIndexVLR(vlr))
+							break;
+						// Beyond the first record would be more VLR's with the actual index data
+						// some cells will fall completely inside, some outside and some straddling the filter bounds	
+						SetCellFilterBounds(ParamSrc);
+						if (! m_bounds.intersects(ParamSrc.m_filter))
+						{
+							if (m_debugOutputLevel > 1)
+								fprintf(m_debugger, "Index bounds do not intersect filter bounds.\n");
+							break;
+						} // if
+					} // if 42
+					else if (RecordID == m_DataVLR_ID)
+					{
+						// some of our data is in this record
+						bool VLRDone = false;
+						const boost::uint32_t HeadVLR = i;
+						if (! FilterOneVLR(vlr, i, ParamSrc, VLRDone))
+							break;
+						if (ParamSrc.m_iterator)
+						{
+							if (VLRDone)
+								ParamSrc.m_iterator->m_curCellStartPos = ParamSrc.m_iterator->m_ptsScannedCurCell = 
+									ParamSrc.m_iterator->m_ptsScannedCurVLR = 0;
+							// if we've filled our quota break out of loop
+							if (m_filterResult.size() >= ParamSrc.m_iterator->m_chunkSize)
+							{
+								// if we've scanned the entire VLR
+								if (VLRDone)
+									++i;	// increment i so that next iteration starts on next VLR
+								else if (i != HeadVLR)	// if VLR's are linked FilterOneVLR() will have incremented i
+									i = HeadVLR;	// put back i so that the right VLR is loaded first next iteration
+								break;
+							} // if
+						} // if
+					} // else if ID matches ID stored in index header
+				}
 			}
-		}
-	} // m_reader
+			if (ParamSrc.m_iterator)
+				ParamSrc.m_iterator->m_curVLR = i;
+		} // m_reader
+	} // try
+	catch (std::bad_alloc) {
+		m_filterResult.resize(0);
+	} // catch
 	return (m_filterResult);
 
 } // Index::Filter
 
-void Index::SetCellFilterBounds(IndexData const& ParamSrc)
+IndexIterator* Index::Filter(IndexData const& ParamSrc, boost::uint32_t ChunkSize)
+{
+	IndexIterator* NewIter = NULL;
+
+	try {
+		NewIter = new IndexIterator(this, ParamSrc, ChunkSize);
+	} // try
+	catch (std::bad_alloc) {
+		return (NULL);
+	} // catch
+
+	return (NewIter);
+
+} // Index::Filter
+
+IndexIterator* Index::Filter(double LowFilterX, double HighFilterX, double LowFilterY, double HighFilterY, 
+	double LowFilterZ, double HighFilterZ, boost::uint32_t ChunkSize)
 {
-	double LowXCell, HighXCell, LowYCell, HighYCell, LowZCell, HighZCell;
+	IndexIterator* NewIter = NULL;
+
+	try {
+		NewIter = new IndexIterator(this, LowFilterX, HighFilterX, LowFilterY, HighFilterY, 
+			LowFilterZ, HighFilterZ, ChunkSize);
+	} // try
+	catch (std::bad_alloc) {
+		return (NULL);
+	} // catch
+
+	return (NewIter);
+
+} // Index::Filter
+
+IndexIterator* Index::Filter(Bounds<double> const& BoundsSrc, boost::uint32_t ChunkSize)
+{
+	IndexIterator* NewIter = NULL;
+
+	try {
+		NewIter = new IndexIterator(this, BoundsSrc, ChunkSize);
+	} // try
+	catch (std::bad_alloc) {
+		return (NULL);
+	} // catch
+
+	return (NewIter);
+
+} // Index::Filter
+
+void Index::SetCellFilterBounds(IndexData & ParamSrc)
+{
+	double LowXCell, HighXCell, LowYCell, HighYCell, LowZCell, HighZCell,
+		filterMinXCell, filterMaxXCell, filterMinYCell, filterMaxYCell, filterMinZCell, filterMaxZCell;
 	// convert filter bounds into cell numbers
 	// X and Y range can not be 0 or the index would not have been built
-	m_filterMinXCell = m_cellsX * (ParamSrc.GetMinFilterX() - GetMinX()) / GetRangeX();
-	m_filterMaxXCell = m_cellsX * (ParamSrc.GetMaxFilterX() - GetMinX()) / GetRangeX();
-	m_filterMinYCell = m_cellsY * (ParamSrc.GetMinFilterY() - GetMinY()) / GetRangeY();
-	m_filterMaxYCell = m_cellsY * (ParamSrc.GetMaxFilterY() - GetMinY()) / GetRangeY();
+	filterMinXCell = m_cellsX * (ParamSrc.GetMinFilterX() - GetMinX()) / GetRangeX();
+	filterMaxXCell = m_cellsX * (ParamSrc.GetMaxFilterX() - GetMinX()) / GetRangeX();
+	filterMinYCell = m_cellsY * (ParamSrc.GetMinFilterY() - GetMinY()) / GetRangeY();
+	filterMaxYCell = m_cellsY * (ParamSrc.GetMaxFilterY() - GetMinY()) / GetRangeY();
 	// Z range however can be 0
 	if (GetRangeZ() > 0.0 && ! detail::compare_distance(GetRangeZ(), 0.0))
 	{
-		m_filterMinZCell = m_cellsZ * (ParamSrc.GetMinFilterZ() - GetMinZ()) / GetRangeZ();
-		m_filterMaxZCell = m_cellsZ * (ParamSrc.GetMaxFilterZ() - GetMinZ()) / GetRangeZ();
+		filterMinZCell = m_cellsZ * (ParamSrc.GetMinFilterZ() - GetMinZ()) / GetRangeZ();
+		filterMaxZCell = m_cellsZ * (ParamSrc.GetMaxFilterZ() - GetMinZ()) / GetRangeZ();
 	} // if
 	else
 	{
-		m_filterMinZCell = m_filterMaxZCell = 0;
+		filterMinZCell = filterMaxZCell = 0;
 	} // else
-	LowXCell = ceil(m_filterMinXCell);
-	HighXCell = floor(m_filterMaxXCell) - 1.0;
-	LowYCell = ceil(m_filterMinYCell);
-	HighYCell = floor(m_filterMaxYCell) - 1.0;
-	LowZCell = ceil(m_filterMinZCell);
-	HighZCell = floor(m_filterMaxZCell) - 1.0;
-	m_LowXCellCompletelyIn = (boost::int32_t)LowXCell;
-	m_HighXCellCompletelyIn = (boost::int32_t)HighXCell;
-	m_LowYCellCompletelyIn = (boost::int32_t)LowYCell;
-	m_HighYCellCompletelyIn = (boost::int32_t)HighYCell;
-	m_LowZCellCompletelyIn = (boost::int32_t)LowZCell;
-	m_HighZCellCompletelyIn = (boost::int32_t)HighZCell;
-
-    LowXCell = floor(m_filterMinXCell);
-    HighXCell = ceil(m_filterMaxXCell) - 1.0;
-    LowYCell = floor(m_filterMinYCell);
-    HighYCell = ceil(m_filterMaxYCell) - 1.0;
-    LowZCell = floor(m_filterMinZCell);
-    HighZCell = ceil(m_filterMaxZCell) - 1.0;
-    m_LowXBorderCell = (boost::int32_t)LowXCell;
-    m_HighXBorderCell = (boost::int32_t)HighXCell;
-    m_LowYBorderCell = (boost::int32_t)LowYCell;
-    m_HighYBorderCell = (boost::int32_t)HighYCell;
-    m_LowZBorderCell = (boost::int32_t)LowZCell;
-    m_HighZBorderCell = (boost::int32_t)HighZCell;
+	LowXCell = ceil(filterMinXCell);
+	HighXCell = floor(filterMaxXCell) - 1.0;
+	LowYCell = ceil(filterMinYCell);
+	HighYCell = floor(filterMaxYCell) - 1.0;
+	LowZCell = ceil(filterMinZCell);
+	HighZCell = floor(filterMaxZCell) - 1.0;
+	ParamSrc.m_LowXCellCompletelyIn = (boost::int32_t)LowXCell;
+	ParamSrc.m_HighXCellCompletelyIn = (boost::int32_t)HighXCell;
+	ParamSrc.m_LowYCellCompletelyIn = (boost::int32_t)LowYCell;
+	ParamSrc.m_HighYCellCompletelyIn = (boost::int32_t)HighYCell;
+	ParamSrc.m_LowZCellCompletelyIn = (boost::int32_t)LowZCell;
+	ParamSrc.m_HighZCellCompletelyIn = (boost::int32_t)HighZCell;
+
+    LowXCell = floor(filterMinXCell);
+    HighXCell = ceil(filterMaxXCell) - 1.0;
+    LowYCell = floor(filterMinYCell);
+    HighYCell = ceil(filterMaxYCell) - 1.0;
+    LowZCell = floor(filterMinZCell);
+    HighZCell = ceil(filterMaxZCell) - 1.0;
+    ParamSrc.m_LowXBorderCell = (boost::int32_t)LowXCell;
+    ParamSrc.m_HighXBorderCell = (boost::int32_t)HighXCell;
+    ParamSrc.m_LowYBorderCell = (boost::int32_t)LowYCell;
+    ParamSrc.m_HighYBorderCell = (boost::int32_t)HighYCell;
+    ParamSrc.m_LowZBorderCell = (boost::int32_t)LowZCell;
+    ParamSrc.m_HighZBorderCell = (boost::int32_t)HighZCell;
     
-    m_LowXBorderPartCell = m_filterMinXCell - LowXCell;
-    m_HighXBorderPartCell = m_filterMaxXCell - HighXCell;
-    m_LowYBorderPartCell = m_filterMinYCell - LowYCell;
-    m_HighYBorderPartCell = m_filterMaxYCell - HighYCell;
+    ParamSrc.m_LowXBorderPartCell = filterMinXCell - LowXCell;
+    ParamSrc.m_HighXBorderPartCell = filterMaxXCell - HighXCell;
+    ParamSrc.m_LowYBorderPartCell = filterMinYCell - LowYCell;
+    ParamSrc.m_HighYBorderPartCell = filterMaxYCell - HighYCell;
 	
 } // Index::SetCellFilterBounds
 
 bool Index::LoadIndexVLR(VariableRecord const& vlr)
 {
-	boost::uint8_t VersionMajor, VersionMinor;
 	char DestStr[512];
 	boost::uint16_t StringLen;
 	boost::uint16_t ReadPos = 0;
@@ -360,8 +442,8 @@ bool Index::LoadIndexVLR(VariableRecord const& vlr)
 		// read the first record of our index data
 		IndexVLRData const& VLRIndexData = vlr.GetData();
 		// parse the index header data
-		ReadVLRData_n(VersionMajor, VLRIndexData, ReadPos);
-		ReadVLRData_n(VersionMinor, VLRIndexData, ReadPos);
+		ReadVLRData_n(m_versionMajor, VLRIndexData, ReadPos);
+		ReadVLRData_n(m_versionMinor, VLRIndexData, ReadPos);
 		// creator		
 		ReadVLRData_n(StringLen, VLRIndexData, ReadPos);
 		ReadeVLRData_str(DestStr, VLRIndexData, StringLen, ReadPos);
@@ -422,11 +504,12 @@ bool Index::LoadIndexVLR(VariableRecord const& vlr)
 
 } // Index::LoadIndexVLR
 
-bool Index::FilterOneVLR(VariableRecord const& vlr, boost::uint32_t& i, IndexData const& ParamSrc)
+bool Index::FilterOneVLR(VariableRecord const& vlr, boost::uint32_t& i, IndexData & ParamSrc, bool & VLRDone)
 {
 
-	boost::uint16_t ReadPos = 0;
-	boost::uint32_t MinCellX, MinCellY, MaxCellX, MaxCellY, DataRecordSize = 0;
+	boost::uint32_t ReadPos = 0;
+	boost::uint32_t MinCellX, MinCellY, MaxCellX, MaxCellY, PointsThisRecord = 0, PointsThisCell = 0, DataRecordSize = 0,
+		PointsScannedThisTime = 0, PointsScannedCurVLR = 0, PointsToIgnore = 0;
 	IndexVLRData CompositeData;
 	
 	try {
@@ -442,6 +525,9 @@ bool Index::FilterOneVLR(VariableRecord const& vlr, boost::uint32_t& i, IndexDat
 		ReadVLRData_n(MaxCellY, CompositeData, ReadPos);
 		// data record size
 		ReadVLRData_n(DataRecordSize, CompositeData, ReadPos);
+		// number of points in this VLR - added in Index version 1.1
+		if (m_versionMajor > 1 || m_versionMinor >= 1)
+			ReadVLRData_n(PointsThisRecord, CompositeData, ReadPos);
 				
 		if (DataRecordSize > VLRIndexRecLen)
 		{
@@ -467,13 +553,33 @@ bool Index::FilterOneVLR(VariableRecord const& vlr, boost::uint32_t& i, IndexDat
 			
 		if (VLRInteresting(MinCellX, MinCellY, MaxCellX, MaxCellY, ParamSrc))
 		{
+			// if using iterator, jump to start of last cell that was being scanned
+			if (ParamSrc.m_iterator && (ParamSrc.m_iterator->m_curCellStartPos >= ReadPos))
+			{
+				ReadPos = ParamSrc.m_iterator->m_curCellStartPos;
+				PointsToIgnore = ParamSrc.m_iterator->m_ptsScannedCurCell;
+				PointsScannedCurVLR = ParamSrc.m_iterator->m_ptsScannedCurVLR;
+			} // if
 			// translate the data for this VLR
 			while (ReadPos + sizeof (boost::uint32_t) < DataRecordSize)
 			{
+				if (ParamSrc.m_iterator)
+				{
+					ParamSrc.m_iterator->m_curCellStartPos = ReadPos;
+					ParamSrc.m_iterator->m_ptsScannedCurCell = 0;
+				} // if
 				// current cell, x, y
 				boost::uint32_t x, y, PtRecords, SubCellsXY, SubCellsZ;
 				ReadVLRData_n(x, CompositeData, ReadPos);
 				ReadVLRData_n(y, CompositeData, ReadPos);
+				if (ParamSrc.m_iterator)
+				{
+					ParamSrc.m_iterator->m_curCellX = x;
+					ParamSrc.m_iterator->m_curCellY = y;
+				} // if
+				// number of points in this cell - added in Index version 1.1
+				if (m_versionMajor > 1 || m_versionMinor >= 1)
+					ReadVLRData_n(PointsThisCell, CompositeData, ReadPos);
 
 				bool TestPointsInThisCell = CellInteresting(x, y, ParamSrc);
 				// min and max Z
@@ -495,22 +601,27 @@ bool Index::FilterOneVLR(VariableRecord const& vlr, boost::uint32_t& i, IndexDat
 					ReadVLRData_n(ZCellNumRecords, CompositeData, ReadPos);
 					for (boost::uint32_t SubCellZPt = 0; SubCellZPt < ZCellNumRecords; ++SubCellZPt)
 					{
-						boost::uint32_t PointID, LastPointID = static_cast<boost::uint32_t>(~0);
-						bool LastPtRead = 0;
+						boost::uint32_t PointID;
 						ReadVLRData_n(PointID, CompositeData, ReadPos);
 						assert(PointID < m_pointRecordsCount);
 						liblas::detail::ConsecPtAccumulator ConsecutivePts;
 						ReadVLRData_n(ConsecutivePts, CompositeData, ReadPos);
 						if (TestPointsInThisCell && ZCellInteresting(ZCellID, ParamSrc))
 						{
-							for (boost::uint32_t PtCt = 0; PtCt < ConsecutivePts; ++PointID, ++PtCt)
-							{
-								if (FilterOnePoint(x, y, ZCellID, PointID, LastPointID, LastPtRead, ParamSrc))
-									m_filterResult.push_back(PointID);
-								LastPointID = PointID;
-							} // for
+							FilterPointSeries(PointID, PointsScannedThisTime, PointsToIgnore, x, y, ZCellID, 
+								ConsecutivePts, ParamSrc.m_iterator, ParamSrc);
 						} // if
+						else
+						{
+							PointsScannedThisTime += ConsecutivePts;
+							if (ParamSrc.m_iterator)
+								ParamSrc.m_iterator->m_ptsScannedCurCell += ConsecutivePts;
+						} // else
+						if (ParamSrc.m_iterator && (m_filterResult.size() >= ParamSrc.m_iterator->m_chunkSize))
+							break;
 					} // for
+					if (ParamSrc.m_iterator && (m_filterResult.size() >= ParamSrc.m_iterator->m_chunkSize))
+						break;
 				} // for
 				// read the data stored in XY quadtree cells
 				for (boost::uint32_t SubCellXY = 0; SubCellXY < SubCellsXY; ++SubCellXY)
@@ -522,47 +633,71 @@ bool Index::FilterOneVLR(VariableRecord const& vlr, boost::uint32_t& i, IndexDat
 					ReadVLRData_n(SubCellNumRecords, CompositeData, ReadPos);
 					for (boost::uint32_t SubCellPt = 0; SubCellPt < SubCellNumRecords; ++SubCellPt)
 					{
-						boost::uint32_t PointID, LastPointID = static_cast<boost::uint32_t>(~0);
-						bool LastPtRead = 0;
+						boost::uint32_t PointID;
 						ReadVLRData_n(PointID, CompositeData, ReadPos);
 						assert(PointID < m_pointRecordsCount);
 						liblas::detail::ConsecPtAccumulator ConsecutivePts;
 						ReadVLRData_n(ConsecutivePts, CompositeData, ReadPos);
 						if (TestPointsInThisCell && SubCellInteresting(SubCellID, x, y, ParamSrc))
 						{
-							for (boost::uint32_t PtCt = 0; PtCt < ConsecutivePts; ++PointID, ++PtCt)
-							{
-								if (FilterOnePoint(x, y, 0, PointID, LastPointID, LastPtRead, ParamSrc))
-									m_filterResult.push_back(PointID);
-								LastPointID = PointID;
-							} // for
+							FilterPointSeries(PointID, PointsScannedThisTime, PointsToIgnore, x, y, 0, 
+								ConsecutivePts, ParamSrc.m_iterator, ParamSrc);
 						} // if
+						else
+						{
+							PointsScannedThisTime += ConsecutivePts;
+							if (ParamSrc.m_iterator)
+								ParamSrc.m_iterator->m_ptsScannedCurCell += ConsecutivePts;
+						} // else
+						if (ParamSrc.m_iterator && (m_filterResult.size() >= ParamSrc.m_iterator->m_chunkSize))
+							break;
 					} // for
+					if (ParamSrc.m_iterator && (m_filterResult.size() >= ParamSrc.m_iterator->m_chunkSize))
+						break;
 				} // for
 				// read data in unsubdivided cells
 				if (! (SubCellsZ || SubCellsXY))
 				{
 					for (boost::uint32_t CurPt = 0; CurPt < PtRecords; ++CurPt)
 					{
-						boost::uint32_t PointID, LastPointID = static_cast<boost::uint32_t>(~0);
-						bool LastPtRead = 0;
+						boost::uint32_t PointID;
 						ReadVLRData_n(PointID, CompositeData, ReadPos);
 						assert(PointID < m_pointRecordsCount);
 						liblas::detail::ConsecPtAccumulator ConsecutivePts;
 						ReadVLRData_n(ConsecutivePts, CompositeData, ReadPos);
 						if (TestPointsInThisCell)
 						{
-							for (boost::uint32_t PtCt = 0; PtCt < ConsecutivePts; ++PointID, ++PtCt)
-							{
-								if (FilterOnePoint(x, y, 0, PointID, LastPointID, LastPtRead, ParamSrc))
-									m_filterResult.push_back(PointID);
-								LastPointID = PointID;
-							} // for
+							FilterPointSeries(PointID, PointsScannedThisTime, PointsToIgnore, x, y, 0, 
+								ConsecutivePts, ParamSrc.m_iterator, ParamSrc);
 						} // if
+						else
+						{
+							PointsScannedThisTime += ConsecutivePts;
+							if (ParamSrc.m_iterator)
+								ParamSrc.m_iterator->m_ptsScannedCurCell += ConsecutivePts;
+						} // else
+					if (ParamSrc.m_iterator && (m_filterResult.size() >= ParamSrc.m_iterator->m_chunkSize))
+						break;
 					} // for
 				} // if
+				if (ParamSrc.m_iterator && (m_filterResult.size() >= ParamSrc.m_iterator->m_chunkSize))
+					break;
 			} // while
+			PointsScannedCurVLR += PointsScannedThisTime;
+			if (PointsScannedCurVLR >= PointsThisRecord)
+				VLRDone = true;
+			if (ParamSrc.m_iterator)
+			{
+				ParamSrc.m_iterator->m_totalPointsScanned += PointsScannedThisTime;
+				ParamSrc.m_iterator->m_ptsScannedCurVLR = PointsScannedCurVLR;
+			} // if
 		} // if
+		else if (ParamSrc.m_iterator)
+		{
+			ParamSrc.m_iterator->m_totalPointsScanned += PointsThisRecord;
+			VLRDone = true;
+		} // else if
+		// need to be more sophisticated but this is a test
 	} // try
 	catch (std::bad_alloc) {
 		return (false);
@@ -574,16 +709,63 @@ bool Index::FilterOneVLR(VariableRecord const& vlr, boost::uint32_t& i, IndexDat
 	
 } // Index::FilterOneVLR
 
+bool Index::FilterPointSeries(boost::uint32_t & PointID, boost::uint32_t & PointsScanned, 
+	boost::uint32_t const PointsToIgnore, boost::uint32_t const x, boost::uint32_t const y, boost::uint32_t const z, 
+	liblas::detail::ConsecPtAccumulator const ConsecutivePts, IndexIterator *Iterator, 
+	IndexData const& ParamSrc)
+{
+	bool LastPtRead = 0;
+	boost::uint32_t LastPointID = static_cast<boost::uint32_t>(~0);
+	
+	try {	
+		for (boost::uint32_t PtCt = 0; PtCt < ConsecutivePts; ++PointID, ++PtCt)
+		{
+			++PointsScanned;
+			if (Iterator)
+				++Iterator->m_ptsScannedCurCell;
+			if (PointsScanned > PointsToIgnore)
+			{
+				if (FilterOnePoint(x, y, z, PointID, LastPointID, LastPtRead, ParamSrc))
+				{
+					bool SkipIt = false;
+					if (Iterator)
+					{
+						++Iterator->m_conformingPtsFound;
+						if (Iterator->m_advance)
+						{
+							--Iterator->m_advance;
+							if (Iterator->m_advance)
+								SkipIt = true;
+						} // if
+					} // if
+					if (! SkipIt)
+					{
+						m_filterResult.push_back(PointID);
+						if (Iterator && (m_filterResult.size() >= Iterator->m_chunkSize))
+							break;
+					} // if
+				} // if
+			} // if
+			LastPointID = PointID;
+		} // for
+		return (true);
+	} // try
+	catch (std::bad_alloc) {
+		return (false);
+	} // catch
+
+} // Index::FilterPointSeries
+
 bool Index::VLRInteresting(boost::int32_t MinCellX, boost::int32_t MinCellY, boost::int32_t MaxCellX, boost::int32_t MaxCellY, IndexData const& ParamSrc)
 {
 
 	// cells are written in south to north cell order columns (x) and west to east rows (y)
 	// The writing loops through y inside a for x loop. Therefore if the low x and high x are not the same then
 	// we have to assume that all y cells are interesting
-	if (ParamSrc.m_noFilterX || (MaxCellX >= m_LowXBorderCell && MinCellX <= m_HighXBorderCell))
+	if (ParamSrc.m_noFilterX || (MaxCellX >= ParamSrc.m_LowXBorderCell && MinCellX <= ParamSrc.m_HighXBorderCell))
 	{
 		if (ParamSrc.m_noFilterY || (MaxCellX != MinCellX) || 
-			(MaxCellY >= m_LowYBorderCell && MinCellY <= m_HighYBorderCell))
+			(MaxCellY >= ParamSrc.m_LowYBorderCell && MinCellY <= ParamSrc.m_HighYBorderCell))
 			return true;
 	} // if
 	return false;
@@ -593,9 +775,9 @@ bool Index::VLRInteresting(boost::int32_t MinCellX, boost::int32_t MinCellY, boo
 bool Index::CellInteresting(boost::int32_t XCellID, boost::int32_t YCellID, IndexData const& ParamSrc)
 {
 
-	if (ParamSrc.m_noFilterX || (XCellID >= m_LowXBorderCell && XCellID <= m_HighXBorderCell))
+	if (ParamSrc.m_noFilterX || (XCellID >= ParamSrc.m_LowXBorderCell && XCellID <= ParamSrc.m_HighXBorderCell))
 	{
-		if (ParamSrc.m_noFilterY || (YCellID >= m_LowYBorderCell && YCellID <= m_HighYBorderCell))
+		if (ParamSrc.m_noFilterY || (YCellID >= ParamSrc.m_LowYBorderCell && YCellID <= ParamSrc.m_HighYBorderCell))
 			return true;
 	} // if
 	return false;
@@ -605,7 +787,7 @@ bool Index::CellInteresting(boost::int32_t XCellID, boost::int32_t YCellID, Inde
 bool Index::ZCellInteresting(boost::int32_t ZCellID, IndexData const& ParamSrc)
 {
 
-	if (ParamSrc.m_noFilterZ || (ZCellID >= m_LowZBorderCell && ZCellID <= m_HighZBorderCell))
+	if (ParamSrc.m_noFilterZ || (ZCellID >= ParamSrc.m_LowZBorderCell && ZCellID <= ParamSrc.m_HighZBorderCell))
 	{
 		return true;
 	} // if
@@ -618,20 +800,20 @@ bool Index::SubCellInteresting(boost::int32_t SubCellID, boost::int32_t XCellID,
 	bool XGood = false, YGood = false;
 
 	// only need test sub cell if border cell
-	if (ParamSrc.m_noFilterX || (XCellID >= m_LowXCellCompletelyIn && XCellID <= m_HighXCellCompletelyIn))
+	if (ParamSrc.m_noFilterX || (XCellID >= ParamSrc.m_LowXCellCompletelyIn && XCellID <= ParamSrc.m_HighXCellCompletelyIn))
 	{
 		XGood = true;
 	} // if
 	else
 	{
-		if (XCellID == m_LowXBorderCell)
+		if (XCellID == ParamSrc.m_LowXBorderCell)
 		{
 			// left (low) border cell
 			if (SubCellID == 0 || SubCellID == 2)
 			{
 				// low half of cell in X
 				// only true if boundary of search area falls in the left (lower) half of the cell
-				if (m_LowXBorderPartCell <= .5)	// .5 exactly is part of low half of cell
+				if (ParamSrc.m_LowXBorderPartCell <= .5)	// .5 exactly is part of low half of cell
 					XGood = true;
 			} // if
 			else
@@ -654,25 +836,25 @@ bool Index::SubCellInteresting(boost::int32_t SubCellID, boost::int32_t XCellID,
 			{
 				// high half of cell in X
 				// only true if boundary of search area falls in the right (upper) half of the cell
-				if (m_HighXBorderPartCell > .5)
+				if (ParamSrc.m_HighXBorderPartCell > .5)
 					XGood = true;
 			} // else
 		} // else	
 	} // else
-	if (ParamSrc.m_noFilterY || (YCellID >= m_LowYCellCompletelyIn && YCellID <= m_HighYCellCompletelyIn))
+	if (ParamSrc.m_noFilterY || (YCellID >= ParamSrc.m_LowYCellCompletelyIn && YCellID <= ParamSrc.m_HighYCellCompletelyIn))
 	{
 		YGood = true;
 	} // if
 	else
 	{
-		if (YCellID == m_LowYBorderCell)
+		if (YCellID == ParamSrc.m_LowYBorderCell)
 		{
 			// bottom (low) border cell
 			if (SubCellID == 0 || SubCellID == 1)
 			{
 				// low half of cell in Y
 				// only true if boundary of search area falls in the bottom (lower) half of the cell
-				if (m_LowYBorderPartCell <= .5)	// .5 exactly is part of low half of cell
+				if (ParamSrc.m_LowYBorderPartCell <= .5)	// .5 exactly is part of low half of cell
 					YGood = true;
 			} // if
 			else
@@ -695,7 +877,7 @@ bool Index::SubCellInteresting(boost::int32_t SubCellID, boost::int32_t XCellID,
 			{
 				// high half of cell in Y
 				// only true if boundary of search area falls in the top (upper) half of the cell
-				if (m_HighYBorderPartCell > .5)
+				if (ParamSrc.m_HighYBorderPartCell > .5)
 					YGood = true;
 			} // else
 		} // else	
@@ -715,10 +897,10 @@ bool Index::FilterOnePoint(boost::int32_t x, boost::int32_t y, boost::int32_t z,
 	if (ParamSrc.m_noFilterX)
 		XGood = true;
 	// container cell in the region of the filter that requires no individual point testing?
-	else if (x >= m_LowXCellCompletelyIn && x <= m_HighXCellCompletelyIn)
+	else if (x >= ParamSrc.m_LowXCellCompletelyIn && x <= ParamSrc.m_HighXCellCompletelyIn)
 		XGood = true;
 	// container cell in the region of the filter that does require individual point testing?
-	else if (x == m_LowXBorderCell || x == m_HighXBorderCell)
+	else if (x == ParamSrc.m_LowXBorderCell || x == ParamSrc.m_HighXBorderCell)
 	{
 		// save a file seek if it is the subsequent point from the last one read
 		if (PointID == LastPointID + 1)
@@ -732,7 +914,7 @@ bool Index::FilterOnePoint(boost::int32_t x, boost::int32_t y, boost::int32_t z,
 		{
 			// seek and read
 			assert(static_cast<boost::uint32_t>(PointID) < m_pointRecordsCount);
-			PtRead = (m_reader->seek(PointID) && m_reader->ReadNextPoint());
+			PtRead = (m_reader->seek(PointID) && m_reader->ReadNextPoint());
 		} // if
 		if (PtRead)
 		{
@@ -750,10 +932,10 @@ bool Index::FilterOnePoint(boost::int32_t x, boost::int32_t y, boost::int32_t z,
 		if (ParamSrc.m_noFilterY)
 			YGood = true;
 		// container cell in the region of the filter that requires no individual point testing?
-		else if (y >= m_LowYCellCompletelyIn && y <= m_HighYCellCompletelyIn)
+		else if (y >= ParamSrc.m_LowYCellCompletelyIn && y <= ParamSrc.m_HighYCellCompletelyIn)
 			YGood = true;
 		// container cell in the region of the filter that does require individual point testing?
-		else if (y == m_LowYBorderCell || y == m_HighYBorderCell)
+		else if (y == ParamSrc.m_LowYBorderCell || y == ParamSrc.m_HighYBorderCell)
 		{
 			if (PtRead)
 			{
@@ -775,7 +957,7 @@ bool Index::FilterOnePoint(boost::int32_t x, boost::int32_t y, boost::int32_t z,
 				{
 					// seek and read
 					assert(static_cast<boost::uint32_t>(PointID) < m_pointRecordsCount);
-					PtRead = (m_reader->seek(PointID) && m_reader->ReadNextPoint());
+					PtRead = (m_reader->seek(PointID) && m_reader->ReadNextPoint());
 				} // if
 				if (PtRead)
 				{
@@ -794,10 +976,10 @@ bool Index::FilterOnePoint(boost::int32_t x, boost::int32_t y, boost::int32_t z,
 		if (ParamSrc.m_noFilterZ)
 			ZGood = true;
 		// container cell in the region of the filter that requires no individual point testing?
-		else if (z >= m_LowZCellCompletelyIn && z <= m_HighZCellCompletelyIn)
+		else if (z >= ParamSrc.m_LowZCellCompletelyIn && z <= ParamSrc.m_HighZCellCompletelyIn)
 			ZGood = true;
 		// container cell in the region of the filter that does require individual point testing?
-		else if (z == m_LowZBorderCell || z == m_HighZBorderCell)
+		else if (z == ParamSrc.m_LowZBorderCell || z == ParamSrc.m_HighZBorderCell)
 		{
 			if (PtRead)
 			{
@@ -819,7 +1001,7 @@ bool Index::FilterOnePoint(boost::int32_t x, boost::int32_t y, boost::int32_t z,
 				{
 					// seek and read
 					assert(static_cast<boost::uint32_t>(PointID) < m_pointRecordsCount);
-					PtRead = (m_reader->seek(PointID) && m_reader->ReadNextPoint());
+					PtRead = (m_reader->seek(PointID) && m_reader->ReadNextPoint());
 				} // if
 				if (PtRead)
 				{
@@ -840,10 +1022,11 @@ bool Index::BuildIndex(void)
 {
 	// Build an array of two dimensions. Sort data points into
 	boost::uint32_t MaximumCells = LIBLAS_INDEX_MAXCELLS;
+	m_versionMajor = LIBLAS_INDEX_VERSIONMAJOR;
+	m_versionMinor = LIBLAS_INDEX_VERSIONMINOR;
 	
 	// reset to beginning of point data records in case points had been examined before index is built
-	m_reader->Reset();
-
+	m_reader->seek(0);
 	// need the header to get number of point records
     m_pointRecordsCount = m_pointheader.GetPointRecordsCount();
     // get the bounds of the data and scale factors in case they are needed for point translation
@@ -981,11 +1164,9 @@ bool Index::BuildIndex(void)
 		// If a cell contains too many points, subdivide the cell and save sub-cells within the cell structure
 		// If Z-binning is desired, define the bounds of each Z zone and subdivide sort each cell's points into Z bins
 		// Save Z bins within the cell structure.
-		// reset Reader to beginning of point data records in case points had been examined before index is built
 		
 		if (IndexOut.InitiateOutput())
 		{
-			m_reader->Reset();
 			for (boost::uint32_t x = 0; x < m_cellsX; ++x)
 			{
 				for (boost::uint32_t y = 0; y < m_cellsY; ++y)
@@ -1009,7 +1190,7 @@ bool Index::BuildIndex(void)
 							{
 								// get the actual point from the las file
 								assert(MapIt->first < m_pointRecordsCount);
-								if (m_reader->seek(MapIt->first) && m_reader->ReadNextPoint())
+								if (m_reader->seek(MapIt->first) && m_reader->ReadNextPoint())
 								{
 									boost::uint32_t FirstPt = 0, LastCellZ = static_cast<boost::uint32_t>(~0);
 									boost::uint32_t LastSubCell = static_cast<boost::uint32_t>(~0);
@@ -1201,7 +1382,7 @@ bool Index::PurgePointsToTempFile(IndexCellDataBlock& CellBlock)
 {
 	if (m_tempFile || OpenTempFile())
 	{
-		boost::uint32_t EmptyOffset = 0;	// this might not be large enough
+		liblas::detail::TempFileOffsetType EmptyOffset = 0;	// this might not be large enough
 		
 		if (! m_tempFileStarted)
 		{
@@ -1209,12 +1390,12 @@ bool Index::PurgePointsToTempFile(IndexCellDataBlock& CellBlock)
 			// write out a block of file offsets the size of the number of cells
 			for (boost::uint32_t i = 0; i < m_totalCells; ++i)
 			{
-				if (fwrite(&EmptyOffset, sizeof(boost::uint32_t), 1, m_tempFile) < 1)
+				if (fwrite(&EmptyOffset, sizeof(liblas::detail::TempFileOffsetType), 1, m_tempFile) < 1)
 				{
 					return (FileError("Index::PurgePointsToTempFile"));
 				} // if error
 			} // for
-			m_tempFileWrittenBytes = m_totalCells * sizeof(boost::uint32_t);
+			m_tempFileWrittenBytes = m_totalCells * sizeof(liblas::detail::TempFileOffsetType);
 			m_tempFileStarted = true;
 		} // if
 		for (boost::uint32_t x = 0; x < m_cellsX; ++x)
@@ -1228,20 +1409,29 @@ bool Index::PurgePointsToTempFile(IndexCellDataBlock& CellBlock)
 					// if cell block header is 0 write the current file location in the file header
 					// otherwise write the current file location at the file location specified in the 
 					// cell block header
-					boost::uint32_t LastWriteLocation = CellBlock[x][y].GetFileOffset();
+					liblas::detail::TempFileOffsetType LastWriteLocation = CellBlock[x][y].GetFileOffset();
 					if (LastWriteLocation == 0)
-						LastWriteLocation = (x * m_cellsY + y) * sizeof(boost::uint32_t);
+						LastWriteLocation = (x * m_cellsY + y) * sizeof(liblas::detail::TempFileOffsetType);
+#ifdef _MSC_VER
+					_fseeki64(m_tempFile, LastWriteLocation, SEEK_SET);
+#else
 					fseek(m_tempFile, LastWriteLocation, SEEK_SET);
-					if (fwrite(&m_tempFileWrittenBytes, sizeof(boost::uint32_t), 1, m_tempFile) < 1)
+#endif
+					if (fwrite(&m_tempFileWrittenBytes, sizeof(liblas::detail::TempFileOffsetType), 1, m_tempFile) < 1)
 						return (FileError("Index::PurgePointsToTempFile"));
 					CellBlock[x][y].SetFileOffset(m_tempFileWrittenBytes);
 
 					// seek to end of file where next block of data will be written
+#ifdef _MSC_VER
+					_fseeki64(m_tempFile, 0, SEEK_END);
+#else
 					fseek(m_tempFile, 0, SEEK_END);
+#endif
+
 					// write a blank space for later placement of next file block for this cell
-					if (fwrite(&EmptyOffset, sizeof(boost::uint32_t), 1, m_tempFile) < 1)
+					if (fwrite(&EmptyOffset, sizeof(liblas::detail::TempFileOffsetType), 1, m_tempFile) < 1)
 						return (FileError("Index::PurgePointsToTempFile"));
-					m_tempFileWrittenBytes += sizeof(boost::uint32_t);
+					m_tempFileWrittenBytes += sizeof(liblas::detail::TempFileOffsetType);
 					// write the number of records stored in this section
 					if (fwrite(&RecordsToWrite, sizeof(boost::uint32_t), 1, m_tempFile) < 1)
 						return (FileError("Index::PurgePointsToTempFile"));
@@ -1279,23 +1469,35 @@ bool Index::LoadCellFromTempFile(liblas::detail::IndexCell *CellBlock,
 	boost::uint32_t CurCellX, boost::uint32_t CurCellY)
 {
 
-	boost::uint32_t FileOffset, RecordsToRead, FormerNumPts, NewNumPts = 0;
+	boost::uint32_t RecordsToRead, FormerNumPts, NewNumPts = 0;
+	liblas::detail::TempFileOffsetType FileOffset;
 	
 	FormerNumPts = CellBlock->GetNumPoints();
 	CellBlock->SetNumPoints(0);
 	
 	// load the cell as it was written
 	// read the first offset for this cell
-	if (fseek(m_tempFile, (CurCellX * m_cellsY + CurCellY) * sizeof (boost::uint32_t), SEEK_SET))
+
+#ifdef _MSC_VER
+	if (_fseeki64(m_tempFile, (CurCellX * m_cellsY + CurCellY) * sizeof (liblas::detail::TempFileOffsetType), SEEK_SET))
+#else
+	if (fseek(m_tempFile, (CurCellX * m_cellsY + CurCellY) * sizeof (liblas::detail::TempFileOffsetType), SEEK_SET))
+#endif
 		return (FileError("Index::LoadCellFromTempFile"));
-	if (fread(&FileOffset, sizeof (boost::uint32_t), 1, m_tempFile) < 1)
+	if (fread(&FileOffset, sizeof (liblas::detail::TempFileOffsetType), 1, m_tempFile) < 1)
 		return (FileError("Index::LoadCellFromTempFile"));
 	while (FileOffset > 0)
 	{
 		// jump to the first block for this cell, read the next offset
+
+#ifdef _MSC_VER
+		if (_fseeki64(m_tempFile, FileOffset, SEEK_SET))
+#else
 		if (fseek(m_tempFile, FileOffset, SEEK_SET))
+#endif
+
 			return (FileError("Index::LoadCellFromTempFile"));
-		if (fread(&FileOffset, sizeof (boost::uint32_t), 1, m_tempFile) < 1)
+		if (fread(&FileOffset, sizeof (liblas::detail::TempFileOffsetType), 1, m_tempFile) < 1)
 			return (FileError("Index::LoadCellFromTempFile"));
 		// read the data for the cell in this block
 		// first is the number of items to read now
@@ -1351,7 +1553,7 @@ bool Index::SaveIndexInLASFile(void)
 {
 	try {
 		Writer writer(*m_ofs, m_idxheader);
-		m_reader->Reset();
+		m_reader->seek(0);
 		while (m_reader->ReadNextPoint())
 		{
 			Point CurPt = m_reader->GetPoint();
@@ -1370,7 +1572,7 @@ bool Index::SaveIndexInStandAloneFile(void)
 	try {
 		Writer writer(*m_ofs, m_idxheader);
 		/* test block - uncommenting this makes it just like above version with included points
-		m_reader->Reset();
+		m_reader->seek(0);
 		while (m_reader->ReadNextPoint())
 		{
 			Point CurPt = m_reader->GetPoint();
@@ -1559,12 +1761,68 @@ IndexData::IndexData(Index const& index)
 	if (m_maxMemoryUsage < LIBLAS_INDEX_MINMEMDEFAULT)
 		m_maxMemoryUsage = LIBLAS_INDEX_MINMEMDEFAULT;
 	m_indexValid = index.IndexReady();
-} // Index::Index
+} // IndexData::IndexData
+
+IndexData::IndexData(IndexData const& other)
+{
+	Copy(other);
+} // IndexData::IndexData
+
+IndexData& IndexData::operator=(IndexData const& rhs)
+{
+    Copy(rhs);
+	return (*this);
+} // IndexData::operator=
+
+void IndexData::Copy(IndexData const& other)
+{
+    if (&other != this)
+    {
+		m_reader = other.m_reader;
+		m_idxreader = other.m_idxreader;
+		m_iterator = other.m_iterator;
+		m_ifs = other.m_ifs;
+		m_ofs = other.m_ofs;
+		m_tempFileName = other.m_tempFileName;
+		m_indexAuthor = other.m_indexAuthor;
+		m_indexComment = other.m_indexComment;
+		m_indexDate = other.m_indexDate;
+		m_cellSizeZ = other.m_cellSizeZ;
+		m_maxMemoryUsage = other.m_maxMemoryUsage;
+		m_debugOutputLevel = other.m_debugOutputLevel;
+		m_readOnly = other.m_readOnly;
+		m_writestandaloneindex = other.m_writestandaloneindex;
+		m_forceNewIndex = other.m_forceNewIndex;
+		m_debugger = other.m_debugger;
+		m_indexValid = other.m_indexValid;
+		m_noFilterX = other.m_noFilterX;
+		m_noFilterY = other.m_noFilterY;
+		m_noFilterZ = other.m_noFilterZ;
+		m_filter = other.m_filter;
+		m_LowXCellCompletelyIn = other.m_LowXCellCompletelyIn;
+		m_HighXCellCompletelyIn = other.m_HighXCellCompletelyIn;
+		m_LowYCellCompletelyIn = other.m_LowYCellCompletelyIn;
+		m_HighYCellCompletelyIn = other.m_HighYCellCompletelyIn;
+		m_LowZCellCompletelyIn = other.m_LowZCellCompletelyIn;
+		m_HighZCellCompletelyIn = other.m_HighZCellCompletelyIn;
+		m_LowXBorderCell = other.m_LowXBorderCell;
+		m_HighXBorderCell = other.m_HighXBorderCell;
+		m_LowYBorderCell = other.m_LowYBorderCell;
+		m_HighYBorderCell = other.m_HighYBorderCell;
+		m_LowZBorderCell = other.m_LowZBorderCell;
+		m_HighZBorderCell = other.m_HighZBorderCell;
+		m_LowXBorderPartCell = other.m_LowXBorderPartCell;
+		m_HighXBorderPartCell = other.m_HighXBorderPartCell;
+		m_LowYBorderPartCell = other.m_LowYBorderPartCell;
+		m_HighYBorderPartCell = other.m_HighYBorderPartCell;
+	} // if
+} // IndexData::Copy
 
 void IndexData::SetValues(void)
 {
 	m_reader = 0;
 	m_idxreader = 0;
+	m_iterator = 0;
 	m_ifs = 0;
 	m_ofs = 0;
 	m_tempFileName = 0;
@@ -1580,6 +1838,11 @@ void IndexData::SetValues(void)
 	m_debugger = 0;
 	m_indexValid = false;
 	m_noFilterX = m_noFilterY = m_noFilterZ = false;
+    m_LowXCellCompletelyIn = m_HighXCellCompletelyIn = m_LowYCellCompletelyIn = m_HighYCellCompletelyIn = 
+		m_LowZCellCompletelyIn = m_HighZCellCompletelyIn =
+		m_LowXBorderCell = m_HighXBorderCell = m_LowYBorderCell = m_HighYBorderCell = 
+		m_LowZBorderCell = m_HighZBorderCell = 0;
+	m_LowXBorderPartCell = m_HighXBorderPartCell = m_LowYBorderPartCell = m_HighYBorderPartCell = 0.0;
 } // IndexData::SetValues
 
 bool IndexData::SetInitialValues(std::istream *ifs, Reader *reader, std::ostream *ofs, Reader *idxreader, 
@@ -1593,6 +1856,7 @@ bool IndexData::SetInitialValues(std::istream *ifs, Reader *reader, std::ostream
 	m_ofs = ofs;
 	m_reader = reader;
 	m_idxreader = idxreader;
+	m_iterator = 0;
 	m_tempFileName = tmpfilenme;
 	m_indexAuthor = indexauthor;
 	m_indexComment = indexcomment;
@@ -1605,6 +1869,11 @@ bool IndexData::SetInitialValues(std::istream *ifs, Reader *reader, std::ostream
 	m_forceNewIndex = forcenewindex;
 	m_debugger = debugger;
 	m_indexValid = false;
+    m_LowXCellCompletelyIn = m_HighXCellCompletelyIn = m_LowYCellCompletelyIn = m_HighYCellCompletelyIn = 
+		m_LowZCellCompletelyIn = m_HighZCellCompletelyIn =
+		m_LowXBorderCell = m_HighXBorderCell = m_LowYBorderCell = m_HighYBorderCell = 
+		m_LowZBorderCell = m_HighZBorderCell = 0;
+	m_LowXBorderPartCell = m_HighXBorderPartCell = m_LowYBorderPartCell = m_HighYBorderPartCell = 0.0;
 	return (m_reader || m_ifs);
 	
 } // IndexData::SetInitialValues
@@ -1618,6 +1887,7 @@ bool IndexData::SetBuildEmbedValues(Reader *reader, std::ostream *ofs, const cha
 	m_ofs = ofs;
 	m_reader = reader;
 	m_idxreader = 0;
+	m_iterator = 0;
 	m_tempFileName = tmpfilenme;
 	m_indexAuthor = indexauthor;
 	m_indexComment = indexcomment;
@@ -1643,6 +1913,7 @@ bool IndexData::SetBuildAloneValues(Reader *reader, std::ostream *ofs, const cha
 	m_ofs = ofs;
 	m_reader = reader;
 	m_idxreader = 0;
+	m_iterator = 0;
 	m_tempFileName = tmpfilenme;
 	m_indexAuthor = indexauthor;
 	m_indexComment = indexcomment;
@@ -1666,6 +1937,7 @@ bool IndexData::SetReadEmbedValues(Reader *reader, int debugoutputlevel, FILE *d
 	m_ofs = 0;
 	m_reader = reader;
 	m_idxreader = 0;
+	m_iterator = 0;
 	m_tempFileName = 0;
 	m_indexAuthor = 0;
 	m_indexComment = 0;
@@ -1689,6 +1961,7 @@ bool IndexData::SetReadAloneValues(Reader *reader, Reader *idxreader, int debugo
 	m_ofs = 0;
 	m_reader = reader;
 	m_idxreader = idxreader;
+	m_iterator = 0;
 	m_tempFileName = 0;
 	m_indexAuthor = 0;
 	m_indexComment = 0;
@@ -1776,5 +2049,94 @@ void IndexData::ClampFilterBounds(Bounds<double> const& m_bounds)
 	m_filter.clip(m_bounds);
 } // IndexData::ClampFilterBounds
 
+IndexIterator::IndexIterator(Index *IndexSrc, double LowFilterX, double HighFilterX, double LowFilterY, double HighFilterY, 
+	double LowFilterZ, double HighFilterZ, boost::uint32_t ChunkSize)
+	: m_indexData(*IndexSrc)
+{
+	m_index = IndexSrc;
+	m_indexData.m_filter = Bounds<double>(LowFilterX, LowFilterY, LowFilterZ, HighFilterX, HighFilterY, HighFilterZ);
+	m_chunkSize = ChunkSize;
+	m_advance = 0;
+	ResetPosition();
+} // IndexIterator::IndexIterator
+
+IndexIterator::IndexIterator(Index *IndexSrc, IndexData const& IndexDataSrc, boost::uint32_t ChunkSize)
+	: m_indexData(IndexDataSrc)
+{
+	m_index = IndexSrc;
+	m_chunkSize = ChunkSize;
+	m_advance = 0;
+	ResetPosition();
+} // IndexIterator::IndexIterator
+
+IndexIterator::IndexIterator(Index *IndexSrc, Bounds<double> const& BoundsSrc, boost::uint32_t ChunkSize)
+{
+	m_index = IndexSrc;
+	m_indexData = IndexData(*IndexSrc);
+	m_indexData.m_filter = BoundsSrc;
+	m_chunkSize = ChunkSize;
+	m_advance = 0;
+	ResetPosition();
+} // IndexIterator::IndexIterator
+
+IndexIterator::IndexIterator(IndexIterator const& other)
+{
+	Copy(other);
+} // IndexIterator::IndexIterator
+
+IndexIterator& IndexIterator::operator=(IndexIterator const& rhs)
+{
+	Copy(rhs);
+	return (*this);
+} // IndexIterator::operator=
+
+void IndexIterator::Copy(IndexIterator const& other)
+{
+	if (&other != this)
+	{
+		m_index = other.m_index;
+		m_indexData = other.m_indexData;
+		m_chunkSize = other.m_chunkSize;
+		m_advance = other.m_advance;
+		m_curVLR = other.m_curVLR;
+		m_curCellStartPos = other.m_curCellStartPos;
+		m_curCellX = other.m_curCellX;
+		m_curCellY = other.m_curCellY;
+		m_totalPointsScanned = other.m_totalPointsScanned;
+		m_ptsScannedCurCell = other.m_ptsScannedCurCell;
+		m_ptsScannedCurVLR = other.m_ptsScannedCurVLR;
+		m_conformingPtsFound = other.m_conformingPtsFound;
+	} // if
+} // IndexIterator::Copy
+
+void IndexIterator::ResetPosition(void)
+{
+	m_curVLR = m_curCellStartPos = m_curCellX = m_curCellY = 0;
+	m_totalPointsScanned = m_ptsScannedCurCell = m_ptsScannedCurVLR = 0;
+	m_conformingPtsFound = 0;
+} // IndexIterator::ResetPosition
+
+const std::vector<boost::uint32_t>& IndexIterator::operator()(boost::int32_t n)
+{
+	if (n < 0)
+		n = 0;
+	if ((boost::uint32_t)n <= m_conformingPtsFound)
+		ResetPosition();
+	n -= m_conformingPtsFound;
+	return (advance(n));
+} // IndexIterator::operator++
+
+const std::vector<boost::uint32_t>& IndexIterator::advance(boost::int32_t n)
+{
+	if (n < 0)
+	{
+		n = m_conformingPtsFound + n;
+		return((*this)(n));
+	} // if
+	m_advance = n;
+	m_indexData.SetIterator(this);
+	return (m_index->Filter(m_indexData));
+} // IndexIterator::advance
+
 } // namespace liblas
 
diff --git a/Utilities/otbliblas/src/laspoint.cpp b/Utilities/otbliblas/src/laspoint.cpp
index 153d5750919f60b51595c7341436c4674d8f13a2..e6f0b141c391c436b9b15ba8b498925c5eacb9c7 100755
--- a/Utilities/otbliblas/src/laspoint.cpp
+++ b/Utilities/otbliblas/src/laspoint.cpp
@@ -43,6 +43,7 @@
 #include <liblas/lasheader.hpp>
 #include <liblas/lasschema.hpp>
 #include <liblas/exception.hpp>
+#include <liblas/detail/binary.hpp>
 #include <liblas/detail/pointrecord.hpp>
 // boost
 #include <boost/array.hpp>
@@ -95,7 +96,6 @@ Point& Point::operator=(Point const& rhs)
     return *this;
 }
 
-
 void Point::SetCoordinates(double const& x, double const& y, double const& z)
 {
     SetX(x);
@@ -103,7 +103,6 @@ void Point::SetCoordinates(double const& x, double const& y, double const& z)
     SetZ(z);
 }
 
-
 bool Point::equal(Point const& other) const
 {
     // TODO - mloskot: Default epsilon is too small.
@@ -184,7 +183,6 @@ bool Point::IsValid() const
     if (this->GetReturnNumber() > 0x07)
         return false;
 
-
     return true;
 }
 
@@ -230,24 +228,17 @@ void Point::SetHeaderPtr(HeaderPtr header)
         SetUserData(p.GetUserData());
         SetPointSourceID(p.GetPointSourceID());
         
-        try {
-            SetTime(p.GetTime());
-        } catch (std::runtime_error const&) 
+        try
         {
-            
-        }
-
-        try {
+            SetTime(p.GetTime());
             SetColor(p.GetColor());
-        } catch (std::runtime_error const&) 
-        {
-            
         }
-        
+        catch (std::runtime_error const&)
+        {   
+        }
+
         // FIXME: copy other custom dimensions here?  resetting the 
         // headerptr can be catastrophic in a lot of cases.  
-
-        
     }
     
     m_header = header;
@@ -391,59 +382,70 @@ double Point::GetZ() const
 
 void Point::SetX( double const& value ) 
 {
-    boost::int32_t v = static_cast<boost::int32_t>(value);
+    boost::int32_t v;
+    double scale;
+    double offset;
+
     if (m_header.get() != 0 ) 
     {
-        // descale the value given our scale/offset
-        v = static_cast<boost::int32_t>(
-                             detail::sround(((value - m_header->GetOffsetX()) / 
-                                              m_header->GetScaleX())));
-
-    } else 
+        scale = m_header->GetScaleX();
+        offset = m_header->GetOffsetX();
+    } 
+    else 
     {
-        v = static_cast<boost::int32_t>(
-                             detail::sround(((value - m_default_header.GetOffsetX()) / 
-                                              m_default_header.GetScaleX())));
+        scale = m_default_header.GetScaleX();
+        offset = m_default_header.GetOffsetX();
     }
 
+    // descale the value given our scale/offset
+    v = static_cast<boost::int32_t>(
+                         detail::sround((value - offset) / scale));
     SetRawX(v);
 }
 
 void Point::SetY( double const& value ) 
 {
-    boost::int32_t v = static_cast<boost::int32_t>(value);
+    boost::int32_t v;
+    double scale;
+    double offset;
+
     if (m_header.get() != 0 ) 
     {
-        // descale the value given our scale/offset
-        v = static_cast<boost::int32_t>(
-                             detail::sround(((value - m_header->GetOffsetY()) / 
-                                              m_header->GetScaleY())));
-    } else 
+        scale = m_header->GetScaleY();
+        offset = m_header->GetOffsetY();
+    } 
+    else 
     {
-        v = static_cast<boost::int32_t>(
-                             detail::sround(((value - m_default_header.GetOffsetY()) / 
-                                              m_default_header.GetScaleY())));
+        scale = m_default_header.GetScaleY();
+        offset = m_default_header.GetOffsetY();
     }
-    
+
+    // descale the value given our scale/offset
+    v = static_cast<boost::int32_t>(
+                         detail::sround((value - offset) / scale));
     SetRawY(v);
 }
 
 void Point::SetZ( double const& value ) 
 {
-    boost::int32_t v = static_cast<boost::int32_t>(value);
-    if (m_header) 
+    boost::int32_t v;
+    double scale;
+    double offset;
+
+    if (m_header.get() != 0 ) 
     {
-        // descale the value given our scale/offset
-        v = static_cast<boost::int32_t>(
-                             detail::sround(((value - m_header->GetOffsetZ()) / 
-                                              m_header->GetScaleZ())));
-    } else
+        scale = m_header->GetScaleZ();
+        offset = m_header->GetOffsetZ();
+    } 
+    else 
     {
-        v = static_cast<boost::int32_t>(
-                             detail::sround(((value - m_default_header.GetOffsetZ()) / 
-                                              m_default_header.GetScaleZ())));
+        scale = m_default_header.GetScaleZ();
+        offset = m_default_header.GetOffsetZ();
     }
-    
+
+    // descale the value given our scale/offset
+    v = static_cast<boost::int32_t>(
+                         detail::sround((value - offset) / scale));
     SetRawZ(v);
 }
 
@@ -722,14 +724,11 @@ boost::uint16_t Point::GetPointSourceID() const
     return output;
 }
 
-
 void Point::SetPointSourceID(boost::uint16_t const& id)
 {
     // "Point Source ID" is always the 12th dimension    
     std::vector<boost::uint8_t>::size_type pos = GetDimensionBytePosition(11);
-    liblas::detail::intToBits<boost::uint16_t>(id, 
-                                               m_data, 
-                                               pos);
+    liblas::detail::intToBits<boost::uint16_t>(id, m_data, pos);
 }
 
 void Point::SetTime(double const& t)
@@ -753,54 +752,40 @@ void Point::SetTime(double const& t)
     }
     std::vector<boost::uint8_t>::size_type pos = GetDimensionBytePosition(index_pos);
 
-    const boost::uint8_t* x_b =  reinterpret_cast<const boost::uint8_t*>(&t);
-#if defined(LIBLAS_BIG_ENDIAN)
-        for (boost::int32_t n = sizeof( double )-1; n >= 0; n--)
-#else
-        for (boost::uint32_t n = 0; n < sizeof( double ); n++)
-#endif 
-            m_data[pos+n] = x_b[n];
-
+    detail::binary::endian_value<double> value(t);
+    value.store<detail::binary::little_endian_tag>(&m_data[0] + pos);
 }
 
 double Point::GetTime() const
 {
-    // "Time" is the 13th dimension if it exists
-    std::size_t index_pos = 12;
-
     PointFormatName f;
-    if (m_header) {
+    if (m_header)
+    {
         f = m_header->GetDataFormatId();
-    } else {
+    }
+    else
+    {
         f = m_default_header.GetDataFormatId();
     }   
     
-    if ( f == ePointFormat0 || f == ePointFormat2 ) {
+    if (f == ePointFormat0 || f == ePointFormat2)
+    {
         // std::ostringstream msg;
         // msg << "Point::GetTime - Unable to get time for ePointFormat0 or ePointFormat2, "
         //     << "no Time dimension exists on this format";
         // throw std::runtime_error(msg.str());
         return 0.0;
     }
-    std::vector<boost::uint8_t>::size_type pos = GetDimensionBytePosition(index_pos);
-
 
-    boost::uint8_t* data = new boost::uint8_t[8];
-    
-#if defined(LIBLAS_BIG_ENDIAN)
-        for (boost::uint32_t n = 0; n < sizeof( double ); n++)
-#else
-        for (boost::int32_t n = sizeof( double )-1; n >= 0; n--)
-#endif  
-            data[n] = m_data[pos+n];
+    // "Time" is the 13th dimension if it exists
+    std::size_t const index_pos = 12;
+    std::vector<boost::uint8_t>::size_type pos = GetDimensionBytePosition(index_pos);
 
-    const double* output = reinterpret_cast<const double*>(data);
-    double out = *output;
-    delete[] data;
-    return out;
+    detail::binary::endian_value<double> value;
+    value.load<detail::binary::little_endian_tag>(&m_data[0] + pos);
+    return value;
 }
 
-
 Color Point::GetColor() const
 {
     boost::uint16_t red(0);
@@ -868,23 +853,14 @@ void Point::SetColor(Color const& value)
     
     std::vector<boost::uint8_t>::size_type green_pos = GetDimensionBytePosition(index_pos + 1);
     std::vector<boost::uint8_t>::size_type blue_pos = GetDimensionBytePosition(index_pos + 2);
- 
-
     std::vector<boost::uint8_t>::size_type red_pos = GetDimensionBytePosition(index_pos);
     assert(red_pos + sizeof(Color::value_type) <= m_data.size());
+    
     intToBits<boost::uint16_t>(value.GetRed(), m_data, red_pos);
-    intToBits<boost::uint16_t>(value.GetGreen(), 
-                                               m_data, 
-                                               green_pos);
-    intToBits<boost::uint16_t>(value.GetBlue(), 
-                                               m_data, 
-                                               blue_pos);
+    intToBits<boost::uint16_t>(value.GetGreen(), m_data, green_pos);
+    intToBits<boost::uint16_t>(value.GetBlue(), m_data, blue_pos);
 }
 
-
-
-
-
 std::vector<boost::uint8_t>::size_type Point::GetDimensionBytePosition(std::size_t dim_pos) const
 {
     std::size_t output = 0;
@@ -898,19 +874,12 @@ std::vector<boost::uint8_t>::size_type Point::GetDimensionBytePosition(std::size
     return output;
 }
 
-
-
-
-
 boost::any Point::GetValue(Dimension const& d) const
 {
-
     boost::any output;
+    boost::ignore_unused_variable_warning(d);
 
- 
-    
     return output;
 }
 
-
 } // namespace liblas
diff --git a/Utilities/otbliblas/src/lasreader.cpp b/Utilities/otbliblas/src/lasreader.cpp
old mode 100755
new mode 100644
index f566243107ed52e4d663a1651b2b7afc472d7714..7a39c9a6db674092e232c3750fee1b440448c789
--- a/Utilities/otbliblas/src/lasreader.cpp
+++ b/Utilities/otbliblas/src/lasreader.cpp
@@ -64,68 +64,59 @@ namespace liblas
 
 Reader::Reader(std::istream& ifs) :
     m_pimpl(new detail::CachedReaderImpl(ifs,3)),
-    m_header(HeaderPtr()),
     m_point(0),
     m_empty_point(new Point()),
     bCustomHeader(false),
     m_filters(0),
-    m_transforms(0),
-    m_reprojection_transform(TransformPtr())
+    m_transforms(0)
 {
     Init();
 }
 
 Reader::Reader(std::istream& ifs, uint32_t cache_size) :
     m_pimpl(new detail::CachedReaderImpl(ifs, cache_size)),
-    m_header(HeaderPtr()),
     m_point(0),
     m_empty_point(new Point()),
     bCustomHeader(false),
     m_filters(0),
-    m_transforms(0),
-    m_reprojection_transform(TransformPtr())
+    m_transforms(0)
 {
     Init();
 }
 
-Reader::Reader(std::istream& ifs, uint32_t cache_size, Header& header) :
+Reader::Reader(std::istream& ifs, uint32_t cache_size, Header const& header) :
     m_pimpl(new detail::CachedReaderImpl(ifs, cache_size)),
-    m_header(HeaderPtr( )),    
+    m_header(new Header(header)),
     m_point(0),
     m_empty_point(new Point()),
     bCustomHeader(true),
     m_filters(0),
-    m_transforms(0),
-    m_reprojection_transform(TransformPtr())
+    m_transforms(0)
 {
     // if we have a custom header, create a slot for it and then copy 
     // the header we were given
-    m_header = HeaderPtr(new Header(header));
+
     Init();
 }
 
 Reader::Reader(ReaderI* reader) :
     m_pimpl(reader),
-    m_header(HeaderPtr()),
     m_point(0),
     m_empty_point(new Point()),
     bCustomHeader(false),
     m_filters(0),
-    m_transforms(0),
-    m_reprojection_transform(TransformPtr())
+    m_transforms(0)
 {
     Init();
 }
 
-Reader::Reader(std::istream& ifs, Header& header) :
+Reader::Reader(std::istream& ifs, Header const& header) :
     m_pimpl(new detail::ReaderImpl(ifs)),
-    m_header(HeaderPtr( )),    
     m_point(0),
     m_empty_point(new Point()),
     bCustomHeader(true),
     m_filters(0),
-    m_transforms(0),
-    m_reprojection_transform(TransformPtr())
+    m_transforms(0)
 {
     // if we have a custom header, create a slot for it and then copy 
     // the header we were given
@@ -155,18 +146,19 @@ Point const& Reader::GetPoint() const
 }
 
 bool Reader::KeepPoint(liblas::Point const& p)
-{
-    std::vector<liblas::FilterPtr>::const_iterator fi;
-    
+{    
     // If there's no filters on this reader, we keep 
     // the point no matter what.
     if (m_filters.empty() ) {
         return true;
     }
 
-    for (fi = m_filters.begin(); fi != m_filters.end(); ++fi) {
+    std::vector<liblas::FilterPtr>::const_iterator fi;
+    for (fi = m_filters.begin(); fi != m_filters.end(); ++fi)
+    {
         liblas::FilterPtr filter = *fi;
-        if (!filter->filter(p)){
+        if (!filter->filter(p))
+        {
             return false;
         }
     }
@@ -174,72 +166,87 @@ bool Reader::KeepPoint(liblas::Point const& p)
 }
 
 bool Reader::ReadNextPoint()
-{
-    std::vector<liblas::TransformPtr>::const_iterator ti;
-  
-    try {
+{  
+    try
+    {
         // m_point = m_pimpl->ReadNextPoint(m_header).get();
         m_point = const_cast<Point*>(&(m_pimpl->ReadNextPoint(m_header)));
-        
+
         // Filter the points and continue reading until we either find 
         // one to keep or throw an exception.
-        if (!KeepPoint(*m_point)) {
+        if (!KeepPoint(*m_point))
+        {
             m_point = const_cast<Point*>(&(m_pimpl->ReadNextPoint(m_header)));
-            while (!KeepPoint(*m_point)) {
+            while (!KeepPoint(*m_point))
+            {
                 m_point = const_cast<Point*>(&(m_pimpl->ReadNextPoint(m_header)));
             }
         }
         
-        if (!m_transforms.empty()) {
+        if (!m_transforms.empty())
+        {
             // Apply the transforms to each point
+            std::vector<liblas::TransformPtr>::const_iterator ti;
 
-            for (ti = m_transforms.begin(); ti != m_transforms.end(); ++ti) {
+            for (ti = m_transforms.begin(); ti != m_transforms.end(); ++ti)
+            {
                 liblas::TransformPtr transform = *ti;
                 transform->transform(*m_point);
             }            
         }
 
         return true;
-    } catch (std::out_of_range) {
+    }
+    catch (std::out_of_range)
+    {
         m_point = 0;
-        return false;
     }
+
+    return false;
 }
 
 bool Reader::ReadPointAt(std::size_t n)
 {
-    std::vector<liblas::TransformPtr>::const_iterator ti;
-
     if (m_header->GetPointRecordsCount() <= n)
     {
         throw std::out_of_range("point subscript out of range");
     }
     
-    try {
+    try
+    {
         m_point = const_cast<Point*>(&(m_pimpl->ReadPointAt(n, m_header)));
-        if (!m_transforms.empty()) {
-            for (ti = m_transforms.begin(); ti != m_transforms.end(); ++ti) {
+        if (!m_transforms.empty())
+        {
+            std::vector<liblas::TransformPtr>::const_iterator ti;
+            for (ti = m_transforms.begin(); ti != m_transforms.end(); ++ti)
+            {
                 liblas::TransformPtr transform = *ti;
                 transform->transform(*m_point);
             }            
-            }
+        }
         return true;
-    } catch (std::out_of_range) {
+    }
+    catch (std::out_of_range)
+    {
         m_point = 0;
-        return false;
     }
+    return false;
 }
 
 bool Reader::seek(std::size_t n)
 {
-    try {
+    try
+    {
+        assert(n < m_header->GetPointRecordsCount());
+
         m_pimpl->Seek(n, m_header);
         return true;
-    } catch (std::out_of_range) {
+    }
+    catch (std::out_of_range)
+    {
         m_point = 0;
-        return false;
     }
-
+    return false;
 }
 Point const& Reader::operator[](std::size_t n)
 {
@@ -338,7 +345,7 @@ bool Reader::SetOutputSRS(const SpatialReference& srs)
         possible_reprojection_transform = m_transforms.at(0);
     }
     
-    if (m_reprojection_transform == possible_reprojection_transform && m_reprojection_transform.get() != 0) {
+    if (m_reprojection_transform == possible_reprojection_transform && m_reprojection_transform) {
         // remove it from the transforms list
         std::vector<liblas::TransformPtr>::iterator i = m_transforms.begin();
         m_transforms.erase(i);
@@ -361,8 +368,6 @@ bool Reader::SetOutputSRS(const SpatialReference& srs)
 
 liblas::property_tree::ptree Reader::Summarize() 
 {
-
-    
     liblas::Summary s;
 
     Reset();
@@ -378,7 +383,7 @@ liblas::property_tree::ptree Reader::Summarize()
         s.AddPoint(p);
         read = ReadNextPoint();
     }
-    
+
     return s.GetPTree();
     
     // Summarize the schema
diff --git a/Utilities/otbliblas/src/lasschema.cpp b/Utilities/otbliblas/src/lasschema.cpp
old mode 100755
new mode 100644
index 3d56f5791d67f9f28d368941a502ebc343ea28f9..96147369a6e67c5b0e918736d9b6328479a20e35
--- a/Utilities/otbliblas/src/lasschema.cpp
+++ b/Utilities/otbliblas/src/lasschema.cpp
@@ -436,7 +436,10 @@ IndexMap Schema::LoadDimensions(liblas::property_tree::ptree tree)
         d.IsSigned(issigned);
         d.IsRequired(isrequired);
         d.SetPosition(position);
-        if (min != max && min != 0 && max != 0) {
+        if (!detail::compare_distance(max, min ) && 
+            !detail::compare_distance(0.0, min) &&
+            !detail::compare_distance(0.0, max))
+        {
             d.SetMinimum(min);
             d.SetMaximum(max);
         }
diff --git a/Utilities/otbliblas/src/lasspatialreference.cpp b/Utilities/otbliblas/src/lasspatialreference.cpp
old mode 100755
new mode 100644
index bdb46c75e3c1fe11d5a6b9e022e1dccca3e63c7c..76e428edf645bcb7308844d16e769f5abebca22e
--- a/Utilities/otbliblas/src/lasspatialreference.cpp
+++ b/Utilities/otbliblas/src/lasspatialreference.cpp
@@ -50,6 +50,10 @@
 #include <string>
 #include <vector>
 
+#ifdef HAVE_GDAL
+#  include "cpl_conv.h"
+#endif
+
 using namespace boost;
 
 namespace liblas {
@@ -364,7 +368,7 @@ const GTIF* SpatialReference::GetGTIF()
 
     m_gtiff = GTIFNewSimpleTags(m_tiff);
     if (!m_gtiff) 
-        throw std::runtime_error("The geotiff keys could not read from VLR records");
+        throw std::runtime_error("The geotiff keys could not be read from VLR records");
     
     return m_gtiff;
 #endif
@@ -395,16 +399,16 @@ std::string SpatialReference::GetWKT(WKTModeFlag mode_flag , bool pretty) const
     {
         pszWKT = GTIFGetOGISDefn( m_gtiff, &sGTIFDefn );
 
-            if (pretty) {
-                OGRSpatialReference* poSRS = (OGRSpatialReference*) OSRNewSpatialReference(NULL);
-                char *pszOrigWKT = pszWKT;
-                poSRS->importFromWkt( &pszOrigWKT );
-
-                CPLFree( pszWKT );
-                pszWKT = NULL;
-                poSRS->exportToPrettyWkt(&pszWKT, false);
-                delete poSRS;
-            }
+        if (pretty) {
+            OGRSpatialReference* poSRS = (OGRSpatialReference*) OSRNewSpatialReference(NULL);
+            char *pszOrigWKT = pszWKT;
+            poSRS->importFromWkt( &pszOrigWKT );
+            
+            CPLFree( pszWKT );
+            pszWKT = NULL;
+            poSRS->exportToPrettyWkt(&pszWKT, false);
+            delete poSRS;
+        }
                 
         // Older versions of GDAL lack StripVertical(), but should never
         // actually return COMPD_CS anyways.
@@ -499,10 +503,10 @@ void SpatialReference::SetWKT(std::string const& v)
 #endif
 }
 
-void SpatialReference::SetVerticalCS(int verticalCSType, 
+void SpatialReference::SetVerticalCS(boost::int32_t verticalCSType, 
                                      std::string const& citation,
-                                     int verticalDatum,
-                                     int verticalUnits)
+                                     boost::int32_t verticalDatum,
+                                     boost::int32_t verticalUnits)
 {
     if (!m_gtiff)
     {
diff --git a/Utilities/otbliblas/src/lastransform.cpp b/Utilities/otbliblas/src/lastransform.cpp
old mode 100755
new mode 100644
index f6e002c817f05f3aeeedb3b13bca7b1c2277d4f2..1af16955c4e68d827074f9883279084214dafbcc
--- a/Utilities/otbliblas/src/lastransform.cpp
+++ b/Utilities/otbliblas/src/lastransform.cpp
@@ -42,38 +42,43 @@
 #include <liblas/lastransform.hpp>
 // boost
 #include <boost/concept_check.hpp>
+#include <boost/tokenizer.hpp>
+#include <boost/lexical_cast.hpp>
+#include <boost/algorithm/string/erase.hpp>
+
 // std
 #include <sstream>
 #include <stdexcept>
 #include <string>
+#include <algorithm>
+
+typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
 
 namespace liblas { 
 
 ReprojectionTransform::ReprojectionTransform(const SpatialReference& inSRS, const SpatialReference& outSRS)
-    : m_transform(0)
-    , m_in_ref(0)
-    , m_out_ref(0)
+    : m_new_header(HeaderPtr())
 {
+    Initialize(inSRS, outSRS);
+}
 
+ReprojectionTransform::ReprojectionTransform(
+    const SpatialReference& inSRS, 
+    const SpatialReference& outSRS,
+    liblas::HeaderPtr new_header)
+    : m_new_header(new_header)
+{
+    Initialize(inSRS, outSRS);
+}
+
+void ReprojectionTransform::Initialize(const SpatialReference& inSRS, const SpatialReference& outSRS)
+{
 #ifdef HAVE_GDAL
     
-    if (m_transform)
-    {
-        OCTDestroyCoordinateTransformation(m_transform);
-    }
-    if (m_in_ref)
-    {
-        OSRDestroySpatialReference(m_in_ref);
-    }
-    if (m_out_ref)
-    {
-        OSRDestroySpatialReference(m_out_ref);
-    }
+    m_in_ref_ptr = ReferencePtr(OSRNewSpatialReference(0), OGRSpatialReferenceDeleter());
+    m_out_ref_ptr = ReferencePtr(OSRNewSpatialReference(0), OGRSpatialReferenceDeleter());
     
-    m_in_ref = OSRNewSpatialReference(0);
-    m_out_ref = OSRNewSpatialReference(0);
-    
-    int result = OSRSetFromUserInput(m_in_ref, inSRS.GetWKT(liblas::SpatialReference::eCompoundOK).c_str());
+    int result = OSRSetFromUserInput(m_in_ref_ptr.get(), inSRS.GetWKT(liblas::SpatialReference::eCompoundOK).c_str());
     if (result != OGRERR_NONE) 
     {
         std::ostringstream msg; 
@@ -83,7 +88,7 @@ ReprojectionTransform::ReprojectionTransform(const SpatialReference& inSRS, cons
         throw std::runtime_error(msg.str());
     }
     
-    result = OSRSetFromUserInput(m_out_ref, outSRS.GetWKT(liblas::SpatialReference::eCompoundOK).c_str());
+    result = OSRSetFromUserInput(m_out_ref_ptr.get(), outSRS.GetWKT(liblas::SpatialReference::eCompoundOK).c_str());
     if (result != OGRERR_NONE) 
     {
         std::ostringstream msg; 
@@ -93,8 +98,7 @@ ReprojectionTransform::ReprojectionTransform(const SpatialReference& inSRS, cons
         std::string message(msg.str());
         throw std::runtime_error(message);
     }
-
-    m_transform = OCTNewCoordinateTransformation( m_in_ref, m_out_ref);
+    m_transform_ptr = TransformPtr(OCTNewCoordinateTransformation( m_in_ref_ptr.get(), m_out_ref_ptr.get()), OSRTransformDeleter());
 #else
 
     boost::ignore_unused_variable_warning(inSRS);
@@ -104,21 +108,7 @@ ReprojectionTransform::ReprojectionTransform(const SpatialReference& inSRS, cons
 
 ReprojectionTransform::~ReprojectionTransform()
 {
-#ifdef HAVE_GDAL
-    if (m_transform)
-    {
-        OCTDestroyCoordinateTransformation(m_transform);
-    }
-    if (m_in_ref)
-    {
-        OSRDestroySpatialReference(m_in_ref);
-    }
-    if (m_out_ref)
-    {
-        OSRDestroySpatialReference(m_out_ref);
-    }
 
-#endif
 }
 
 
@@ -130,8 +120,8 @@ bool ReprojectionTransform::transform(Point& point)
     double x = point.GetX();
     double y = point.GetY();
     double z = point.GetZ();
-    
-    ret = OCTTransform(m_transform, 1, &x, &y, &z);    
+
+    ret = OCTTransform(m_transform_ptr.get(), 1, &x, &y, &z);    
     if (!ret)
     {
         std::ostringstream msg; 
@@ -139,14 +129,256 @@ bool ReprojectionTransform::transform(Point& point)
         throw std::runtime_error(msg.str());
     }
 
+    if (m_new_header.get()) 
+    {
+        point.SetHeaderPtr(m_new_header);
+    }
+
     point.SetX(x);
     point.SetY(y);
     point.SetZ(z);
     
+    if (detail::compare_distance(point.GetRawX(), std::numeric_limits<boost::int32_t>::max()) ||
+        detail::compare_distance(point.GetRawX(), std::numeric_limits<boost::int32_t>::min())) {
+        throw std::domain_error("X scale and offset combination is insufficient to represent the data");
+    }
+
+    if (detail::compare_distance(point.GetRawY(), std::numeric_limits<boost::int32_t>::max()) ||
+        detail::compare_distance(point.GetRawY(), std::numeric_limits<boost::int32_t>::min())) {
+        throw std::domain_error("Y scale and offset combination is insufficient to represent the data");
+    }    
+
+    if (detail::compare_distance(point.GetRawZ(), std::numeric_limits<boost::int32_t>::max()) ||
+        detail::compare_distance(point.GetRawZ(), std::numeric_limits<boost::int32_t>::min())) {
+        throw std::domain_error("Z scale and offset combination is insufficient to represent the data");
+    }        
+
     return true;
 #else
     boost::ignore_unused_variable_warning(point);
     return true;
 #endif
 }
+
+
+
+TranslationTransform::TranslationTransform(std::string const& expression)
+{
+    if (expression.size() == 0) 
+        throw std::runtime_error("no expression was given to TranslationTransform");
+    
+    boost::char_separator<char> sep_space(" ");
+
+    tokenizer dimensions(expression, sep_space);
+    for (tokenizer::iterator t = dimensions.begin(); t != dimensions.end(); ++t) {
+        std::string const& s = *t;
+        
+        operation op = GetOperation(s);
+        operations.push_back(op);
+    }
+    
+}
+
+TranslationTransform::operation TranslationTransform::GetOperation(std::string const& expr)
+{
+
+    std::string x("x");
+    std::string y("y");
+    std::string z("z");
+    std::string star("*");
+    std::string divide("/");
+    std::string plus("+");
+    std::string minus("-");
+
+    if (expr.find(x) == std::string::npos &&
+        expr.find(y) == std::string::npos &&
+        expr.find(z) == std::string::npos)
+        throw std::runtime_error("expression is invalid -- use x, y, or z to define a dimension.  No 'x', 'y', or 'z' was found");
+
+    operation output("X");
+    
+    
+    std::string expression(expr);
+    boost::erase_all(expression, " "); // Get rid of any spaces in the expression chunk
+
+
+    std::size_t found_x = expression.find(x);
+    std::size_t found_y = expression.find(y);
+    std::size_t found_z = expression.find(z);
+    std::size_t found_star = expression.find(star);
+    std::size_t found_divide = expression.find(divide);
+    std::size_t found_plus = expression.find(plus);
+    std::size_t found_minus = expression.find(minus);
+    
+    // if they gave something like 'xyz*34' it's invalid
+    if (found_x != std::string::npos &&
+        found_y != std::string::npos &&
+        found_z != std::string::npos)
+        throw std::runtime_error("expression is invalid");
+    
+    std::string::size_type op_pos=std::string::npos;
+    if (found_x != std::string::npos)
+    {
+        output = operation("X");
+        op_pos = expression.find_last_of(x) + 1;
+    }
+
+    if (found_y != std::string::npos)
+    {
+        output = operation("Y");
+        op_pos = expression.find_last_of(y) + 1;
+    }
+
+    if (found_z != std::string::npos)
+    {
+        output = operation("Z");
+        op_pos = expression.find_last_of(z) + 1;
+    }
+    
+    if (op_pos == std::string::npos) 
+    {
+        std::ostringstream oss;
+        oss << "Expression '" << expression << "' does not have 'x', 'y', or 'z' to denote fields";
+        throw std::runtime_error(oss.str());
+    }
+    
+    std::string::size_type data_pos = std::string::npos;
+    if (found_star != std::string::npos) 
+    {
+        output.oper = eOPER_MULTIPLY;
+        data_pos = expression.find_last_of(star) + 1;
+    }
+
+    if (found_divide != std::string::npos) 
+    {
+        output.oper = eOPER_DIVIDE;
+        data_pos = expression.find_last_of(divide) + 1;
+    }
+
+    if (found_plus != std::string::npos) 
+    {
+        output.oper = eOPER_ADD;
+        data_pos = expression.find_last_of(plus) + 1;
+    }
+    if (found_minus != std::string::npos) 
+    {
+        output.oper = eOPER_SUBTRACT;
+        data_pos = expression.find_last_of(minus) + 1;
+    }
+
+    if (data_pos == std::string::npos) 
+    {
+        std::ostringstream oss;
+        oss << "Expression '" << expression << "' does not have '*', '/', '+', or '-' to denote operations";
+        throw std::runtime_error(oss.str());
+    }
+    
+    std::string out;
+    out = expression.substr(data_pos, expression.size());
+    
+    double value =  boost::lexical_cast<double>(out);    
+    output.expression = expression;
+    output.value = value;
+    
+    return output;
+            
+}
+bool TranslationTransform::transform(Point& point)
+{
+    for(std::vector<TranslationTransform::operation>::const_iterator op = operations.begin();
+        op != operations.end();
+        op++) 
+    {
+
+        switch (op->oper) 
+            {
+                case eOPER_MULTIPLY:
+                    if (!op->dimension.compare("X")) 
+                    {
+                        point.SetX(point.GetX() * op->value);
+                    }
+                    if (!op->dimension.compare("Y")) 
+                    {
+                        point.SetY(point.GetY() * op->value);
+                    }
+                    if (!op->dimension.compare("Z")) 
+                    {
+                        point.SetZ(point.GetZ() * op->value);
+                    }
+                    break;
+                case eOPER_DIVIDE:
+                    if (!op->dimension.compare("X")) 
+                    {
+                        point.SetX(point.GetX() / op->value);
+                    }
+                    if (!op->dimension.compare("Y")) 
+                    {
+                        point.SetY(point.GetY() / op->value);
+                    }
+                    if (!op->dimension.compare("Z")) 
+                    {
+                        point.SetZ(point.GetZ() / op->value);
+                    }
+                    break;
+                case eOPER_ADD:
+                    if (!op->dimension.compare("X")) 
+                    {
+                        point.SetX(point.GetX() + op->value);
+                    }
+                    if (!op->dimension.compare("Y")) 
+                    {
+                        point.SetY(point.GetY() + op->value);
+                    }
+                    if (!op->dimension.compare("Z")) 
+                    {
+                        point.SetZ(point.GetZ() + op->value);
+                    }
+
+                    break;
+                case eOPER_SUBTRACT:
+                    if (!op->dimension.compare("X")) 
+                    {
+                        point.SetX(point.GetX() - op->value);
+                    }
+                    if (!op->dimension.compare("Y")) 
+                    {
+                        point.SetY(point.GetY() - op->value);
+                    }
+                    if (!op->dimension.compare("Z")) 
+                    {
+                        point.SetZ(point.GetZ() - op->value);
+                    }
+                    break;
+
+                default:
+                    std::ostringstream oss;
+                    oss << "Unhandled expression operation id " << static_cast<boost::int32_t>(op->oper);
+                    throw std::runtime_error(oss.str());
+            }
+
+    if (detail::compare_distance(point.GetRawX(), std::numeric_limits<boost::int32_t>::max()) ||
+        detail::compare_distance(point.GetRawX(), std::numeric_limits<boost::int32_t>::min())) {
+        throw std::domain_error("X scale and offset combination of this file is insufficient to represent the data given the expression ");
+    }
+
+    if (detail::compare_distance(point.GetRawY(), std::numeric_limits<boost::int32_t>::max()) ||
+        detail::compare_distance(point.GetRawY(), std::numeric_limits<boost::int32_t>::min())) {
+        throw std::domain_error("Y scale and offset combination of this file is insufficient to represent the data given the expression");
+    }    
+
+    if (detail::compare_distance(point.GetRawZ(), std::numeric_limits<boost::int32_t>::max()) ||
+        detail::compare_distance(point.GetRawZ(), std::numeric_limits<boost::int32_t>::min())) {
+        throw std::domain_error("Z scale and offset combination of this file is insufficient to represent the data given the expression");
+    }   
+
+    }
+    return true;
+}
+
+
+TranslationTransform::~TranslationTransform()
+{
+}
+
+
 } // namespace liblas
diff --git a/Utilities/otbliblas/src/lasvariablerecord.cpp b/Utilities/otbliblas/src/lasvariablerecord.cpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/src/laswriter.cpp b/Utilities/otbliblas/src/laswriter.cpp
old mode 100755
new mode 100644
index a8a3ca8e4ee99cff48c73333c7af20c7ffefb04f..f10020a6b1b2390588cbd9358a6c125e8dd2c517
--- a/Utilities/otbliblas/src/laswriter.cpp
+++ b/Utilities/otbliblas/src/laswriter.cpp
@@ -86,26 +86,15 @@ bool Writer::WritePoint(Point const& point)
         return false;
     }
 
-    std::vector<liblas::FilterI*>::const_iterator fi;
-    std::vector<liblas::TransformI*>::const_iterator ti;
-    bool bHaveTransforms = false;
-    bool bHaveFilters = false;
-    
-    if (m_transforms != 0 ) {
-        bHaveTransforms = true;
-    }
-    
-    if (m_filters != 0 ) {
-        bHaveFilters = true;
-    }
-    
+    bool bHaveTransforms = (m_transforms != 0);
+    bool bHaveFilters = (m_filters != 0);
 
     if (bHaveFilters) {
     if (m_filters->size() != 0) {
         // We have filters, filter this point.  All filters must 
         // return true for us to keep it.
         bool keep = false;
-        for (fi = m_filters->begin(); fi != m_filters->end(); ++fi) {
+        for (std::vector<liblas::FilterI*>::const_iterator fi = m_filters->begin(); fi != m_filters->end(); ++fi) {
             liblas::FilterI* filter = *fi;
             if (filter->filter(point)){
                 // if ->filter() is true, we keep the point
@@ -127,7 +116,8 @@ bool Writer::WritePoint(Point const& point)
     
         // Apply the transforms to each point
         Point p(point);
-        for (ti = m_transforms->begin(); ti != m_transforms->end(); ++ti) {
+        for (std::vector<liblas::TransformI*>::const_iterator ti = m_transforms->begin();
+             ti != m_transforms->end(); ++ti) {
             liblas::TransformI* transform = *ti;
             transform->transform(p);
 
@@ -137,7 +127,6 @@ bool Writer::WritePoint(Point const& point)
         // transformations that change the point.
         m_pimpl->WritePoint(p, m_header);
         return true;
-        
     }
     }
 
@@ -198,7 +187,7 @@ bool Writer::SetOutputSRS(const SpatialReference& srs)
     }
     
     // overwrite our reprojection transform
-    m_reprojection_transform = TransformPtr(new ReprojectionTransform(m_in_srs, m_out_srs));
+    m_reprojection_transform = TransformPtr(new ReprojectionTransform(m_in_srs, m_out_srs, m_header));
     
     if (m_transforms != 0) {
         if (m_transforms->size() > 0) {
diff --git a/Utilities/otbliblas/src/utility.cpp b/Utilities/otbliblas/src/utility.cpp
index 87d174bcf74fdd3dbda5b43931ed58a47fdc17b1..ae615a146a2ca72de38b6ddd98c74c7ff657155f 100755
--- a/Utilities/otbliblas/src/utility.cpp
+++ b/Utilities/otbliblas/src/utility.cpp
@@ -112,8 +112,25 @@ void Summary::AddPoint(liblas::Point const& p)
             // point copy here would set the header ptr of min/max
             // to be whatever might have come off of the file, 
             // and this may/may not have space for time/color
-            min.SetHeaderPtr(HeaderPtr());
-            max.SetHeaderPtr(HeaderPtr());
+            
+            // If we do have scale/offset values, we do want to keep those, 
+            // however.  
+            liblas::HeaderPtr hdr = p.GetHeaderPtr();
+            if (hdr.get()) 
+            {
+                // Keep scale/offset values around because we need these 
+                liblas::Header header;
+                header.SetScale(hdr->GetScaleX(), hdr->GetScaleY(), hdr->GetScaleZ());
+                header.SetOffset(hdr->GetOffsetX(), hdr->GetOffsetY(), hdr->GetOffsetZ());
+                liblas::HeaderPtr h(new liblas::Header(header));
+                min.SetHeaderPtr(h);
+                max.SetHeaderPtr(h);
+            } else 
+            {
+                min.SetHeaderPtr(HeaderPtr());
+                max.SetHeaderPtr(HeaderPtr()); 
+            }
+
             first = false;
         }
         
@@ -273,6 +290,11 @@ std::ostream& operator<<(std::ostream& os, liblas::Summary const& s)
     os << "  Point Inspection Summary" << std::endl;
     os << "---------------------------------------------------------" << std::endl;
 
+    if (tree.get<boost::uint32_t>("summary.points.count") == 0 )
+    {
+        os << "  File has no points ...";
+        return os;
+    }
     os << "  Header Point Count: " << tree.get<std::string>("summary.header.count") << std::endl;
     os << "  Actual Point Count: " << tree.get<std::string>("summary.points.count") << std::endl;
     
@@ -289,7 +311,7 @@ std::ostream& operator<<(std::ostream& os, liblas::Summary const& s)
         double integer = 0;
         double x_scale = tree.get<double>("summary.header.scale.x");
         double y_scale = tree.get<double>("summary.header.scale.y");
-        double z_scale = tree.get<double>("summary.header.scale.x");
+        double z_scale = tree.get<double>("summary.header.scale.z");
         frac = std::modf(x_scale, &integer);
         x_precision = static_cast<boost::uint32_t>(std::fabs(std::floor(std::log10(frac))));
         frac = std::modf(y_scale, &integer);
@@ -310,7 +332,7 @@ std::ostream& operator<<(std::ostream& os, liblas::Summary const& s)
     os.precision(y_precision);
     os << tree.get<double>("summary.points.minimum.y") << ", ";
     os.precision(z_precision);
-    os << tree.get<double>("summary.points.minimum.z") << ", ";
+    os << tree.get<double>("summary.points.minimum.z");
 
     os << std::endl;
     os << "  Max X, Y, Z: \t\t";
@@ -320,14 +342,19 @@ std::ostream& operator<<(std::ostream& os, liblas::Summary const& s)
     os.precision(y_precision);
     os << tree.get<double>("summary.points.maximum.y") << ", ";
     os.precision(z_precision);
-    os << tree.get<double>("summary.points.maximum.z") << ", ";
+    os << tree.get<double>("summary.points.maximum.z");
     
     os << std::endl;
     os << "  Bounding Box:\t\t";
-    os << tree.get<double>("summary.points.minimum.x") << ", "
-       << tree.get<double>("summary.points.minimum.y") << ", "
-       << tree.get<double>("summary.points.maximum.x") << ", "
-       << tree.get<double>("summary.points.maximum.y");
+
+    os.precision(x_precision);
+    os << tree.get<double>("summary.points.minimum.x") << ", ";
+    os.precision(y_precision);
+    os << tree.get<double>("summary.points.minimum.y") << ", ";
+    os.precision(x_precision);
+    os << tree.get<double>("summary.points.maximum.x") << ", ";
+    os.precision(y_precision);
+    os << tree.get<double>("summary.points.maximum.y");
     
     os << std::endl;
     os.precision(6);
diff --git a/Utilities/otbliblas/test/CMakeLists.txt b/Utilities/otbliblas/test/CMakeLists.txt
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/CTestTestfile.cmake b/Utilities/otbliblas/test/CTestTestfile.cmake
old mode 100755
new mode 100644
index c96523249d62388e584f4d16b074bce51819c505..d57a1ed9ad48d1dcb9e2178cab5c4b2216c4f0bb
--- a/Utilities/otbliblas/test/CTestTestfile.cmake
+++ b/Utilities/otbliblas/test/CTestTestfile.cmake
@@ -1,6 +1,6 @@
 # CMake generated Testfile for 
-# Source directory: /tmp/liblas-main/test
-# Build directory: /tmp/liblas-main/test
+# Source directory: /tmp/liblas/test
+# Build directory: /tmp/liblas/test
 # 
 # This file includes the relevent testing commands required for 
 # testing this directory and lists subdirectories to be tested as well.
diff --git a/Utilities/otbliblas/test/Makefile b/Utilities/otbliblas/test/Makefile
index 78d8e5d8acb5c8c2c1f482e1580d6786fa7e01f9..190782785395e9f278a78cc37001194d240a8686 100755
--- a/Utilities/otbliblas/test/Makefile
+++ b/Utilities/otbliblas/test/Makefile
@@ -39,10 +39,10 @@ RM = "/Applications/CMake 2.8-0.app/Contents/bin/cmake" -E remove -f
 CMAKE_EDIT_COMMAND = "/Applications/CMake 2.8-0.app/Contents/bin/ccmake"
 
 # The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /tmp/liblas-main
+CMAKE_SOURCE_DIR = /tmp/liblas
 
 # The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /tmp/liblas-main
+CMAKE_BINARY_DIR = /tmp/liblas
 
 #=============================================================================
 # Targets provided globally by CMake.
@@ -101,7 +101,7 @@ list_install_components/fast: list_install_components
 # Special rule for the target package
 package: preinstall
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool..."
-	cd /tmp/liblas-main && "/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackConfig.cmake
+	cd /tmp/liblas && "/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackConfig.cmake
 .PHONY : package
 
 # Special rule for the target package
@@ -111,7 +111,7 @@ package/fast: package
 # Special rule for the target package_source
 package_source:
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool for source..."
-	cd /tmp/liblas-main && "/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackSourceConfig.cmake /tmp/liblas-main/CPackSourceConfig.cmake
+	cd /tmp/liblas && "/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackSourceConfig.cmake /tmp/liblas/CPackSourceConfig.cmake
 .PHONY : package_source
 
 # Special rule for the target package_source
@@ -140,14 +140,14 @@ test/fast: test
 
 # The main all target
 all: cmake_check_build_system
-	cd /tmp/liblas-main && $(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas-main/CMakeFiles /tmp/liblas-main/test/CMakeFiles/progress.marks
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 test/all
-	$(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas-main/CMakeFiles 0
+	cd /tmp/liblas && $(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas/CMakeFiles /tmp/liblas/test/CMakeFiles/progress.marks
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 test/all
+	$(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas/CMakeFiles 0
 .PHONY : all
 
 # The main clean target
 clean:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 test/clean
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 test/clean
 .PHONY : clean
 
 # The main clean target
@@ -156,17 +156,17 @@ clean/fast: clean
 
 # Prepare targets for installation.
 preinstall: all
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 test/preinstall
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 test/preinstall
 .PHONY : preinstall
 
 # Prepare targets for installation.
 preinstall/fast:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 test/preinstall
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 test/preinstall
 .PHONY : preinstall/fast
 
 # clear depends
 depend:
-	cd /tmp/liblas-main && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
+	cd /tmp/liblas && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
 .PHONY : depend
 
 # Help Target
@@ -195,6 +195,6 @@ help:
 # No rule that depends on this can have commands that come from listfiles
 # because they might be regenerated.
 cmake_check_build_system:
-	cd /tmp/liblas-main && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
+	cd /tmp/liblas && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
 .PHONY : cmake_check_build_system
 
diff --git a/Utilities/otbliblas/test/cmake_install.cmake b/Utilities/otbliblas/test/cmake_install.cmake
old mode 100755
new mode 100644
index 5cdc5e00e0962a7bd52f39f59511030615feeef9..2afb4e3e160cb50bd29b8e7a011d979a524ad273
--- a/Utilities/otbliblas/test/cmake_install.cmake
+++ b/Utilities/otbliblas/test/cmake_install.cmake
@@ -1,4 +1,4 @@
-# Install script for directory: /tmp/liblas-main/test
+# Install script for directory: /tmp/liblas/test
 
 # Set the install prefix
 IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
@@ -29,7 +29,7 @@ ENDIF(NOT CMAKE_INSTALL_COMPONENT)
 
 IF(NOT CMAKE_INSTALL_LOCAL_ONLY)
   # Include the install script for each subdirectory.
-  INCLUDE("/tmp/liblas-main/test/unit/cmake_install.cmake")
+  INCLUDE("/tmp/liblas/test/unit/cmake_install.cmake")
 
 ENDIF(NOT CMAKE_INSTALL_LOCAL_ONLY)
 
diff --git a/Utilities/otbliblas/test/data/1.2-with-color.las b/Utilities/otbliblas/test/data/1.2-with-color.las
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/data/TO_core_last_clip.las b/Utilities/otbliblas/test/data/TO_core_last_clip.las
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/data/bad_points_1.1.las b/Utilities/otbliblas/test/data/bad_points_1.1.las
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/data/lots_of_vlr.las b/Utilities/otbliblas/test/data/lots_of_vlr.las
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/data/make_bad_points.py b/Utilities/otbliblas/test/data/make_bad_points.py
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/data/make_data.py b/Utilities/otbliblas/test/data/make_data.py
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/data/srs_utm17.las b/Utilities/otbliblas/test/data/srs_utm17.las
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/data/srs_vertcs.las b/Utilities/otbliblas/test/data/srs_vertcs.las
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/sample/CMakeLists.txt b/Utilities/otbliblas/test/sample/CMakeLists.txt
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/sample/files.vcproj b/Utilities/otbliblas/test/sample/files.vcproj
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/sample/liblas.vsprops b/Utilities/otbliblas/test/sample/liblas.vsprops
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/sample/liblas_sample.sln b/Utilities/otbliblas/test/sample/liblas_sample.sln
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/sample/read.vcproj b/Utilities/otbliblas/test/sample/read.vcproj
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/sample/update.vcproj b/Utilities/otbliblas/test/sample/update.vcproj
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/sample/write.vcproj b/Utilities/otbliblas/test/sample/write.vcproj
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/CMakeFiles/CMakeDirectoryInformation.cmake b/Utilities/otbliblas/test/unit/CMakeFiles/CMakeDirectoryInformation.cmake
old mode 100755
new mode 100644
index 9342b6fb33ab28396908a3b1bd00a86a135c7423..8a1404cf73f52be8a89bcad99f9dd6527a71be8d
--- a/Utilities/otbliblas/test/unit/CMakeFiles/CMakeDirectoryInformation.cmake
+++ b/Utilities/otbliblas/test/unit/CMakeFiles/CMakeDirectoryInformation.cmake
@@ -2,8 +2,8 @@
 # Generated by "Unix Makefiles" Generator, CMake Version 2.8
 
 # Relative path conversion top directories.
-SET(CMAKE_RELATIVE_PATH_TOP_SOURCE "/tmp/liblas-main")
-SET(CMAKE_RELATIVE_PATH_TOP_BINARY "/tmp/liblas-main")
+SET(CMAKE_RELATIVE_PATH_TOP_SOURCE "/tmp/liblas")
+SET(CMAKE_RELATIVE_PATH_TOP_BINARY "/tmp/liblas")
 
 # Force unix paths in dependencies.
 SET(CMAKE_FORCE_UNIX_PATHS 1)
diff --git a/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/DependInfo.cmake b/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/DependInfo.cmake
old mode 100755
new mode 100644
index 4fb85fe355f1e2fa7900eaa417d99083c4f8975f..0cb688b58de03beb72ad865d1050190471e860ea
--- a/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/DependInfo.cmake
+++ b/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/DependInfo.cmake
@@ -4,22 +4,27 @@ SET(CMAKE_DEPENDS_LANGUAGES
   )
 # The set of files for implicit dependencies of each language:
 SET(CMAKE_DEPENDS_CHECK_CXX
-  "/tmp/liblas-main/test/unit/common.cpp" "/tmp/liblas-main/test/unit/CMakeFiles/liblas_test.dir/common.cpp.o"
-  "/tmp/liblas-main/test/unit/guid_test.cpp" "/tmp/liblas-main/test/unit/CMakeFiles/liblas_test.dir/guid_test.cpp.o"
-  "/tmp/liblas-main/test/unit/lasbounds_test.cpp" "/tmp/liblas-main/test/unit/CMakeFiles/liblas_test.dir/lasbounds_test.cpp.o"
-  "/tmp/liblas-main/test/unit/laserror_test.cpp" "/tmp/liblas-main/test/unit/CMakeFiles/liblas_test.dir/laserror_test.cpp.o"
-  "/tmp/liblas-main/test/unit/lasheader_test.cpp" "/tmp/liblas-main/test/unit/CMakeFiles/liblas_test.dir/lasheader_test.cpp.o"
-  "/tmp/liblas-main/test/unit/laspoint_test.cpp" "/tmp/liblas-main/test/unit/CMakeFiles/liblas_test.dir/laspoint_test.cpp.o"
-  "/tmp/liblas-main/test/unit/lasreader_iterator_test.cpp" "/tmp/liblas-main/test/unit/CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.o"
-  "/tmp/liblas-main/test/unit/lasreader_test.cpp" "/tmp/liblas-main/test/unit/CMakeFiles/liblas_test.dir/lasreader_test.cpp.o"
-  "/tmp/liblas-main/test/unit/lasspatialreference_test.cpp" "/tmp/liblas-main/test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.o"
-  "/tmp/liblas-main/test/unit/lasvariablerecord_test.cpp" "/tmp/liblas-main/test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.o"
-  "/tmp/liblas-main/test/unit/laswriter_test.cpp" "/tmp/liblas-main/test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.o"
-  "/tmp/liblas-main/test/unit/liblas_test_suite.cpp" "/tmp/liblas-main/test/unit/CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.o"
+  "/tmp/liblas/test/unit/common.cpp" "/tmp/liblas/test/unit/CMakeFiles/liblas_test.dir/common.cpp.o"
+  "/tmp/liblas/test/unit/guid_test.cpp" "/tmp/liblas/test/unit/CMakeFiles/liblas_test.dir/guid_test.cpp.o"
+  "/tmp/liblas/test/unit/lasbounds_test.cpp" "/tmp/liblas/test/unit/CMakeFiles/liblas_test.dir/lasbounds_test.cpp.o"
+  "/tmp/liblas/test/unit/laserror_test.cpp" "/tmp/liblas/test/unit/CMakeFiles/liblas_test.dir/laserror_test.cpp.o"
+  "/tmp/liblas/test/unit/lasheader_test.cpp" "/tmp/liblas/test/unit/CMakeFiles/liblas_test.dir/lasheader_test.cpp.o"
+  "/tmp/liblas/test/unit/laspoint_test.cpp" "/tmp/liblas/test/unit/CMakeFiles/liblas_test.dir/laspoint_test.cpp.o"
+  "/tmp/liblas/test/unit/lasreader_iterator_test.cpp" "/tmp/liblas/test/unit/CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.o"
+  "/tmp/liblas/test/unit/lasreader_test.cpp" "/tmp/liblas/test/unit/CMakeFiles/liblas_test.dir/lasreader_test.cpp.o"
+  "/tmp/liblas/test/unit/lasspatialreference_test.cpp" "/tmp/liblas/test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.o"
+  "/tmp/liblas/test/unit/lasvariablerecord_test.cpp" "/tmp/liblas/test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.o"
+  "/tmp/liblas/test/unit/laswriter_test.cpp" "/tmp/liblas/test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.o"
+  "/tmp/liblas/test/unit/liblas_test_suite.cpp" "/tmp/liblas/test/unit/CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.o"
   )
 SET(CMAKE_CXX_COMPILER_ID "GNU")
 
+# Preprocessor definitions for this target.
+SET(CMAKE_TARGET_DEFINITIONS
+  "LAS_DLL_IMPORT"
+  )
+
 # Targets to which this target links.
 SET(CMAKE_TARGET_LINKED_INFO_FILES
-  "/tmp/liblas-main/src/CMakeFiles/las.dir/DependInfo.cmake"
+  "/tmp/liblas/src/CMakeFiles/las.dir/DependInfo.cmake"
   )
diff --git a/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/build.make b/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/build.make
old mode 100755
new mode 100644
index d71bdf6ef2953ab55ffd6d3be33e9c4a1e4ed1fa..14d83a09238b5f73c578b7cce5597677ef7d5e04
--- a/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/build.make
+++ b/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/build.make
@@ -35,10 +35,10 @@ RM = "/Applications/CMake 2.8-0.app/Contents/bin/cmake" -E remove -f
 CMAKE_EDIT_COMMAND = "/Applications/CMake 2.8-0.app/Contents/bin/ccmake"
 
 # The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /tmp/liblas-main
+CMAKE_SOURCE_DIR = /tmp/liblas
 
 # The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /tmp/liblas-main
+CMAKE_BINARY_DIR = /tmp/liblas
 
 # Include any dependencies generated for this target.
 include test/unit/CMakeFiles/liblas_test.dir/depend.make
@@ -51,17 +51,17 @@ include test/unit/CMakeFiles/liblas_test.dir/flags.make
 
 test/unit/CMakeFiles/liblas_test.dir/common.cpp.o: test/unit/CMakeFiles/liblas_test.dir/flags.make
 test/unit/CMakeFiles/liblas_test.dir/common.cpp.o: test/unit/common.cpp
-	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas-main/CMakeFiles $(CMAKE_PROGRESS_1)
+	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas/CMakeFiles $(CMAKE_PROGRESS_1)
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object test/unit/CMakeFiles/liblas_test.dir/common.cpp.o"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/common.cpp.o -c /tmp/liblas-main/test/unit/common.cpp
+	cd /tmp/liblas/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/common.cpp.o -c /tmp/liblas/test/unit/common.cpp
 
 test/unit/CMakeFiles/liblas_test.dir/common.cpp.i: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/liblas_test.dir/common.cpp.i"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas-main/test/unit/common.cpp > CMakeFiles/liblas_test.dir/common.cpp.i
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas/test/unit/common.cpp > CMakeFiles/liblas_test.dir/common.cpp.i
 
 test/unit/CMakeFiles/liblas_test.dir/common.cpp.s: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/liblas_test.dir/common.cpp.s"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas-main/test/unit/common.cpp -o CMakeFiles/liblas_test.dir/common.cpp.s
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas/test/unit/common.cpp -o CMakeFiles/liblas_test.dir/common.cpp.s
 
 test/unit/CMakeFiles/liblas_test.dir/common.cpp.o.requires:
 .PHONY : test/unit/CMakeFiles/liblas_test.dir/common.cpp.o.requires
@@ -75,17 +75,17 @@ test/unit/CMakeFiles/liblas_test.dir/common.cpp.o.provides.build: test/unit/CMak
 
 test/unit/CMakeFiles/liblas_test.dir/guid_test.cpp.o: test/unit/CMakeFiles/liblas_test.dir/flags.make
 test/unit/CMakeFiles/liblas_test.dir/guid_test.cpp.o: test/unit/guid_test.cpp
-	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas-main/CMakeFiles $(CMAKE_PROGRESS_2)
+	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas/CMakeFiles $(CMAKE_PROGRESS_2)
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object test/unit/CMakeFiles/liblas_test.dir/guid_test.cpp.o"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/guid_test.cpp.o -c /tmp/liblas-main/test/unit/guid_test.cpp
+	cd /tmp/liblas/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/guid_test.cpp.o -c /tmp/liblas/test/unit/guid_test.cpp
 
 test/unit/CMakeFiles/liblas_test.dir/guid_test.cpp.i: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/liblas_test.dir/guid_test.cpp.i"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas-main/test/unit/guid_test.cpp > CMakeFiles/liblas_test.dir/guid_test.cpp.i
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas/test/unit/guid_test.cpp > CMakeFiles/liblas_test.dir/guid_test.cpp.i
 
 test/unit/CMakeFiles/liblas_test.dir/guid_test.cpp.s: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/liblas_test.dir/guid_test.cpp.s"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas-main/test/unit/guid_test.cpp -o CMakeFiles/liblas_test.dir/guid_test.cpp.s
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas/test/unit/guid_test.cpp -o CMakeFiles/liblas_test.dir/guid_test.cpp.s
 
 test/unit/CMakeFiles/liblas_test.dir/guid_test.cpp.o.requires:
 .PHONY : test/unit/CMakeFiles/liblas_test.dir/guid_test.cpp.o.requires
@@ -99,17 +99,17 @@ test/unit/CMakeFiles/liblas_test.dir/guid_test.cpp.o.provides.build: test/unit/C
 
 test/unit/CMakeFiles/liblas_test.dir/lasbounds_test.cpp.o: test/unit/CMakeFiles/liblas_test.dir/flags.make
 test/unit/CMakeFiles/liblas_test.dir/lasbounds_test.cpp.o: test/unit/lasbounds_test.cpp
-	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas-main/CMakeFiles $(CMAKE_PROGRESS_3)
+	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas/CMakeFiles $(CMAKE_PROGRESS_3)
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object test/unit/CMakeFiles/liblas_test.dir/lasbounds_test.cpp.o"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/lasbounds_test.cpp.o -c /tmp/liblas-main/test/unit/lasbounds_test.cpp
+	cd /tmp/liblas/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/lasbounds_test.cpp.o -c /tmp/liblas/test/unit/lasbounds_test.cpp
 
 test/unit/CMakeFiles/liblas_test.dir/lasbounds_test.cpp.i: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/liblas_test.dir/lasbounds_test.cpp.i"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas-main/test/unit/lasbounds_test.cpp > CMakeFiles/liblas_test.dir/lasbounds_test.cpp.i
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas/test/unit/lasbounds_test.cpp > CMakeFiles/liblas_test.dir/lasbounds_test.cpp.i
 
 test/unit/CMakeFiles/liblas_test.dir/lasbounds_test.cpp.s: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/liblas_test.dir/lasbounds_test.cpp.s"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas-main/test/unit/lasbounds_test.cpp -o CMakeFiles/liblas_test.dir/lasbounds_test.cpp.s
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas/test/unit/lasbounds_test.cpp -o CMakeFiles/liblas_test.dir/lasbounds_test.cpp.s
 
 test/unit/CMakeFiles/liblas_test.dir/lasbounds_test.cpp.o.requires:
 .PHONY : test/unit/CMakeFiles/liblas_test.dir/lasbounds_test.cpp.o.requires
@@ -123,17 +123,17 @@ test/unit/CMakeFiles/liblas_test.dir/lasbounds_test.cpp.o.provides.build: test/u
 
 test/unit/CMakeFiles/liblas_test.dir/laserror_test.cpp.o: test/unit/CMakeFiles/liblas_test.dir/flags.make
 test/unit/CMakeFiles/liblas_test.dir/laserror_test.cpp.o: test/unit/laserror_test.cpp
-	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas-main/CMakeFiles $(CMAKE_PROGRESS_4)
+	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas/CMakeFiles $(CMAKE_PROGRESS_4)
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object test/unit/CMakeFiles/liblas_test.dir/laserror_test.cpp.o"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/laserror_test.cpp.o -c /tmp/liblas-main/test/unit/laserror_test.cpp
+	cd /tmp/liblas/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/laserror_test.cpp.o -c /tmp/liblas/test/unit/laserror_test.cpp
 
 test/unit/CMakeFiles/liblas_test.dir/laserror_test.cpp.i: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/liblas_test.dir/laserror_test.cpp.i"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas-main/test/unit/laserror_test.cpp > CMakeFiles/liblas_test.dir/laserror_test.cpp.i
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas/test/unit/laserror_test.cpp > CMakeFiles/liblas_test.dir/laserror_test.cpp.i
 
 test/unit/CMakeFiles/liblas_test.dir/laserror_test.cpp.s: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/liblas_test.dir/laserror_test.cpp.s"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas-main/test/unit/laserror_test.cpp -o CMakeFiles/liblas_test.dir/laserror_test.cpp.s
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas/test/unit/laserror_test.cpp -o CMakeFiles/liblas_test.dir/laserror_test.cpp.s
 
 test/unit/CMakeFiles/liblas_test.dir/laserror_test.cpp.o.requires:
 .PHONY : test/unit/CMakeFiles/liblas_test.dir/laserror_test.cpp.o.requires
@@ -147,17 +147,17 @@ test/unit/CMakeFiles/liblas_test.dir/laserror_test.cpp.o.provides.build: test/un
 
 test/unit/CMakeFiles/liblas_test.dir/lasheader_test.cpp.o: test/unit/CMakeFiles/liblas_test.dir/flags.make
 test/unit/CMakeFiles/liblas_test.dir/lasheader_test.cpp.o: test/unit/lasheader_test.cpp
-	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas-main/CMakeFiles $(CMAKE_PROGRESS_5)
+	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas/CMakeFiles $(CMAKE_PROGRESS_5)
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object test/unit/CMakeFiles/liblas_test.dir/lasheader_test.cpp.o"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/lasheader_test.cpp.o -c /tmp/liblas-main/test/unit/lasheader_test.cpp
+	cd /tmp/liblas/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/lasheader_test.cpp.o -c /tmp/liblas/test/unit/lasheader_test.cpp
 
 test/unit/CMakeFiles/liblas_test.dir/lasheader_test.cpp.i: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/liblas_test.dir/lasheader_test.cpp.i"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas-main/test/unit/lasheader_test.cpp > CMakeFiles/liblas_test.dir/lasheader_test.cpp.i
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas/test/unit/lasheader_test.cpp > CMakeFiles/liblas_test.dir/lasheader_test.cpp.i
 
 test/unit/CMakeFiles/liblas_test.dir/lasheader_test.cpp.s: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/liblas_test.dir/lasheader_test.cpp.s"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas-main/test/unit/lasheader_test.cpp -o CMakeFiles/liblas_test.dir/lasheader_test.cpp.s
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas/test/unit/lasheader_test.cpp -o CMakeFiles/liblas_test.dir/lasheader_test.cpp.s
 
 test/unit/CMakeFiles/liblas_test.dir/lasheader_test.cpp.o.requires:
 .PHONY : test/unit/CMakeFiles/liblas_test.dir/lasheader_test.cpp.o.requires
@@ -171,17 +171,17 @@ test/unit/CMakeFiles/liblas_test.dir/lasheader_test.cpp.o.provides.build: test/u
 
 test/unit/CMakeFiles/liblas_test.dir/laspoint_test.cpp.o: test/unit/CMakeFiles/liblas_test.dir/flags.make
 test/unit/CMakeFiles/liblas_test.dir/laspoint_test.cpp.o: test/unit/laspoint_test.cpp
-	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas-main/CMakeFiles $(CMAKE_PROGRESS_6)
+	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas/CMakeFiles $(CMAKE_PROGRESS_6)
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object test/unit/CMakeFiles/liblas_test.dir/laspoint_test.cpp.o"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/laspoint_test.cpp.o -c /tmp/liblas-main/test/unit/laspoint_test.cpp
+	cd /tmp/liblas/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/laspoint_test.cpp.o -c /tmp/liblas/test/unit/laspoint_test.cpp
 
 test/unit/CMakeFiles/liblas_test.dir/laspoint_test.cpp.i: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/liblas_test.dir/laspoint_test.cpp.i"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas-main/test/unit/laspoint_test.cpp > CMakeFiles/liblas_test.dir/laspoint_test.cpp.i
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas/test/unit/laspoint_test.cpp > CMakeFiles/liblas_test.dir/laspoint_test.cpp.i
 
 test/unit/CMakeFiles/liblas_test.dir/laspoint_test.cpp.s: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/liblas_test.dir/laspoint_test.cpp.s"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas-main/test/unit/laspoint_test.cpp -o CMakeFiles/liblas_test.dir/laspoint_test.cpp.s
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas/test/unit/laspoint_test.cpp -o CMakeFiles/liblas_test.dir/laspoint_test.cpp.s
 
 test/unit/CMakeFiles/liblas_test.dir/laspoint_test.cpp.o.requires:
 .PHONY : test/unit/CMakeFiles/liblas_test.dir/laspoint_test.cpp.o.requires
@@ -195,17 +195,17 @@ test/unit/CMakeFiles/liblas_test.dir/laspoint_test.cpp.o.provides.build: test/un
 
 test/unit/CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.o: test/unit/CMakeFiles/liblas_test.dir/flags.make
 test/unit/CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.o: test/unit/lasreader_iterator_test.cpp
-	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas-main/CMakeFiles $(CMAKE_PROGRESS_7)
+	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas/CMakeFiles $(CMAKE_PROGRESS_7)
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object test/unit/CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.o"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.o -c /tmp/liblas-main/test/unit/lasreader_iterator_test.cpp
+	cd /tmp/liblas/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.o -c /tmp/liblas/test/unit/lasreader_iterator_test.cpp
 
 test/unit/CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.i: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.i"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas-main/test/unit/lasreader_iterator_test.cpp > CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.i
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas/test/unit/lasreader_iterator_test.cpp > CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.i
 
 test/unit/CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.s: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.s"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas-main/test/unit/lasreader_iterator_test.cpp -o CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.s
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas/test/unit/lasreader_iterator_test.cpp -o CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.s
 
 test/unit/CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.o.requires:
 .PHONY : test/unit/CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.o.requires
@@ -219,17 +219,17 @@ test/unit/CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.o.provides.buil
 
 test/unit/CMakeFiles/liblas_test.dir/lasreader_test.cpp.o: test/unit/CMakeFiles/liblas_test.dir/flags.make
 test/unit/CMakeFiles/liblas_test.dir/lasreader_test.cpp.o: test/unit/lasreader_test.cpp
-	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas-main/CMakeFiles $(CMAKE_PROGRESS_8)
+	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas/CMakeFiles $(CMAKE_PROGRESS_8)
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object test/unit/CMakeFiles/liblas_test.dir/lasreader_test.cpp.o"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/lasreader_test.cpp.o -c /tmp/liblas-main/test/unit/lasreader_test.cpp
+	cd /tmp/liblas/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/lasreader_test.cpp.o -c /tmp/liblas/test/unit/lasreader_test.cpp
 
 test/unit/CMakeFiles/liblas_test.dir/lasreader_test.cpp.i: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/liblas_test.dir/lasreader_test.cpp.i"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas-main/test/unit/lasreader_test.cpp > CMakeFiles/liblas_test.dir/lasreader_test.cpp.i
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas/test/unit/lasreader_test.cpp > CMakeFiles/liblas_test.dir/lasreader_test.cpp.i
 
 test/unit/CMakeFiles/liblas_test.dir/lasreader_test.cpp.s: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/liblas_test.dir/lasreader_test.cpp.s"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas-main/test/unit/lasreader_test.cpp -o CMakeFiles/liblas_test.dir/lasreader_test.cpp.s
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas/test/unit/lasreader_test.cpp -o CMakeFiles/liblas_test.dir/lasreader_test.cpp.s
 
 test/unit/CMakeFiles/liblas_test.dir/lasreader_test.cpp.o.requires:
 .PHONY : test/unit/CMakeFiles/liblas_test.dir/lasreader_test.cpp.o.requires
@@ -243,17 +243,17 @@ test/unit/CMakeFiles/liblas_test.dir/lasreader_test.cpp.o.provides.build: test/u
 
 test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.o: test/unit/CMakeFiles/liblas_test.dir/flags.make
 test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.o: test/unit/lasspatialreference_test.cpp
-	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas-main/CMakeFiles $(CMAKE_PROGRESS_9)
+	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas/CMakeFiles $(CMAKE_PROGRESS_9)
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.o"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.o -c /tmp/liblas-main/test/unit/lasspatialreference_test.cpp
+	cd /tmp/liblas/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.o -c /tmp/liblas/test/unit/lasspatialreference_test.cpp
 
 test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.i: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.i"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas-main/test/unit/lasspatialreference_test.cpp > CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.i
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas/test/unit/lasspatialreference_test.cpp > CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.i
 
 test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.s: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.s"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas-main/test/unit/lasspatialreference_test.cpp -o CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.s
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas/test/unit/lasspatialreference_test.cpp -o CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.s
 
 test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.o.requires:
 .PHONY : test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.o.requires
@@ -267,17 +267,17 @@ test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.o.provides.bui
 
 test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.o: test/unit/CMakeFiles/liblas_test.dir/flags.make
 test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.o: test/unit/lasvariablerecord_test.cpp
-	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas-main/CMakeFiles $(CMAKE_PROGRESS_10)
+	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas/CMakeFiles $(CMAKE_PROGRESS_10)
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.o"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.o -c /tmp/liblas-main/test/unit/lasvariablerecord_test.cpp
+	cd /tmp/liblas/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.o -c /tmp/liblas/test/unit/lasvariablerecord_test.cpp
 
 test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.i: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.i"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas-main/test/unit/lasvariablerecord_test.cpp > CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.i
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas/test/unit/lasvariablerecord_test.cpp > CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.i
 
 test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.s: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.s"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas-main/test/unit/lasvariablerecord_test.cpp -o CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.s
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas/test/unit/lasvariablerecord_test.cpp -o CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.s
 
 test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.o.requires:
 .PHONY : test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.o.requires
@@ -291,17 +291,17 @@ test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.o.provides.build
 
 test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.o: test/unit/CMakeFiles/liblas_test.dir/flags.make
 test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.o: test/unit/laswriter_test.cpp
-	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas-main/CMakeFiles $(CMAKE_PROGRESS_11)
+	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas/CMakeFiles $(CMAKE_PROGRESS_11)
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.o"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/laswriter_test.cpp.o -c /tmp/liblas-main/test/unit/laswriter_test.cpp
+	cd /tmp/liblas/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/laswriter_test.cpp.o -c /tmp/liblas/test/unit/laswriter_test.cpp
 
 test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.i: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/liblas_test.dir/laswriter_test.cpp.i"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas-main/test/unit/laswriter_test.cpp > CMakeFiles/liblas_test.dir/laswriter_test.cpp.i
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas/test/unit/laswriter_test.cpp > CMakeFiles/liblas_test.dir/laswriter_test.cpp.i
 
 test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.s: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/liblas_test.dir/laswriter_test.cpp.s"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas-main/test/unit/laswriter_test.cpp -o CMakeFiles/liblas_test.dir/laswriter_test.cpp.s
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas/test/unit/laswriter_test.cpp -o CMakeFiles/liblas_test.dir/laswriter_test.cpp.s
 
 test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.o.requires:
 .PHONY : test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.o.requires
@@ -315,17 +315,17 @@ test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.o.provides.build: test/u
 
 test/unit/CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.o: test/unit/CMakeFiles/liblas_test.dir/flags.make
 test/unit/CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.o: test/unit/liblas_test_suite.cpp
-	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas-main/CMakeFiles $(CMAKE_PROGRESS_12)
+	$(CMAKE_COMMAND) -E cmake_progress_report /tmp/liblas/CMakeFiles $(CMAKE_PROGRESS_12)
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object test/unit/CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.o"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.o -c /tmp/liblas-main/test/unit/liblas_test_suite.cpp
+	cd /tmp/liblas/test/unit && /usr/bin/c++   $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.o -c /tmp/liblas/test/unit/liblas_test_suite.cpp
 
 test/unit/CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.i: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.i"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas-main/test/unit/liblas_test_suite.cpp > CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.i
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -E /tmp/liblas/test/unit/liblas_test_suite.cpp > CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.i
 
 test/unit/CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.s: cmake_force
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.s"
-	cd /tmp/liblas-main/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas-main/test/unit/liblas_test_suite.cpp -o CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.s
+	cd /tmp/liblas/test/unit && /usr/bin/c++  $(CXX_DEFINES) $(CXX_FLAGS) -S /tmp/liblas/test/unit/liblas_test_suite.cpp -o CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.s
 
 test/unit/CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.o.requires:
 .PHONY : test/unit/CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.o.requires
@@ -367,11 +367,12 @@ bin/liblas_test: test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.c
 bin/liblas_test: test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.o
 bin/liblas_test: test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.o
 bin/liblas_test: test/unit/CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.o
-bin/liblas_test: bin/liblas.a
+bin/liblas_test: bin/liblas.dylib
+bin/liblas_test: /usr/local/lib/libboost_program_options.a
 bin/liblas_test: test/unit/CMakeFiles/liblas_test.dir/build.make
 bin/liblas_test: test/unit/CMakeFiles/liblas_test.dir/link.txt
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --red --bold "Linking CXX executable ../../bin/liblas_test"
-	cd /tmp/liblas-main/test/unit && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/liblas_test.dir/link.txt --verbose=$(VERBOSE)
+	cd /tmp/liblas/test/unit && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/liblas_test.dir/link.txt --verbose=$(VERBOSE)
 
 # Rule to build all files generated by this target.
 test/unit/CMakeFiles/liblas_test.dir/build: bin/liblas_test
@@ -392,10 +393,10 @@ test/unit/CMakeFiles/liblas_test.dir/requires: test/unit/CMakeFiles/liblas_test.
 .PHONY : test/unit/CMakeFiles/liblas_test.dir/requires
 
 test/unit/CMakeFiles/liblas_test.dir/clean:
-	cd /tmp/liblas-main/test/unit && $(CMAKE_COMMAND) -P CMakeFiles/liblas_test.dir/cmake_clean.cmake
+	cd /tmp/liblas/test/unit && $(CMAKE_COMMAND) -P CMakeFiles/liblas_test.dir/cmake_clean.cmake
 .PHONY : test/unit/CMakeFiles/liblas_test.dir/clean
 
 test/unit/CMakeFiles/liblas_test.dir/depend:
-	cd /tmp/liblas-main && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /tmp/liblas-main /tmp/liblas-main/test/unit /tmp/liblas-main /tmp/liblas-main/test/unit /tmp/liblas-main/test/unit/CMakeFiles/liblas_test.dir/DependInfo.cmake --color=$(COLOR)
+	cd /tmp/liblas && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /tmp/liblas /tmp/liblas/test/unit /tmp/liblas /tmp/liblas/test/unit /tmp/liblas/test/unit/CMakeFiles/liblas_test.dir/DependInfo.cmake --color=$(COLOR)
 .PHONY : test/unit/CMakeFiles/liblas_test.dir/depend
 
diff --git a/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/cmake_clean.cmake b/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/cmake_clean.cmake
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/depend.make b/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/depend.make
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/flags.make b/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/flags.make
old mode 100755
new mode 100644
index fa7ca4cb0caf49c575951dc129867583e9f3688c..b7b5de938c96fb33b33f50afc137fb6519b8725a
--- a/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/flags.make
+++ b/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/flags.make
@@ -2,7 +2,7 @@
 # Generated by "Unix Makefiles" Generator, CMake Version 2.8
 
 # compile CXX with /usr/bin/c++
-CXX_FLAGS =  -mmacosx-version-min=10.6  -fPIC -Wall -Wno-long-long -ansi -std=c++98 -I/tmp/liblas-main/test/unit/. -I/tmp/liblas-main/test/unit/../../include -I/usr/local/include  
+CXX_FLAGS =  -mmacosx-version-min=10.6  -fPIC -pedantic -ansi -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wfloat-equal -Wredundant-decls -Wno-long-long -std=c++98 -I/tmp/liblas/test/unit/. -I/tmp/liblas/test/unit/../../include -I/usr/local/include  
 
-CXX_DEFINES = 
+CXX_DEFINES = -DLAS_DLL_IMPORT
 
diff --git a/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/link.txt b/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/link.txt
old mode 100755
new mode 100644
index cf6fb9512c6a09f3f5171822f31ed8d814a3dfdc..f5be7d8e324abd9021b4d883342f879aed8304b2
--- a/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/link.txt
+++ b/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/link.txt
@@ -1 +1 @@
-/usr/bin/c++    -mmacosx-version-min=10.6  -fPIC -Wall -Wno-long-long -ansi -std=c++98 -Wl,-search_paths_first -headerpad_max_install_names  CMakeFiles/liblas_test.dir/common.cpp.o CMakeFiles/liblas_test.dir/guid_test.cpp.o CMakeFiles/liblas_test.dir/lasbounds_test.cpp.o CMakeFiles/liblas_test.dir/laserror_test.cpp.o CMakeFiles/liblas_test.dir/lasheader_test.cpp.o CMakeFiles/liblas_test.dir/laspoint_test.cpp.o CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.o CMakeFiles/liblas_test.dir/lasreader_test.cpp.o CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.o CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.o CMakeFiles/liblas_test.dir/laswriter_test.cpp.o CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.o  -o ../../bin/liblas_test  -L/usr/local/lib ../../bin/liblas.a 
+/usr/bin/c++    -mmacosx-version-min=10.6  -fPIC -pedantic -ansi -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wfloat-equal -Wredundant-decls -Wno-long-long -std=c++98 -Wl,-search_paths_first -headerpad_max_install_names  CMakeFiles/liblas_test.dir/common.cpp.o CMakeFiles/liblas_test.dir/guid_test.cpp.o CMakeFiles/liblas_test.dir/lasbounds_test.cpp.o CMakeFiles/liblas_test.dir/laserror_test.cpp.o CMakeFiles/liblas_test.dir/lasheader_test.cpp.o CMakeFiles/liblas_test.dir/laspoint_test.cpp.o CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.o CMakeFiles/liblas_test.dir/lasreader_test.cpp.o CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.o CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.o CMakeFiles/liblas_test.dir/laswriter_test.cpp.o CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.o  -o ../../bin/liblas_test  -L/usr/local/lib ../../bin/liblas.dylib /usr/local/lib/libboost_program_options.a 
diff --git a/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/progress.make b/Utilities/otbliblas/test/unit/CMakeFiles/liblas_test.dir/progress.make
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/CMakeFiles/progress.marks b/Utilities/otbliblas/test/unit/CMakeFiles/progress.marks
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/CMakeLists.txt b/Utilities/otbliblas/test/unit/CMakeLists.txt
old mode 100755
new mode 100644
index 1c36680a44090a50f03b78b82c168eedf0130a21..2dc84e1f16271bbf35d4d30cc39a176b586995a7
--- a/Utilities/otbliblas/test/unit/CMakeLists.txt
+++ b/Utilities/otbliblas/test/unit/CMakeLists.txt
@@ -27,7 +27,9 @@ INCLUDE_DIRECTORIES(
     ${GDAL_INCLUDE_DIR}
     ${GEOTIFF_INCLUDE_DIR})
 
-ADD_EXECUTABLE(${LIBLAS_UNIT_TEST} ${LIBLAS_UNIT_TEST_SRC})
+ADD_EXECUTABLE(${LIBLAS_UNIT_TEST} ${LIBLAS_UNIT_TEST_SRC} )
+
+set_target_properties(${LIBLAS_UNIT_TEST} PROPERTIES COMPILE_DEFINITIONS LAS_DLL_IMPORT)
 
 TARGET_LINK_LIBRARIES(${LIBLAS_UNIT_TEST} 
     ${LIBLAS_LIB_NAME}
diff --git a/Utilities/otbliblas/test/unit/CTestTestfile.cmake b/Utilities/otbliblas/test/unit/CTestTestfile.cmake
old mode 100755
new mode 100644
index 56a0847be63e4cb5658c13120989f4387c461c22..0dd13def98a6e05e685b0bc5844a8770d1af1cf0
--- a/Utilities/otbliblas/test/unit/CTestTestfile.cmake
+++ b/Utilities/otbliblas/test/unit/CTestTestfile.cmake
@@ -1,7 +1,7 @@
 # CMake generated Testfile for 
-# Source directory: /tmp/liblas-main/test/unit
-# Build directory: /tmp/liblas-main/test/unit
+# Source directory: /tmp/liblas/test/unit
+# Build directory: /tmp/liblas/test/unit
 # 
 # This file includes the relevent testing commands required for 
 # testing this directory and lists subdirectories to be tested as well.
-ADD_TEST(liblas_test "/tmp/liblas-main/bin/liblas_test" "/tmp/liblas-main/test/data")
+ADD_TEST(liblas_test "/tmp/liblas/bin/liblas_test" "/tmp/liblas/test/data")
diff --git a/Utilities/otbliblas/test/unit/Makefile b/Utilities/otbliblas/test/unit/Makefile
index 4d9b11fb2765358d5e8c8597976ba01e65bf7266..98ab4c7d20041cb4060ae027c982d12a370da241 100755
--- a/Utilities/otbliblas/test/unit/Makefile
+++ b/Utilities/otbliblas/test/unit/Makefile
@@ -39,10 +39,10 @@ RM = "/Applications/CMake 2.8-0.app/Contents/bin/cmake" -E remove -f
 CMAKE_EDIT_COMMAND = "/Applications/CMake 2.8-0.app/Contents/bin/ccmake"
 
 # The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /tmp/liblas-main
+CMAKE_SOURCE_DIR = /tmp/liblas
 
 # The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /tmp/liblas-main
+CMAKE_BINARY_DIR = /tmp/liblas
 
 #=============================================================================
 # Targets provided globally by CMake.
@@ -101,7 +101,7 @@ list_install_components/fast: list_install_components
 # Special rule for the target package
 package: preinstall
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool..."
-	cd /tmp/liblas-main && "/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackConfig.cmake
+	cd /tmp/liblas && "/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackConfig.cmake
 .PHONY : package
 
 # Special rule for the target package
@@ -111,7 +111,7 @@ package/fast: package
 # Special rule for the target package_source
 package_source:
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool for source..."
-	cd /tmp/liblas-main && "/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackSourceConfig.cmake /tmp/liblas-main/CPackSourceConfig.cmake
+	cd /tmp/liblas && "/Applications/CMake 2.8-0.app/Contents/bin/cpack" --config ./CPackSourceConfig.cmake /tmp/liblas/CPackSourceConfig.cmake
 .PHONY : package_source
 
 # Special rule for the target package_source
@@ -140,14 +140,14 @@ test/fast: test
 
 # The main all target
 all: cmake_check_build_system
-	cd /tmp/liblas-main && $(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas-main/CMakeFiles /tmp/liblas-main/test/unit/CMakeFiles/progress.marks
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 test/unit/all
-	$(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas-main/CMakeFiles 0
+	cd /tmp/liblas && $(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas/CMakeFiles /tmp/liblas/test/unit/CMakeFiles/progress.marks
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 test/unit/all
+	$(CMAKE_COMMAND) -E cmake_progress_start /tmp/liblas/CMakeFiles 0
 .PHONY : all
 
 # The main clean target
 clean:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 test/unit/clean
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 test/unit/clean
 .PHONY : clean
 
 # The main clean target
@@ -156,22 +156,22 @@ clean/fast: clean
 
 # Prepare targets for installation.
 preinstall: all
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 test/unit/preinstall
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 test/unit/preinstall
 .PHONY : preinstall
 
 # Prepare targets for installation.
 preinstall/fast:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 test/unit/preinstall
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 test/unit/preinstall
 .PHONY : preinstall/fast
 
 # clear depends
 depend:
-	cd /tmp/liblas-main && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
+	cd /tmp/liblas && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
 .PHONY : depend
 
 # Convenience name for target.
 test/unit/CMakeFiles/liblas_test.dir/rule:
-	cd /tmp/liblas-main && $(MAKE) -f CMakeFiles/Makefile2 test/unit/CMakeFiles/liblas_test.dir/rule
+	cd /tmp/liblas && $(MAKE) -f CMakeFiles/Makefile2 test/unit/CMakeFiles/liblas_test.dir/rule
 .PHONY : test/unit/CMakeFiles/liblas_test.dir/rule
 
 # Convenience name for target.
@@ -180,7 +180,7 @@ liblas_test: test/unit/CMakeFiles/liblas_test.dir/rule
 
 # fast build rule for target.
 liblas_test/fast:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/build
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/build
 .PHONY : liblas_test/fast
 
 common.o: common.cpp.o
@@ -188,7 +188,7 @@ common.o: common.cpp.o
 
 # target to build an object file
 common.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/common.cpp.o
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/common.cpp.o
 .PHONY : common.cpp.o
 
 common.i: common.cpp.i
@@ -196,7 +196,7 @@ common.i: common.cpp.i
 
 # target to preprocess a source file
 common.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/common.cpp.i
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/common.cpp.i
 .PHONY : common.cpp.i
 
 common.s: common.cpp.s
@@ -204,7 +204,7 @@ common.s: common.cpp.s
 
 # target to generate assembly for a file
 common.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/common.cpp.s
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/common.cpp.s
 .PHONY : common.cpp.s
 
 guid_test.o: guid_test.cpp.o
@@ -212,7 +212,7 @@ guid_test.o: guid_test.cpp.o
 
 # target to build an object file
 guid_test.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/guid_test.cpp.o
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/guid_test.cpp.o
 .PHONY : guid_test.cpp.o
 
 guid_test.i: guid_test.cpp.i
@@ -220,7 +220,7 @@ guid_test.i: guid_test.cpp.i
 
 # target to preprocess a source file
 guid_test.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/guid_test.cpp.i
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/guid_test.cpp.i
 .PHONY : guid_test.cpp.i
 
 guid_test.s: guid_test.cpp.s
@@ -228,7 +228,7 @@ guid_test.s: guid_test.cpp.s
 
 # target to generate assembly for a file
 guid_test.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/guid_test.cpp.s
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/guid_test.cpp.s
 .PHONY : guid_test.cpp.s
 
 lasbounds_test.o: lasbounds_test.cpp.o
@@ -236,7 +236,7 @@ lasbounds_test.o: lasbounds_test.cpp.o
 
 # target to build an object file
 lasbounds_test.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasbounds_test.cpp.o
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasbounds_test.cpp.o
 .PHONY : lasbounds_test.cpp.o
 
 lasbounds_test.i: lasbounds_test.cpp.i
@@ -244,7 +244,7 @@ lasbounds_test.i: lasbounds_test.cpp.i
 
 # target to preprocess a source file
 lasbounds_test.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasbounds_test.cpp.i
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasbounds_test.cpp.i
 .PHONY : lasbounds_test.cpp.i
 
 lasbounds_test.s: lasbounds_test.cpp.s
@@ -252,7 +252,7 @@ lasbounds_test.s: lasbounds_test.cpp.s
 
 # target to generate assembly for a file
 lasbounds_test.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasbounds_test.cpp.s
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasbounds_test.cpp.s
 .PHONY : lasbounds_test.cpp.s
 
 laserror_test.o: laserror_test.cpp.o
@@ -260,7 +260,7 @@ laserror_test.o: laserror_test.cpp.o
 
 # target to build an object file
 laserror_test.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laserror_test.cpp.o
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laserror_test.cpp.o
 .PHONY : laserror_test.cpp.o
 
 laserror_test.i: laserror_test.cpp.i
@@ -268,7 +268,7 @@ laserror_test.i: laserror_test.cpp.i
 
 # target to preprocess a source file
 laserror_test.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laserror_test.cpp.i
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laserror_test.cpp.i
 .PHONY : laserror_test.cpp.i
 
 laserror_test.s: laserror_test.cpp.s
@@ -276,7 +276,7 @@ laserror_test.s: laserror_test.cpp.s
 
 # target to generate assembly for a file
 laserror_test.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laserror_test.cpp.s
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laserror_test.cpp.s
 .PHONY : laserror_test.cpp.s
 
 lasheader_test.o: lasheader_test.cpp.o
@@ -284,7 +284,7 @@ lasheader_test.o: lasheader_test.cpp.o
 
 # target to build an object file
 lasheader_test.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasheader_test.cpp.o
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasheader_test.cpp.o
 .PHONY : lasheader_test.cpp.o
 
 lasheader_test.i: lasheader_test.cpp.i
@@ -292,7 +292,7 @@ lasheader_test.i: lasheader_test.cpp.i
 
 # target to preprocess a source file
 lasheader_test.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasheader_test.cpp.i
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasheader_test.cpp.i
 .PHONY : lasheader_test.cpp.i
 
 lasheader_test.s: lasheader_test.cpp.s
@@ -300,7 +300,7 @@ lasheader_test.s: lasheader_test.cpp.s
 
 # target to generate assembly for a file
 lasheader_test.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasheader_test.cpp.s
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasheader_test.cpp.s
 .PHONY : lasheader_test.cpp.s
 
 laspoint_test.o: laspoint_test.cpp.o
@@ -308,7 +308,7 @@ laspoint_test.o: laspoint_test.cpp.o
 
 # target to build an object file
 laspoint_test.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laspoint_test.cpp.o
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laspoint_test.cpp.o
 .PHONY : laspoint_test.cpp.o
 
 laspoint_test.i: laspoint_test.cpp.i
@@ -316,7 +316,7 @@ laspoint_test.i: laspoint_test.cpp.i
 
 # target to preprocess a source file
 laspoint_test.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laspoint_test.cpp.i
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laspoint_test.cpp.i
 .PHONY : laspoint_test.cpp.i
 
 laspoint_test.s: laspoint_test.cpp.s
@@ -324,7 +324,7 @@ laspoint_test.s: laspoint_test.cpp.s
 
 # target to generate assembly for a file
 laspoint_test.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laspoint_test.cpp.s
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laspoint_test.cpp.s
 .PHONY : laspoint_test.cpp.s
 
 lasreader_iterator_test.o: lasreader_iterator_test.cpp.o
@@ -332,7 +332,7 @@ lasreader_iterator_test.o: lasreader_iterator_test.cpp.o
 
 # target to build an object file
 lasreader_iterator_test.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.o
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.o
 .PHONY : lasreader_iterator_test.cpp.o
 
 lasreader_iterator_test.i: lasreader_iterator_test.cpp.i
@@ -340,7 +340,7 @@ lasreader_iterator_test.i: lasreader_iterator_test.cpp.i
 
 # target to preprocess a source file
 lasreader_iterator_test.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.i
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.i
 .PHONY : lasreader_iterator_test.cpp.i
 
 lasreader_iterator_test.s: lasreader_iterator_test.cpp.s
@@ -348,7 +348,7 @@ lasreader_iterator_test.s: lasreader_iterator_test.cpp.s
 
 # target to generate assembly for a file
 lasreader_iterator_test.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.s
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasreader_iterator_test.cpp.s
 .PHONY : lasreader_iterator_test.cpp.s
 
 lasreader_test.o: lasreader_test.cpp.o
@@ -356,7 +356,7 @@ lasreader_test.o: lasreader_test.cpp.o
 
 # target to build an object file
 lasreader_test.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasreader_test.cpp.o
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasreader_test.cpp.o
 .PHONY : lasreader_test.cpp.o
 
 lasreader_test.i: lasreader_test.cpp.i
@@ -364,7 +364,7 @@ lasreader_test.i: lasreader_test.cpp.i
 
 # target to preprocess a source file
 lasreader_test.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasreader_test.cpp.i
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasreader_test.cpp.i
 .PHONY : lasreader_test.cpp.i
 
 lasreader_test.s: lasreader_test.cpp.s
@@ -372,7 +372,7 @@ lasreader_test.s: lasreader_test.cpp.s
 
 # target to generate assembly for a file
 lasreader_test.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasreader_test.cpp.s
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasreader_test.cpp.s
 .PHONY : lasreader_test.cpp.s
 
 lasspatialreference_test.o: lasspatialreference_test.cpp.o
@@ -380,7 +380,7 @@ lasspatialreference_test.o: lasspatialreference_test.cpp.o
 
 # target to build an object file
 lasspatialreference_test.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.o
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.o
 .PHONY : lasspatialreference_test.cpp.o
 
 lasspatialreference_test.i: lasspatialreference_test.cpp.i
@@ -388,7 +388,7 @@ lasspatialreference_test.i: lasspatialreference_test.cpp.i
 
 # target to preprocess a source file
 lasspatialreference_test.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.i
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.i
 .PHONY : lasspatialreference_test.cpp.i
 
 lasspatialreference_test.s: lasspatialreference_test.cpp.s
@@ -396,7 +396,7 @@ lasspatialreference_test.s: lasspatialreference_test.cpp.s
 
 # target to generate assembly for a file
 lasspatialreference_test.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.s
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasspatialreference_test.cpp.s
 .PHONY : lasspatialreference_test.cpp.s
 
 lasvariablerecord_test.o: lasvariablerecord_test.cpp.o
@@ -404,7 +404,7 @@ lasvariablerecord_test.o: lasvariablerecord_test.cpp.o
 
 # target to build an object file
 lasvariablerecord_test.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.o
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.o
 .PHONY : lasvariablerecord_test.cpp.o
 
 lasvariablerecord_test.i: lasvariablerecord_test.cpp.i
@@ -412,7 +412,7 @@ lasvariablerecord_test.i: lasvariablerecord_test.cpp.i
 
 # target to preprocess a source file
 lasvariablerecord_test.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.i
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.i
 .PHONY : lasvariablerecord_test.cpp.i
 
 lasvariablerecord_test.s: lasvariablerecord_test.cpp.s
@@ -420,7 +420,7 @@ lasvariablerecord_test.s: lasvariablerecord_test.cpp.s
 
 # target to generate assembly for a file
 lasvariablerecord_test.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.s
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/lasvariablerecord_test.cpp.s
 .PHONY : lasvariablerecord_test.cpp.s
 
 laswriter_test.o: laswriter_test.cpp.o
@@ -428,7 +428,7 @@ laswriter_test.o: laswriter_test.cpp.o
 
 # target to build an object file
 laswriter_test.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.o
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.o
 .PHONY : laswriter_test.cpp.o
 
 laswriter_test.i: laswriter_test.cpp.i
@@ -436,7 +436,7 @@ laswriter_test.i: laswriter_test.cpp.i
 
 # target to preprocess a source file
 laswriter_test.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.i
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.i
 .PHONY : laswriter_test.cpp.i
 
 laswriter_test.s: laswriter_test.cpp.s
@@ -444,7 +444,7 @@ laswriter_test.s: laswriter_test.cpp.s
 
 # target to generate assembly for a file
 laswriter_test.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.s
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/laswriter_test.cpp.s
 .PHONY : laswriter_test.cpp.s
 
 liblas_test_suite.o: liblas_test_suite.cpp.o
@@ -452,7 +452,7 @@ liblas_test_suite.o: liblas_test_suite.cpp.o
 
 # target to build an object file
 liblas_test_suite.cpp.o:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.o
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.o
 .PHONY : liblas_test_suite.cpp.o
 
 liblas_test_suite.i: liblas_test_suite.cpp.i
@@ -460,7 +460,7 @@ liblas_test_suite.i: liblas_test_suite.cpp.i
 
 # target to preprocess a source file
 liblas_test_suite.cpp.i:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.i
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.i
 .PHONY : liblas_test_suite.cpp.i
 
 liblas_test_suite.s: liblas_test_suite.cpp.s
@@ -468,7 +468,7 @@ liblas_test_suite.s: liblas_test_suite.cpp.s
 
 # target to generate assembly for a file
 liblas_test_suite.cpp.s:
-	cd /tmp/liblas-main && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.s
+	cd /tmp/liblas && $(MAKE) -f test/unit/CMakeFiles/liblas_test.dir/build.make test/unit/CMakeFiles/liblas_test.dir/liblas_test_suite.cpp.s
 .PHONY : liblas_test_suite.cpp.s
 
 # Help Target
@@ -534,6 +534,6 @@ help:
 # No rule that depends on this can have commands that come from listfiles
 # because they might be regenerated.
 cmake_check_build_system:
-	cd /tmp/liblas-main && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
+	cd /tmp/liblas && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
 .PHONY : cmake_check_build_system
 
diff --git a/Utilities/otbliblas/test/unit/cmake_install.cmake b/Utilities/otbliblas/test/unit/cmake_install.cmake
old mode 100755
new mode 100644
index aebe9dac9ce53ae131b87dc044d73e6760d059bf..b966e497fa90321080488d0aa03f314dfa350f60
--- a/Utilities/otbliblas/test/unit/cmake_install.cmake
+++ b/Utilities/otbliblas/test/unit/cmake_install.cmake
@@ -1,4 +1,4 @@
-# Install script for directory: /tmp/liblas-main/test/unit
+# Install script for directory: /tmp/liblas/test/unit
 
 # Set the install prefix
 IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
diff --git a/Utilities/otbliblas/test/unit/guid_test.cpp b/Utilities/otbliblas/test/unit/guid_test.cpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/lasbounds_test.cpp b/Utilities/otbliblas/test/unit/lasbounds_test.cpp
old mode 100755
new mode 100644
index fa30f9468010715212865e7837c63a2f0bb496c9..a15556ca829aa2a6707bc976e4a85c1b2ba82eda
--- a/Utilities/otbliblas/test/unit/lasbounds_test.cpp
+++ b/Utilities/otbliblas/test/unit/lasbounds_test.cpp
@@ -35,20 +35,19 @@ namespace tut
     template<>
     void to::test<1>()
     {
-
-        
         Ranges rngs;
         rngs.push_back(xrng);
         rngs.push_back(yrng);
         rngs.push_back(zrng);
         
-        liblas::Bounds<double> b(rngs);        
-        ensure_equals(b.minx(), 0);
-        ensure_equals(b.maxx(), 100);
-        ensure_equals(b.miny(), 0);
-        ensure_equals(b.maxy(), 200);
-        ensure_equals(b.minz(), 0);
-        ensure_equals(b.maxz(), 300);
+        typedef liblas::Bounds<double> b_t;
+        b_t b(rngs);
+        ensure_equals(b.minx(), b_t::value_type(0));
+        ensure_equals(b.maxx(), b_t::value_type(100));
+        ensure_equals(b.miny(), b_t::value_type(0));
+        ensure_equals(b.maxy(), b_t::value_type(200));
+        ensure_equals(b.minz(), b_t::value_type(0));
+        ensure_equals(b.maxz(), b_t::value_type(300));
     }
 
     template<>
@@ -87,4 +86,4 @@ namespace tut
         liblas::Range<double> r;
         ensure(r.empty());
     }
-}
\ No newline at end of file
+}
diff --git a/Utilities/otbliblas/test/unit/lasclassification_test.cpp b/Utilities/otbliblas/test/unit/lasclassification_test.cpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/laserror_test.cpp b/Utilities/otbliblas/test/unit/laserror_test.cpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/lasheader_test.cpp b/Utilities/otbliblas/test/unit/lasheader_test.cpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/laspoint_test.cpp b/Utilities/otbliblas/test/unit/laspoint_test.cpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/lasreader_iterator_test.cpp b/Utilities/otbliblas/test/unit/lasreader_iterator_test.cpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/lasreader_test.cpp b/Utilities/otbliblas/test/unit/lasreader_test.cpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/lasspatialreference_test.cpp b/Utilities/otbliblas/test/unit/lasspatialreference_test.cpp
old mode 100755
new mode 100644
index f1644d9e80da8c085e499746b4a553974c14f317..97a8df1735e3cb13af9a2b974114c7cfe5301e63
--- a/Utilities/otbliblas/test/unit/lasspatialreference_test.cpp
+++ b/Utilities/otbliblas/test/unit/lasspatialreference_test.cpp
@@ -5,18 +5,25 @@
 // (See accompanying file LICENSE.txt or copy at
 // http://www.opensource.org/licenses/bsd-license.php)
 //
-#include <liblas/lasspatialreference.hpp>
-#include <liblas/guid.hpp>
+#include <liblas/liblas.hpp>
 #include <tut/tut.hpp>
 #include <string>
 #include <stdexcept>
 #include "common.hpp"
+#include "liblas_test.hpp"
 
 namespace tut
 { 
     struct lasspatialreference_data
     {
         liblas::SpatialReference m_default;
+        std::string utm17_filename;
+        std::string utm15_filename;
+
+        lasspatialreference_data()
+            : utm17_filename(g_test_data_path + "//srs.las")
+            , utm15_filename(g_test_data_path + "//1.2_3.las")
+        {}
     };
 
     typedef test_group<lasspatialreference_data> tg;
@@ -24,14 +31,166 @@ namespace tut
 
     tg test_group_lasspatialreference("liblas::SpatialReference");
 
+
     // Test default constructor
     template<>
     template<>
     void to::test<1>()
     {
+        
         ensure_equals(m_default.GetProj4(), "");
         ensure_equals(m_default.GetWKT(), "");
     }
+    
+#ifdef HAVE_GDAL
+
+    // Test fetching SRS from an existing file
+    template<>
+    template<>
+    void to::test<2>()
+    {
+        std::ifstream ifs;
+        ifs.open(utm17_filename.c_str(), std::ios::in | std::ios::binary);
+        liblas::Reader reader(ifs);
+        
+        liblas::Header const& header = reader.GetHeader();
+        liblas::SpatialReference const& ref = header.GetSRS();
+        
+        const char* wkt_c = "PROJCS[\"WGS 84 / UTM zone 17N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-81],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AUTHORITY[\"EPSG\",\"32617\"]]";
+        ensure_equals("WKT comparison", wkt_c, ref.GetWKT());
+        
+        const char* proj4_c = "+proj=utm +zone=17 +datum=WGS84 +units=m +no_defs ";
+        ensure_equals("Proj.4 comparison", proj4_c, ref.GetProj4());
+
+    }
+
+    // Test round-tripping proj.4 string
+    template<>
+    template<>
+    void to::test<3>()
+    {
+        liblas::SpatialReference ref;
+        const char* proj4_c = "+proj=utm +zone=15 +datum=WGS84 +units=m +no_defs ";
+        ref.SetProj4(proj4_c);
+        
+        ensure_equals("Proj.4 comparison", proj4_c, ref.GetProj4());
+        
+    }
+
+    // Test setting EPSG:4326 from User string
+    template<>
+    template<>
+    void to::test<4>()
+    {
+        liblas::SpatialReference ref;
+        const char* code = "EPSG:4326";
+        const char* proj4_c = "+proj=longlat +datum=WGS84 +no_defs ";
+        const char* wkt_c = "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433],AUTHORITY[\"EPSG\",\"4326\"]]";
+        ref.SetFromUserInput(code);
+        
+        ensure_equals("Proj.4 comparison", proj4_c, ref.GetProj4());
+        ensure_equals("WKT comparison", wkt_c, ref.GetWKT());
+        
+    }
+
+    // Test reprojecting UTM 15 to DD with a filter
+    template<>
+    template<>
+    void to::test<5>()
+    {
+        std::ifstream ifs;
+        ifs.open(utm15_filename.c_str(), std::ios::in | std::ios::binary);
+        liblas::Reader reader(ifs);
+        
+        liblas::Header const& header = reader.GetHeader();
+        liblas::SpatialReference const& in_ref = header.GetSRS();
+        
+        const char* utm15_wkt = "PROJCS[\"NAD83 / UTM zone 15N\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,298.2572221010002,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433],AUTHORITY[\"EPSG\",\"4269\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-93],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AUTHORITY[\"EPSG\",\"26915\"]]";
+        ensure_equals("Input WKT comparison", utm15_wkt, in_ref.GetWKT());
+
+        const char* epsg4326_wkt = "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433],AUTHORITY[\"EPSG\",\"4326\"]]";
+        
+        liblas::SpatialReference out_ref;
+        out_ref.SetWKT(epsg4326_wkt);
+        ensure_equals("Output WKT comparison", epsg4326_wkt, out_ref.GetWKT());
+        
+        liblas::HeaderPtr out_hdr = liblas::HeaderPtr(new liblas::Header(header));
+        out_hdr->SetScale(0.00000001, 0.00000001, 0.01);
+        out_hdr->SetOffset(0,0,0);
+        liblas::TransformPtr srs_transform = liblas::TransformPtr(new liblas::ReprojectionTransform(in_ref, out_ref, out_hdr));
+        
+        std::vector<liblas::TransformPtr> transforms;
+        transforms.push_back(srs_transform);
+        reader.ReadPointAt(0);
+
+        liblas::Point unprojected_point = reader.GetPoint();
+        
+        ensure_distance("unprojected_point.GetX()", 
+                        unprojected_point.GetX(), 
+                        double(470692.44), 
+                        0.01);
+
+        ensure_distance("unprojected_point.GetY()", 
+                        unprojected_point.GetY(), 
+                        double(4602888.90), 
+                        0.01);
+                        
+        reader.SetTransforms(transforms);
+
+        // This should throw an out of range exception because the given scale/offset 
+        // combination is not sufficient to store the data.
+        try
+        {
+            reader.ReadPointAt(0);
+            ensure("std::domain_error was not thrown", false);
+        }
+        catch (std::domain_error const& e)
+        {
+            ensure(e.what(), true);
+        }
+        
+
+        out_hdr->SetScale(0.0000001, 0.0000001, 0.01);
+        out_hdr->SetOffset(0,0,0);
+        srs_transform = liblas::TransformPtr(new liblas::ReprojectionTransform(in_ref, out_ref, out_hdr));
+        
+        transforms.clear();
+        transforms.push_back(srs_transform);
+        reader.SetTransforms(transforms);
+        
+        reader.Reset();
+        reader.ReadPointAt(0);
+
+        
+        liblas::Point const& projected_point = reader.GetPoint();
+
+        ensure_distance("projected_point.GetX()", 
+                        projected_point.GetX(), 
+                        double(-93.35156259), 
+                        0.0000001);
+        ensure_distance("projected_point.GetY()", 
+                        projected_point.GetY(), 
+                        double(41.57714839), 
+                        0.000001);
+        
+    }
+
+    // Test VLR sizes from setting SRS
+    template<>
+    template<>
+    void to::test<6>()
+    {
+        liblas::SpatialReference ref;
+        const char* code = "EPSG:4326";
+        ref.SetFromUserInput(code);
+        
+        std::vector<liblas::VariableRecord> const& vlrs = ref.GetVLRs();
+        ensure_equals("VLR count", boost::uint32_t(3), vlrs.size());
+        ensure_equals("First record size", boost::uint32_t(64), vlrs[0].GetRecordLength());
+        
+    }
+
+#endif
 
 }
 
diff --git a/Utilities/otbliblas/test/unit/lasvariablerecord_test.cpp b/Utilities/otbliblas/test/unit/lasvariablerecord_test.cpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/laswriter_test.cpp b/Utilities/otbliblas/test/unit/laswriter_test.cpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/liblas_test.hpp b/Utilities/otbliblas/test/unit/liblas_test.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/liblas_test_suite.cpp b/Utilities/otbliblas/test/unit/liblas_test_suite.cpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/tut/tut_assert.hpp b/Utilities/otbliblas/test/unit/tut/tut_assert.hpp
old mode 100755
new mode 100644
index c1959012ade5a6f78756f78b618ef56015f93ab5..bd08fcb9a1dd00f69a911d24713f575a8eeec5fe
--- a/Utilities/otbliblas/test/unit/tut/tut_assert.hpp
+++ b/Utilities/otbliblas/test/unit/tut/tut_assert.hpp
@@ -135,7 +135,7 @@ void ensure_equals(const M& msg, const double& actual, const double& expected, c
 {
     const double diff = actual - expected;
 
-    if ( (actual != expected) && !((diff <= epsilon) && (diff >= -epsilon )) )
+    if ( !((diff <= epsilon) && (diff >= -epsilon )) )
     {
         std::ostringstream ss;
         detail::msg_prefix(ss,msg)
diff --git a/Utilities/otbliblas/test/unit/tut/tut_config.hpp b/Utilities/otbliblas/test/unit/tut/tut_config.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/tut/tut_console_reporter.hpp b/Utilities/otbliblas/test/unit/tut/tut_console_reporter.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/tut/tut_exception.hpp b/Utilities/otbliblas/test/unit/tut/tut_exception.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/tut/tut_posix.hpp b/Utilities/otbliblas/test/unit/tut/tut_posix.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/tut/tut_reporter.hpp b/Utilities/otbliblas/test/unit/tut/tut_reporter.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/tut/tut_restartable.hpp b/Utilities/otbliblas/test/unit/tut/tut_restartable.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/tut/tut_result.hpp b/Utilities/otbliblas/test/unit/tut/tut_result.hpp
old mode 100755
new mode 100644
diff --git a/Utilities/otbliblas/test/unit/tut/tut_runner.hpp b/Utilities/otbliblas/test/unit/tut/tut_runner.hpp
old mode 100755
new mode 100644