[libspatialindex] 01/01: Imported Upstream version 1.8.3

Bas Couwenberg sebastic at xs4all.nl
Sun Sep 28 16:35:21 UTC 2014


This is an automated email from the git hooks/post-receive script.

sebastic-guest pushed a commit to branch upstream
in repository libspatialindex.

commit 78cb6186851570e8e79932c3dd421a909961617b
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Sun Sep 28 15:52:41 2014 +0200

    Imported Upstream version 1.8.3
---
 AUTHORS                                            |    5 +-
 CMakeLists.txt                                     |   32 +-
 ChangeLog                                          |  114 +
 Makefile.am                                        |    6 +-
 Makefile.in                                        |   92 +-
 README                                             |    6 +-
 aclocal.m4                                         |  365 ++-
 compile                                            |  347 +++
 config.guess                                       |  151 +-
 config.sub                                         |   41 +-
 configure                                          |  239 +-
 configure.ac                                       |    2 +-
 include/Makefile.am                                |    3 +-
 include/Makefile.in                                |   61 +-
 include/spatialindex/SpatialIndex.h                |    1 +
 include/spatialindex/TPRTree.h                     |    4 +-
 include/spatialindex/Version.h                     |    8 +-
 include/spatialindex/capi/BoundsQuery.h            |    4 +-
 include/spatialindex/capi/CountVisitor.h           |    4 +-
 include/spatialindex/capi/CustomStorage.h          |    6 +-
 include/spatialindex/capi/DataStream.h             |   10 +-
 include/spatialindex/capi/Error.h                  |    4 +-
 include/spatialindex/capi/IdVisitor.h              |    4 +-
 include/spatialindex/capi/Index.h                  |   30 +-
 include/spatialindex/capi/LeafQuery.h              |   12 +-
 include/spatialindex/capi/ObjVisitor.h             |    6 +-
 include/spatialindex/capi/Utility.h                |   10 +-
 include/spatialindex/capi/sidx_api.h               |  243 +-
 include/spatialindex/capi/sidx_config.h            |   13 +-
 .../spatialindex/capi/{Utility.h => sidx_export.h} |   18 +-
 include/spatialindex/tools/Tools.h                 | 1014 ++++-----
 ltmain.sh                                          |   32 +-
 src/CMakeLists.txt                                 |  188 +-
 src/Makefile.in                                    |   73 +-
 src/capi/BoundsQuery.cc                            |    2 +-
 src/capi/CountVisitor.cc                           |    6 +-
 src/capi/DataStream.cc                             |    6 +-
 src/capi/IdVisitor.cc                              |    4 +-
 src/capi/Index.cc                                  |  179 +-
 src/capi/LeafQuery.cc                              |    2 +-
 src/capi/Makefile.in                               |   61 +-
 src/capi/ObjVisitor.cc                             |    4 +-
 src/capi/Utility.cc                                |  122 +-
 src/capi/sidx_api.cc                               | 2379 +++++++++++++-------
 src/libspatialindex.pc.in                          |    2 +-
 src/mvrtree/Leaf.cc                                |    4 +-
 src/mvrtree/MVRTree.cc                             |    4 +-
 src/mvrtree/Makefile.in                            |   61 +-
 src/mvrtree/Node.cc                                |    2 +-
 src/rtree/Leaf.cc                                  |    4 +-
 src/rtree/Makefile.in                              |   61 +-
 src/rtree/Node.cc                                  |    2 +-
 src/rtree/RTree.cc                                 |    2 +-
 src/spatialindex/LineSegment.cc                    |    4 +-
 src/spatialindex/Makefile.in                       |   61 +-
 src/spatialindex/MovingRegion.cc                   |    2 +-
 src/spatialindex/Point.cc                          |    2 +-
 src/spatialindex/TimePoint.cc                      |   18 +-
 src/spatialindex/TimeRegion.cc                     |   14 +-
 src/storagemanager/DiskStorageManager.cc           |   29 +-
 src/storagemanager/DiskStorageManager.h            |    1 +
 src/storagemanager/Makefile.in                     |   61 +-
 src/storagemanager/MemoryStorageManager.cc         |    2 +-
 src/tools/Makefile.in                              |   61 +-
 src/tools/Tools.cc                                 |    6 +-
 src/tprtree/Leaf.cc                                |    4 +-
 src/tprtree/Makefile.in                            |   61 +-
 src/tprtree/Node.cc                                |    2 +-
 src/tprtree/TPRTree.cc                             |    4 +-
 test/Makefile.in                                   |   73 +-
 test/geometry/Makefile.in                          |   61 +-
 test/mvrtree/Makefile.in                           |   64 +-
 test/rtree/Makefile.in                             |   65 +-
 test/tprtree/Makefile.in                           |   64 +-
 test/tprtree/TPRTreeLoad.cc                        |    4 +-
 test/tprtree/TPRTreeQuery.cc                       |    6 +-
 76 files changed, 4556 insertions(+), 2168 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 17ffd6a..0da3661 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -8,4 +8,7 @@ Leonard Norrgård - CountVisitor in C API
 leonard.norrgard at refactor.fi
 
 Matthias (nitro) - CustomStorage in C API
-nitro at dr-code.org
\ No newline at end of file
+nitro at dr-code.org
+
+Norman Barker - flush(), index paging, C API improvements
+norman.barker at gmail.com
\ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ef24cb..4e0ab98 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,17 +16,19 @@ set(CMAKE_COLOR_MAKEFILE ON)
 mark_as_advanced(CMAKE_VERBOSE_MAKEFILE)
 
 # Path to additional CMake modules
-set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
-
+set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
 
+if (CMAKE_MAJOR_VERSION GREATER 2)
+    cmake_policy(SET CMP0042 OLD) # osx rpath
+endif()
 #------------------------------------------------------------------------------
 # libspatialindex general settings
 #------------------------------------------------------------------------------
 
 SET(SIDX_VERSION_MAJOR "1")
 SET(SIDX_VERSION_MINOR "8")
-SET(SIDX_VERSION_PATCH "1")
-SET(SIDX_LIB_SOVERSION "3.0.0")
+SET(SIDX_VERSION_PATCH "3")
+SET(SIDX_LIB_SOVERSION "3.2.0")
 
 
 set(SIDX_VERSION_STRING "${SIDX_VERSION_MAJOR}.${SIDX_VERSION_MINOR}.${SIDX_VERSION_PATCH}")
@@ -39,7 +41,7 @@ set(SIDX_C_LIB_NAME spatialindex_c)
 
 if(WIN32)
   if (MSVC)
-    if (MSVC80 OR MSVC90 OR MSVC10)
+    if (MSVC80 OR MSVC90 OR MSVC10 OR MSVC11 OR MSVC12)
         if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
             set( SIDX_LIB_NAME "spatialindex-64" )
             set( SIDX_C_LIB_NAME "spatialindex_c-64" )
@@ -63,7 +65,7 @@ check_function_exists(memcpy HAVE_MEMCPY)
 check_function_exists(bcopy HAVE_BCOPY)
 
 INCLUDE (CheckIncludeFiles)
-check_include_files(pthread.h HAVE_PTHREAD_H) 
+check_include_files(pthread.h HAVE_PTHREAD_H)
 
 
 if (HAVE_SRAND48)
@@ -94,10 +96,6 @@ if (HAVE_PTHREAD_H)
     add_definitions(-DHAVE_PTHREAD_H=1)
 endif()
 
-# Choose to use pkg-config or not
-#set(WITH_PKGCONFIG FALSE CACHE BOOL
-#  "Choose whether a pkgconfig file (PDAL.pc) should be installed")
-
 #------------------------------------------------------------------------------
 # General build settings
 #------------------------------------------------------------------------------
@@ -114,7 +112,7 @@ endif()
 set(SIDX_BUILD_TYPE ${CMAKE_BUILD_TYPE})
 
 # TODO: Still testing the output paths --mloskot
-set(SIDX_BUILD_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
+set(SIDX_BUILD_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
 
 # Output directory in which to build RUNTIME target files.
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SIDX_BUILD_OUTPUT_DIRECTORY})
@@ -132,23 +130,15 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SIDX_BUILD_OUTPUT_DIRECTORY})
 
 if(WIN32)
   if (MSVC)
-    if (MSVC80 OR MSVC90 OR MSVC10 OR MSVC11)
+    if (MSVC80 OR MSVC90 OR MSVC10 OR MSVC11 OR MSVC12 OR MSVC13)
       add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
       add_definitions(-D_CRT_SECURE_NO_WARNINGS)
       add_definitions(-D_CRT_NONSTDC_NO_WARNING)
       add_definitions(-D_SCL_SECURE_NO_WARNINGS)
       add_definitions(-DSPATIALINDEX_CREATE_DLL=1)
+      add_definitions(-DNOMINMAX)
 
       set(SIDX_COMPILER_MSVC 1)
-      if (MSVC11)
-        set(SIDX_COMPILER_VC11 1)
-      elseif (MSVC10)
-        set(SIDX_COMPILER_VC10 1)
-      elseif (MSVC9)
-        set(SIDX_COMPILER_VC9 1)
-      elseif (MSVC8)
-        set(SIDX_COMPILER_VC8 1)
-      endif()
     endif()
 
     if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
diff --git a/ChangeLog b/ChangeLog
index e7418f0..cb12d52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,118 @@
+2014-09-11
+	* Howard Butler <howard at hobu.co> Changelog update (10:57:08)
+	* Howard Butler <howard at hobu.co> clean up integer warning (10:56:53)
+	* Howard Butler <howard at hobu.co> Merge pull request #42 from libspatialindex/issues/42-automake-exports (10:54:58)
+	* Howard Butler <howard at hobu.co> Add sidx_export to Makefile.am #42 (10:54:07)
+
+2014-08-27
+	* Howard Butler <howard at hobu.co> Merge pull request #41 from cloudant/capi_mvrtree (10:20:03)
+
+2014-08-26
+	* Norman Barker <norman at cloudant.com> fixed typo in MVRIntersects_Count (17:18:32)
+	* Norman Barker <norman at cloudant.com> added MVR index type to the C API (17:16:03)
+
+2014-08-03
+	* Howard Butler <hobu.inc at gmail.com> fix up Release name (14:14:35)
+
+2014-07-28
+	* Howard Butler <hobu.inc at gmail.com> unused parameters (10:04:59)
+	* Howard Butler <hobu.inc at gmail.com> clean up C API for numResults being a uint64_t when it is only possible to specify uint32_t of nResults (09:53:36)
+	* Howard Butler <hobu.inc at gmail.com> more C API warning cleanups (09:50:55)
+	* Howard Butler <hobu.inc at gmail.com> leaf node counts are uint32_t, not size_t (09:34:41)
+	* Howard Butler <hobu at hobu.co> silence condition expression warning 4127 on msvc (09:20:58)
+	* Howard Butler <hobu.inc at gmail.com> unreferenced parameter cleanup (09:13:36)
+	* Howard Butler <hobu.inc at gmail.com> nuke assignment and empty constructor of C API Index class (09:13:01)
+	* Howard Butler <hobu.inc at gmail.com> children count is uint32_t (09:11:04)
+	* Howard Butler <hobu.inc at gmail.com> clean up LeafQuery visitor id management (09:09:20)
+	* Howard Butler <hobu.inc at gmail.com> clean up more unused parameters (08:37:24)
+	* Howard Butler <hobu.inc at gmail.com> fix mismatched type warning (using uint32_t as an id instead of SpatialIndex::id_type (08:37:15)
+	* Howard Butler <hobu.inc at gmail.com> remove unused and potentially problematic throw specification for DataStream (08:28:49)
+	* Howard Butler <hobu.inc at gmail.com> export all C API stuff to the DLL (08:23:49)
+
+2014-07-27
+	* Howard Butler <hobu.inc at gmail.com> more unreferenced parameter cleanups (23:37:25)
+	* Howard Butler <hobu.inc at gmail.com> screw 20ad010a1b55a4437b73c805270837c294b57251 and MSVC's dumb C4127 warning (23:36:15)
+	* Howard Butler <hobu.inc at gmail.com> more unreferenced parameter warnings (23:34:20)
+	* Howard Butler <hobu.inc at gmail.com> use ;; to denote looping forever to silence C4127 warning on MSVC (23:34:11)
+	* Howard Butler <hobu at hobu.co> support MSVC 2012 and 2013 (23:30:59)
+	* Howard Butler <hobu.inc at gmail.com> big unreferenced variable cleanup (23:30:35)
+	* Howard Butler <hobu.inc at gmail.com> clean up some unreferenced parameters warnings (23:17:14)
+	* Howard Butler <hobu.inc at gmail.com> Merge branch 'master' of github.com:libspatialindex/libspatialindex (23:03:10)
+	* Howard Butler <howard at hobu.co> Merge pull request #40 from libspatialindex/issues/40-capi-property-copying (23:03:04)
+	* Howard Butler <hobu.inc at gmail.com> clean up file open mode (23:02:48)
+	* Howard Butler <hobu.inc at gmail.com> bump versions to 1.8.2 in preparation for release (22:59:49)
+	* Howard Butler <hobu.inc at gmail.com> Update ChangeLog in preparation for release (22:59:21)
+	* Howard Butler <hobu.inc at gmail.com> add Norman to AUTHORS (22:57:12)
+	* Howard Butler <hobu.inc at gmail.com> Implement a fix for #40 to maintain pointers to IndexProperty references rather than copying (18:15:38)
+
+2014-07-22
+	* Howard Butler <hobu.inc at gmail.com> only do policy check for CMAKE > 2.x (11:25:02)
+	* Howard Butler <hobu.inc at gmail.com> turn off osx rpath cmake complaint (11:05:29)
+
+2014-07-14
+	* Howard Butler <hobu.inc at gmail.com> more cmake quoting #27 (16:07:21)
+	* Howard Butler <hobu.inc at gmail.com> fix up unfixed LGPL file from test suite (16:07:04)
+
+2014-07-12
+	* Howard Butler <hobu.inc at gmail.com> add BUILD_WITH_INSTALL_RPATH target property for OSX (23:59:03)
+	* Howard Butler <hobu.inc at gmail.com> CMake config quoting #27 (23:50:05)
+	* Howard Butler <hobu.inc at gmail.com> FSF postal adress update #5 (23:38:24)
+	* Howard Butler <hobu.inc at gmail.com> support wide character as possible tools::Variant type -- doesn't work yet though (23:32:19)
+	* Howard Butler <hobu.inc at gmail.com> add VT_PWCHAR to support wide character pointer for the Variant type (23:31:15)
+	* Howard Butler <hobu.inc at gmail.com> add MSVC 2013 and 2014 defns (23:27:45)
+	* Howard Butler <hobu.inc at gmail.com> fix redundant checks in destructor #28 (23:25:39)
+	* Howard Butler <hobu.inc at gmail.com> Remove LDFLAGS from Libs for pkg-config #23 (23:24:32)
+
+2014-05-12
+	* Howard Butler <howard at hobu.co> Merge pull request #38 from cloudant/c_tpr (10:22:16)
+
+2014-05-10
+	* Norman Barker <norman at cloudant.com> added temporal function to capi (16:49:28)
+
+2014-05-08
+	* Howard Butler <howard at hobu.co> Merge pull request #37 from cloudant/paging (13:48:51)
+
+2014-05-07
+	* Norman Barker <norman at cloudant.com> added paging to all indexes (19:11:58)
+
+2014-03-13
+	* Howard Butler <hobu.inc at gmail.com> turn off the unused m_rwLock for now (21:15:39)
+	* Howard Butler <hobu.inc at gmail.com> switch to int64_t instead of uint64_t when checking result counts (21:15:14)
+	* Howard Butler <hobu.inc at gmail.com> add newline to end of file (21:07:45)
+
+2014-02-13
+	* Howard Butler <howard at hobu.co> Merge pull request #32 from cloudant/empty_index (19:00:32)
+	* Howard Butler <howard at hobu.co> Merge pull request #33 from mlt/nominmax (19:00:07)
+
+2014-02-12
+	* Mikhail Titov <mlt at gmx.us> Prevent min/max from windef.h interference (15:09:53)
+
+2014-02-11
+	* Norman Barker <norman at cloudant.com> Added support for empty index files (17:46:14)
+
+2013-09-09
+	* Howard Butler <howard at hobu.co> update download location for new release (12:07:03)
+
+2013-08-21
+	* Howard Butler <howard at hobu.co> Merge pull request #26 from cloudant/skip_results (15:32:33)
+
+2013-08-19
+	* Norman Barker <norman at cloudant.com> made files protected variables (21:37:25)
+	* Norman Barker <norman at cloudant.com> added paging and flushing (21:35:32)
+
+2013-07-29
+	* Norman Barker <norman at cloudant.com> Added error handling to the C API (20:52:47)
+
+2013-07-25
+	* Norman Barker <norman at cloudant.com> Added Result Set Limit so that the number of items can be controlled. (17:58:54)
+
 2013-06-26
+	* Howard Butler <hobu.inc at gmail.com> fixups for MSVC2008 compilation (14:17:28)
+	* Howard Butler <hobu.inc at gmail.com> updates for v1.8.1 release (13:51:45)
+	* Howard Butler <hobu.inc at gmail.com> Merge branch 'master' of github.com:libspatialindex/libspatialindex (13:44:32)
+	* Howard Butler <hobu.inc at gmail.com> increment versions in preparation for 1.8.1 release (13:43:28)
+	* Howard Butler <hobu.inc at gmail.com> Merge pull request #22 from libspatialindex/issues/22-lgpl-fixups (13:40:35)
+	* Howard Butler <hobu.inc at gmail.com> update licenses for #22 (13:39:34)
 	* Howard Butler <hobu.inc at gmail.com> Merge branch 'libspatialindex-issues/19-mingw64' (13:26:44)
 
 2013-06-04
diff --git a/Makefile.am b/Makefile.am
index 53be647..3c2a260 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,7 +3,7 @@ SUBDIRS = src . test include
 
 lib_LTLIBRARIES = libspatialindex.la libspatialindex_c.la
 
-libspatialindex_la_SOURCES = 
+libspatialindex_la_SOURCES =
 libspatialindex_la_LIBADD = \
 	src/spatialindex/liblibrary.la \
 	src/storagemanager/libstoragemanager.la \
@@ -17,8 +17,8 @@ libspatialindex_c_la_LIBADD = \
 	libspatialindex.la \
 	src/capi/libsidxc.la
 
-libspatialindex_la_LDFLAGS = -version-info 3:0:0 -no-undefined -lstdc++ 
-libspatialindex_c_la_LDFLAGS = -version-info 3:0:0 -no-undefined -lstdc++
+libspatialindex_la_LDFLAGS = -version-info 3:2:0 -no-undefined -lstdc++
+libspatialindex_c_la_LDFLAGS = -version-info 3:2:0 -no-undefined -lstdc++
 
 EXTRA_DIST = INSTALL.WIN \
              spatialindex.sln \
diff --git a/Makefile.in b/Makefile.in
index 4b16b4b..fc661bb 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,23 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -54,8 +82,8 @@ subdir = .
 DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
 	$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/configure $(am__configure_deps) mkinstalldirs \
-	COPYING config.guess config.sub depcomp install-sh missing \
-	ltmain.sh
+	COPYING compile config.guess config.sub depcomp install-sh \
+	missing ltmain.sh
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -370,8 +398,8 @@ libspatialindex_c_la_LIBADD = \
 	libspatialindex.la \
 	src/capi/libsidxc.la
 
-libspatialindex_la_LDFLAGS = -version-info 3:0:0 -no-undefined -lstdc++ 
-libspatialindex_c_la_LDFLAGS = -version-info 3:0:0 -no-undefined -lstdc++
+libspatialindex_la_LDFLAGS = -version-info 3:2:0 -no-undefined -lstdc++
+libspatialindex_c_la_LDFLAGS = -version-info 3:2:0 -no-undefined -lstdc++
 EXTRA_DIST = INSTALL.WIN \
              spatialindex.sln \
              spatialindex-vc/spatialindex.vcproj \
@@ -459,8 +487,10 @@ clean-libLTLIBRARIES:
 	  echo rm -f $${locs}; \
 	  rm -f $${locs}; \
 	}
+
 libspatialindex.la: $(libspatialindex_la_OBJECTS) $(libspatialindex_la_DEPENDENCIES) $(EXTRA_libspatialindex_la_DEPENDENCIES) 
 	$(AM_V_CCLD)$(libspatialindex_la_LINK) -rpath $(libdir) $(libspatialindex_la_OBJECTS) $(libspatialindex_la_LIBADD) $(LIBS)
+
 libspatialindex_c.la: $(libspatialindex_c_la_OBJECTS) $(libspatialindex_c_la_DEPENDENCIES) $(EXTRA_libspatialindex_c_la_DEPENDENCIES) 
 	$(AM_V_CCLD)$(libspatialindex_c_la_LINK) -rpath $(libdir) $(libspatialindex_c_la_OBJECTS) $(libspatialindex_c_la_LIBADD) $(LIBS)
 
@@ -486,13 +516,12 @@ distclean-libtool:
 #     (which will cause the Makefiles to be regenerated when you run 'make');
 # (2) otherwise, pass the desired values on the 'make' command line.
 $(am__recursive_targets):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
 	case "$@" in \
@@ -666,10 +695,16 @@ dist-xz: distdir
 	$(am__post_remove_distdir)
 
 dist-tarZ: distdir
+	@echo WARNING: "Support for shar distribution archives is" \
+	               "deprecated." >&2
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
 	$(am__post_remove_distdir)
 
 dist-shar: distdir
+	@echo WARNING: "Support for distribution archives compressed with" \
+		       "legacy program 'compress' is deprecated." >&2
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
 
@@ -711,9 +746,10 @@ distcheck: dist
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
 	  && am__cwd=`pwd` \
 	  && $(am__cd) $(distdir)/_build \
-	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	  && ../configure \
 	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	    --srcdir=.. --prefix="$$dc_install_base" \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
 	  && $(MAKE) $(AM_MAKEFLAGS) check \
diff --git a/README b/README
index d71433c..df9fa64 100644
--- a/README
+++ b/README
@@ -4,7 +4,7 @@
 
 :Author: Marios Hadjieleftheriou
 :Contact: mhadji at gmail.com
-:Revision: 1.8.1
-:Date: 06/26/2013
+:Revision: 1.8.3
+:Date: 09/20/2014
 
-See http://libspatialindex.org for full documentation.
\ No newline at end of file
+See http://libspatialindex.org for full documentation.
diff --git a/aclocal.m4 b/aclocal.m4
index 3dcab66..05207cf 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.13.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1326,7 +1326,7 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
@@ -1338,9 +1338,19 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	    LD="${LD-ld} -m elf_i386_fbsd"
 	    ;;
 	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_i386"
+	    case `/usr/bin/file conftest.o` in
+	      *x86-64*)
+		LD="${LD-ld} -m elf32_x86_64"
+		;;
+	      *)
+		LD="${LD-ld} -m elf_i386"
+		;;
+	    esac
+	    ;;
+	  powerpc64le-*)
+	    LD="${LD-ld} -m elf32lppclinux"
 	    ;;
-	  ppc64-*linux*|powerpc64-*linux*)
+	  powerpc64-*)
 	    LD="${LD-ld} -m elf32ppclinux"
 	    ;;
 	  s390x-*linux*)
@@ -1359,7 +1369,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  ppc*-*linux*|powerpc*-*linux*)
+	  powerpcle-*)
+	    LD="${LD-ld} -m elf64lppc"
+	    ;;
+	  powerpc-*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
@@ -1702,7 +1715,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     ;;
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+	test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
@@ -2526,17 +2540,6 @@ freebsd* | dragonfly*)
   esac
   ;;
 
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
 haiku*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
@@ -2653,7 +2656,7 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
@@ -2698,6 +2701,18 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -3257,10 +3272,6 @@ freebsd* | dragonfly*)
   fi
   ;;
 
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 haiku*)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -3299,11 +3310,11 @@ irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd*)
+netbsd* | netbsdelf*-gnu)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   else
@@ -4051,7 +4062,7 @@ m4_if([$1], [CXX], [
 	    ;;
 	esac
 	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
 	case $cc_basename in
 	  KCC*)
 	    # KAI C++ Compiler
@@ -4115,7 +4126,7 @@ m4_if([$1], [CXX], [
 	    ;;
 	esac
 	;;
-      netbsd*)
+      netbsd* | netbsdelf*-gnu)
 	;;
       *qnx* | *nto*)
         # QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -4350,7 +4361,7 @@ m4_if([$1], [CXX], [
       _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -4592,6 +4603,9 @@ m4_if([$1], [CXX], [
       ;;
     esac
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
   *)
     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
     ;;
@@ -4654,6 +4668,9 @@ dnl Note also adjust exclude_expsyms for C++ above.
   openbsd*)
     with_gnu_ld=no
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
   esac
 
   _LT_TAGVAR(ld_shlibs, $1)=yes
@@ -4875,7 +4892,7 @@ _LT_EOF
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -5052,6 +5069,7 @@ _LT_EOF
 	if test "$aix_use_runtimelinking" = yes; then
 	  shared_flag="$shared_flag "'${wl}-G'
 	fi
+	_LT_TAGVAR(link_all_deplibs, $1)=no
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
@@ -5356,7 +5374,7 @@ _LT_EOF
       _LT_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -6232,9 +6250,6 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(ld_shlibs, $1)=yes
         ;;
 
-      gnu*)
-        ;;
-
       haiku*)
         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         _LT_TAGVAR(link_all_deplibs, $1)=yes
@@ -6396,7 +6411,7 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(inherit_rpath, $1)=yes
         ;;
 
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
         case $cc_basename in
           KCC*)
 	    # Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -8619,10 +8634,10 @@ m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.13'
+[am__api_version='1.14'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.13.1], [],
+m4_if([$1], [1.14.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -8638,7 +8653,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.13.1])dnl
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -8960,7 +8975,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
+    test -z "$am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
@@ -9005,6 +9020,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
 
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
 # AM_INIT_AUTOMAKE([OPTIONS])
 # -----------------------------------------------
@@ -9113,7 +9134,48 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
 AC_CONFIG_COMMANDS_PRE(dnl
 [m4_provide_if([_AM_COMPILER_EXEEXT],
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake at gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+  fi
+fi])
 
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
@@ -9121,7 +9183,6 @@ dnl mangled by Autoconf and run in a shell conditional statement.
 m4_define([_AC_COMPILER_EXEEXT],
 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
 
-
 # When config.status generates a header, we must update the stamp-h file.
 # This file resides in the same directory as the config header
 # that is generated.  The stamp files are numbered to have different names.
@@ -9303,6 +9364,70 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+  [whether $CC understands -c and -o together],
+  [am_cv_prog_cc_c_o],
+  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
@@ -9512,76 +9637,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 # Substitute a variable $(am__untar) that extract such
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
+#
 AC_DEFUN([_AM_PROG_TAR],
 [# Always define AMTAR for backward compatibility.  Yes, it's still used
 # in the wild :-(  We should find a proper way to deprecate it ...
 AC_SUBST([AMTAR], ['$${TAR-tar}'])
-m4_if([$1], [v7],
-     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
-     [m4_case([$1], [ustar],, [pax],,
-              [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
+
+# We'll loop over all known methods to create a tar archive until one works.
 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of '-'.
-for _am_tool in $_am_tools
-do
-  case $_am_tool in
-  gnutar)
-    for _am_tar in tar gnutar gtar;
-    do
-      AM_RUN_LOG([$_am_tar --version]) && break
-    done
-    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
-    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
-    am__untar="$_am_tar -xf -"
-    ;;
-  plaintar)
-    # Must skip GNU tar: if it does not support --format= it doesn't create
-    # ustar tarball either.
-    (tar --version) >/dev/null 2>&1 && continue
-    am__tar='tar chf - "$$tardir"'
-    am__tar_='tar chf - "$tardir"'
-    am__untar='tar xf -'
-    ;;
-  pax)
-    am__tar='pax -L -x $1 -w "$$tardir"'
-    am__tar_='pax -L -x $1 -w "$tardir"'
-    am__untar='pax -r'
-    ;;
-  cpio)
-    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
-    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
-    am__untar='cpio -i -H $1 -d'
-    ;;
-  none)
-    am__tar=false
-    am__tar_=false
-    am__untar=false
-    ;;
-  esac
 
-  # If the value was cached, stop now.  We just wanted to have am__tar
-  # and am__untar set.
-  test -n "${am_cv_prog_tar_$1}" && break
+m4_if([$1], [v7],
+  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+  [m4_case([$1],
+    [ustar],
+     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+      # There is notably a 21 bits limit for the UID and the GID.  In fact,
+      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+      # and bug#13588).
+      am_max_uid=2097151 # 2^21 - 1
+      am_max_gid=$am_max_uid
+      # The $UID and $GID variables are not portable, so we need to resort
+      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
+      # below are definitely unexpected, so allow the users to see them
+      # (that is, avoid stderr redirection).
+      am_uid=`id -u || echo unknown`
+      am_gid=`id -g || echo unknown`
+      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+      if test $am_uid -le $am_max_uid; then
+         AC_MSG_RESULT([yes])
+      else
+         AC_MSG_RESULT([no])
+         _am_tools=none
+      fi
+      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+      if test $am_gid -le $am_max_gid; then
+         AC_MSG_RESULT([yes])
+      else
+        AC_MSG_RESULT([no])
+        _am_tools=none
+      fi],
+
+  [pax],
+    [],
 
-  # tar/untar a dummy directory, and stop if the command works
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  echo GrepMe > conftest.dir/file
-  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  [m4_fatal([Unknown tar format])])
+
+  AC_MSG_CHECKING([how to create a $1 tar archive])
+
+  # Go ahead even if we have the value already cached.  We do so because we
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
+  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+  for _am_tool in $_am_tools; do
+    case $_am_tool in
+    gnutar)
+      for _am_tar in tar gnutar gtar; do
+        AM_RUN_LOG([$_am_tar --version]) && break
+      done
+      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+      am__untar="$_am_tar -xf -"
+      ;;
+    plaintar)
+      # Must skip GNU tar: if it does not support --format= it doesn't create
+      # ustar tarball either.
+      (tar --version) >/dev/null 2>&1 && continue
+      am__tar='tar chf - "$$tardir"'
+      am__tar_='tar chf - "$tardir"'
+      am__untar='tar xf -'
+      ;;
+    pax)
+      am__tar='pax -L -x $1 -w "$$tardir"'
+      am__tar_='pax -L -x $1 -w "$tardir"'
+      am__untar='pax -r'
+      ;;
+    cpio)
+      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+      am__untar='cpio -i -H $1 -d'
+      ;;
+    none)
+      am__tar=false
+      am__tar_=false
+      am__untar=false
+      ;;
+    esac
+
+    # If the value was cached, stop now.  We just wanted to have am__tar
+    # and am__untar set.
+    test -n "${am_cv_prog_tar_$1}" && break
+
+    # tar/untar a dummy directory, and stop if the command works.
+    rm -rf conftest.dir
+    mkdir conftest.dir
+    echo GrepMe > conftest.dir/file
+    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+    rm -rf conftest.dir
+    if test -s conftest.tar; then
+      AM_RUN_LOG([$am__untar <conftest.tar])
+      AM_RUN_LOG([cat conftest.dir/file])
+      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+    fi
+  done
   rm -rf conftest.dir
-  if test -s conftest.tar; then
-    AM_RUN_LOG([$am__untar <conftest.tar])
-    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
-  fi
-done
-rm -rf conftest.dir
 
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
 AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
diff --git a/compile b/compile
new file mode 100755
index 0000000..531136b
--- /dev/null
+++ b/compile
@@ -0,0 +1,347 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-10-14.11; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey at cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""	$nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv/,$2, in
+	*,$file_conv,*)
+	  ;;
+	mingw/*)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin/*)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine/*)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+    if test -f "$dir/lib$lib.a"; then
+      found=yes
+      lib=$dir/lib$lib.a
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+	-o)
+	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
+	  eat=1
+	  case $2 in
+	    *.o | *.[oO][bB][jJ])
+	      func_file_conv "$2"
+	      set x "$@" -Fo"$file"
+	      shift
+	      ;;
+	    *)
+	      func_file_conv "$2"
+	      set x "$@" -Fe"$file"
+	      shift
+	      ;;
+	  esac
+	  ;;
+	-I)
+	  eat=1
+	  func_file_conv "$2" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-I*)
+	  func_file_conv "${1#-I}" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-l)
+	  eat=1
+	  func_cl_dashl "$2"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-l*)
+	  func_cl_dashl "${1#-l}"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-L)
+	  eat=1
+	  func_cl_dashL "$2"
+	  ;;
+	-L*)
+	  func_cl_dashL "${1#-L}"
+	  ;;
+	-static)
+	  shared=false
+	  ;;
+	-Wl,*)
+	  arg=${1#-Wl,}
+	  save_ifs="$IFS"; IFS=','
+	  for flag in $arg; do
+	    IFS="$save_ifs"
+	    linker_opts="$linker_opts $flag"
+	  done
+	  IFS="$save_ifs"
+	  ;;
+	-Xlinker)
+	  eat=1
+	  linker_opts="$linker_opts $2"
+	  ;;
+	-*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+	  func_file_conv "$1"
+	  set x "$@" -Tp"$file"
+	  shift
+	  ;;
+	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+	  func_file_conv "$1" mingw
+	  set x "$@" "$file"
+	  shift
+	  ;;
+	*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
+case $1 in
+  '')
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as 'compile cc -o foo foo.c'.
+	# So we strip '-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no '-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # '.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config.guess b/config.guess
index 1804e9f..b79252d 100755
--- a/config.guess
+++ b/config.guess
@@ -1,10 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012, 2013 Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2012-12-29'
+timestamp='2013-06-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -26,7 +24,7 @@ timestamp='2012-12-29'
 # program.  This Exception is an additional permission under section 7
 # of the GNU General Public License, version 3 ("GPLv3").
 #
-# Originally written by Per Bothner. 
+# Originally written by Per Bothner.
 #
 # You can get the latest version of this script from:
 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
@@ -52,9 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-2012, 2013 Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -136,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+	# If the system lacks a compiler, then just pick glibc.
+	# We could probably try harder.
+	LIBC=gnu
+
+	eval $set_cc_for_build
+	cat <<-EOF > $dummy.c
+	#include <features.h>
+	#if defined(__UCLIBC__)
+	LIBC=uclibc
+	#elif defined(__dietlibc__)
+	LIBC=dietlibc
+	#else
+	LIBC=gnu
+	#endif
+	EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -857,21 +874,21 @@ EOF
 	exit ;;
     *:GNU:*:*)
 	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
 	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
 	exit ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
     aarch64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     aarch64_be:Linux:*:*)
 	UNAME_MACHINE=aarch64_be
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -884,59 +901,54 @@ EOF
 	  EV68*) UNAME_MACHINE=alphaev68 ;;
 	esac
 	objdump --private-headers /bin/sh | grep -q ld.so.1
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     arm*:Linux:*:*)
 	eval $set_cc_for_build
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	else
 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
 		| grep -q __ARM_PCS_VFP
 	    then
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
 	    else
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
 	    fi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     cris:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     crisv32:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     frv:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     hexagon:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:Linux:*:*)
-	LIBC=gnu
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#ifdef __dietlibc__
-	LIBC=dietlibc
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
 	eval $set_cc_for_build
@@ -955,54 +967,63 @@ EOF
 	#endif
 EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
+    or1k:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
     or32:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     padre:Linux:*:*)
-	echo sparc-unknown-linux-gnu
+	echo sparc-unknown-linux-${LIBC}
 	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
+	echo hppa64-unknown-linux-${LIBC}
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
-	  *)    echo hppa-unknown-linux-gnu ;;
+	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+	  *)    echo hppa-unknown-linux-${LIBC} ;;
 	esac
 	exit ;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
+	echo powerpc64-unknown-linux-${LIBC}
 	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
+	echo powerpc-unknown-linux-${LIBC}
+	exit ;;
+    ppc64le:Linux:*:*)
+	echo powerpc64le-unknown-linux-${LIBC}
+	exit ;;
+    ppcle:Linux:*:*)
+	echo powerpcle-unknown-linux-${LIBC}
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux
+	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
 	exit ;;
     sh64*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-gnu
+	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
 	exit ;;
     x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     xtensa*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1235,19 +1256,21 @@ EOF
 	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	case $UNAME_PROCESSOR in
-	    i386)
-		eval $set_cc_for_build
-		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		      grep IS_64BIT_ARCH >/dev/null
-		  then
-		      UNAME_PROCESSOR="x86_64"
-		  fi
-		fi ;;
-	    unknown) UNAME_PROCESSOR=powerpc ;;
-	esac
+	eval $set_cc_for_build
+	if test "$UNAME_PROCESSOR" = unknown ; then
+	    UNAME_PROCESSOR=powerpc
+	fi
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		case $UNAME_PROCESSOR in
+		    i386) UNAME_PROCESSOR=x86_64 ;;
+		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		esac
+	    fi
+	fi
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
diff --git a/config.sub b/config.sub
index 802a224..9633db7 100755
--- a/config.sub
+++ b/config.sub
@@ -1,10 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012, 2013 Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2012-12-29'
+timestamp='2013-08-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -70,9 +68,7 @@ Report bugs and patches to <config-patches at gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-2012, 2013 Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -256,12 +252,12 @@ case $basic_machine in
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
-	| arc \
+	| arc | arceb \
 	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
 	| avr | avr32 \
 	| be32 | be64 \
 	| bfin \
-	| c4x | clipper \
+	| c4x | c8051 | clipper \
 	| d10v | d30v | dlx | dsp16xx \
 	| epiphany \
 	| fido | fr30 | frv \
@@ -290,16 +286,17 @@ case $basic_machine in
 	| mipsisa64r2 | mipsisa64r2el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipsr5900 | mipsr5900el \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
 	| moxie \
 	| mt \
 	| msp430 \
 	| nds32 | nds32le | nds32be \
-	| nios | nios2 \
+	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
 	| open8 \
-	| or32 \
+	| or1k | or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
@@ -369,13 +366,13 @@ case $basic_machine in
 	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
 	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* \
-	| clipper-* | craynv-* | cydra-* \
+	| c8051-* | clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
@@ -407,12 +404,13 @@ case $basic_machine in
 	| mipsisa64r2-* | mipsisa64r2el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipsr5900-* | mipsr5900el-* \
 	| mipstx39-* | mipstx39el-* \
 	| mmix-* \
 	| mt-* \
 	| msp430-* \
 	| nds32-* | nds32le-* | nds32be-* \
-	| nios-* | nios2-* \
+	| nios-* | nios2-* | nios2eb-* | nios2el-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
 	| open8-* \
 	| orion-* \
@@ -796,7 +794,7 @@ case $basic_machine in
 		os=-mingw64
 		;;
 	mingw32)
-		basic_machine=i386-pc
+		basic_machine=i686-pc
 		os=-mingw32
 		;;
 	mingw32ce)
@@ -832,7 +830,7 @@ case $basic_machine in
 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
 		;;
 	msys)
-		basic_machine=i386-pc
+		basic_machine=i686-pc
 		os=-msys
 		;;
 	mvs)
@@ -1354,7 +1352,7 @@ case $os in
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-	      | -sym* | -kopensolaris* \
+	      | -sym* | -kopensolaris* | -plan9* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
 	      | -aos* | -aros* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
@@ -1500,9 +1498,6 @@ case $os in
 	-aros*)
 		os=-aros
 		;;
-	-kaos*)
-		os=-kaos
-		;;
 	-zvmoe)
 		os=-zvmoe
 		;;
@@ -1551,6 +1546,9 @@ case $basic_machine in
 	c4x-* | tic4x-*)
 		os=-coff
 		;;
+	c8051-*)
+		os=-elf
+		;;
 	hexagon-*)
 		os=-elf
 		;;
@@ -1594,6 +1592,9 @@ case $basic_machine in
 	mips*-*)
 		os=-elf
 		;;
+	or1k-*)
+		os=-elf
+		;;
 	or32-*)
 		os=-coff
 		;;
diff --git a/configure b/configure
index cf47618..26d031f 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for spatialindex 1.8.1.
+# Generated by GNU Autoconf 2.69 for spatialindex 1.8.3.
 #
 # Report bugs to <mhadji at gmail.com>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='spatialindex'
 PACKAGE_TARNAME='spatialindex-src'
-PACKAGE_VERSION='1.8.1'
-PACKAGE_STRING='spatialindex 1.8.1'
+PACKAGE_VERSION='1.8.3'
+PACKAGE_STRING='spatialindex 1.8.3'
 PACKAGE_BUGREPORT='mhadji at gmail.com'
 PACKAGE_URL=''
 
@@ -1323,7 +1323,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures spatialindex 1.8.1 to adapt to many kinds of systems.
+\`configure' configures spatialindex 1.8.3 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1394,7 +1394,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of spatialindex 1.8.1:";;
+     short | recursive ) echo "Configuration of spatialindex 1.8.3:";;
    esac
   cat <<\_ACEOF
 
@@ -1503,7 +1503,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-spatialindex configure 1.8.1
+spatialindex configure 1.8.3
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1993,7 +1993,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by spatialindex $as_me 1.8.1, which was
+It was created by spatialindex $as_me 1.8.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3317,6 +3317,9 @@ esac
 
 
 
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3856,6 +3859,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
 if ${ac_cv_path_SED+:} false; then :
@@ -4565,7 +4627,8 @@ else
     ;;
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+	test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
@@ -4966,10 +5029,6 @@ freebsd* | dragonfly*)
   fi
   ;;
 
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 haiku*)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -5008,11 +5067,11 @@ irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd*)
+netbsd* | netbsdelf*-gnu)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   else
@@ -6132,7 +6191,7 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
@@ -6148,9 +6207,19 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	    LD="${LD-ld} -m elf_i386_fbsd"
 	    ;;
 	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_i386"
+	    case `/usr/bin/file conftest.o` in
+	      *x86-64*)
+		LD="${LD-ld} -m elf32_x86_64"
+		;;
+	      *)
+		LD="${LD-ld} -m elf_i386"
+		;;
+	    esac
+	    ;;
+	  powerpc64le-*)
+	    LD="${LD-ld} -m elf32lppclinux"
 	    ;;
-	  ppc64-*linux*|powerpc64-*linux*)
+	  powerpc64-*)
 	    LD="${LD-ld} -m elf32ppclinux"
 	    ;;
 	  s390x-*linux*)
@@ -6169,7 +6238,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  ppc*-*linux*|powerpc*-*linux*)
+	  powerpcle-*)
+	    LD="${LD-ld} -m elf64lppc"
+	    ;;
+	  powerpc-*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
@@ -7984,7 +8056,7 @@ lt_prog_compiler_static=
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -8462,6 +8534,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   openbsd*)
     with_gnu_ld=no
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    link_all_deplibs=no
+    ;;
   esac
 
   ld_shlibs=yes
@@ -8683,7 +8758,7 @@ _LT_EOF
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -8860,6 +8935,7 @@ _LT_EOF
 	if test "$aix_use_runtimelinking" = yes; then
 	  shared_flag="$shared_flag "'${wl}-G'
 	fi
+	link_all_deplibs=no
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
@@ -9313,7 +9389,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       link_all_deplibs=yes
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -10150,17 +10226,6 @@ freebsd* | dragonfly*)
   esac
   ;;
 
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
 haiku*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
@@ -10277,7 +10342,7 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
@@ -10341,6 +10406,18 @@ fi
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -12088,9 +12165,6 @@ fi
         ld_shlibs_CXX=yes
         ;;
 
-      gnu*)
-        ;;
-
       haiku*)
         archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         link_all_deplibs_CXX=yes
@@ -12252,7 +12326,7 @@ fi
         inherit_rpath_CXX=yes
         ;;
 
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
         case $cc_basename in
           KCC*)
 	    # Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -13112,7 +13186,7 @@ lt_prog_compiler_static_CXX=
 	    ;;
 	esac
 	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
 	case $cc_basename in
 	  KCC*)
 	    # KAI C++ Compiler
@@ -13176,7 +13250,7 @@ lt_prog_compiler_static_CXX=
 	    ;;
 	esac
 	;;
-      netbsd*)
+      netbsd* | netbsdelf*-gnu)
 	;;
       *qnx* | *nto*)
         # QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -13547,6 +13621,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
       ;;
     esac
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    link_all_deplibs_CXX=no
+    ;;
   *)
     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
     ;;
@@ -13981,17 +14058,6 @@ freebsd* | dragonfly*)
   esac
   ;;
 
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
 haiku*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
@@ -14108,7 +14174,7 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
@@ -14172,6 +14238,18 @@ fi
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -14499,7 +14577,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 # Only expand once:
 
 
-am__api_version='1.13'
+am__api_version='1.14'
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
 $as_echo_n "checking whether build environment is sane... " >&6; }
@@ -14578,9 +14656,6 @@ test "$program_suffix" != NONE &&
 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
 if test x"${MISSING+set}" != xset; then
   case $am_aux_dir in
   *\ * | *\	*)
@@ -14882,7 +14957,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='spatialindex-src'
- VERSION='1.8.1'
+ VERSION='1.8.3'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14922,11 +14997,16 @@ mkdir_p='$(MKDIR_P)'
 # in the wild :-(  We should find a proper way to deprecate it ...
 AMTAR='$${TAR-tar}'
 
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar  pax cpio none'
+
 am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
 
 
+
 depcc="$CC"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
@@ -15184,6 +15264,47 @@ fi
 
 
 
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake at gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+  fi
+fi
 
 # Checks for header files.
 for ac_header in fcntl.h
@@ -15936,7 +16057,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by spatialindex $as_me 1.8.1, which was
+This file was extended by spatialindex $as_me 1.8.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15993,7 +16114,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-spatialindex config.status 1.8.1
+spatialindex config.status 1.8.3
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -17782,7 +17903,7 @@ $as_echo X"$mf" |
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
+    test -z "$am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
diff --git a/configure.ac b/configure.ac
index 3ecd264..2e6bed7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@ AC_PREREQ(2.59)
 
 m4_define([sidx_version_major], [1])
 m4_define([sidx_version_minor], [8])
-m4_define([sidx_version_micro], [1])
+m4_define([sidx_version_micro], [3])
 m4_define([sidx_version],
           [sidx_version_major.sidx_version_minor.sidx_version_micro])
 
diff --git a/include/Makefile.am b/include/Makefile.am
index d093aac..d71812b 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -22,6 +22,7 @@ nobase_spatialindex_HEADERS =			spatialindex/SpatialIndex.h \
 								spatialindex/capi/LeafQuery.h \
 								spatialindex/capi/ObjVisitor.h \
 								spatialindex/capi/sidx_api.h \
+								spatialindex/capi/sidx_export.h \
 								spatialindex/capi/sidx_config.h \
 								spatialindex/capi/sidx_impl.h \
 								spatialindex/capi/Utility.h \
@@ -29,4 +30,4 @@ nobase_spatialindex_HEADERS =			spatialindex/SpatialIndex.h \
 								spatialindex/tools/PoolPointer.h \
 								spatialindex/tools/rand48.h \
 								spatialindex/tools/SmartPointer.h \
-								spatialindex/tools/Tools.h
\ No newline at end of file
+								spatialindex/tools/Tools.h
diff --git a/include/Makefile.in b/include/Makefile.in
index b7113db..6251022 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,23 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -270,6 +298,7 @@ nobase_spatialindex_HEADERS = spatialindex/SpatialIndex.h \
 								spatialindex/capi/LeafQuery.h \
 								spatialindex/capi/ObjVisitor.h \
 								spatialindex/capi/sidx_api.h \
+								spatialindex/capi/sidx_export.h \
 								spatialindex/capi/sidx_config.h \
 								spatialindex/capi/sidx_impl.h \
 								spatialindex/capi/Utility.h \
diff --git a/include/spatialindex/SpatialIndex.h b/include/spatialindex/SpatialIndex.h
index cbe0def..5054ac4 100644
--- a/include/spatialindex/SpatialIndex.h
+++ b/include/spatialindex/SpatialIndex.h
@@ -158,6 +158,7 @@ namespace SpatialIndex
 		virtual void loadByteArray(const id_type id, uint32_t& len, byte** data) = 0;
 		virtual void storeByteArray(id_type& id, const uint32_t len, const byte* const data) = 0;
 		virtual void deleteByteArray(const id_type id) = 0;
+		virtual void flush() = 0;
 		virtual ~IStorageManager() {}
 	}; // IStorageManager
 
diff --git a/include/spatialindex/TPRTree.h b/include/spatialindex/TPRTree.h
index 7685c06..1f1b46b 100644
--- a/include/spatialindex/TPRTree.h
+++ b/include/spatialindex/TPRTree.h
@@ -5,7 +5,7 @@
  * Copyright (c) 2003, Marios Hadjieleftheriou
  *
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
@@ -34,7 +34,7 @@ namespace SpatialIndex
 	{
 		SIDX_DLL enum TPRTreeVariant
 		{
-			TPRV_RSTAR = 0x0
+			TPRV_RSTAR = 0x2
 		};
 
 		SIDX_DLL enum PersistenObjectIdentifier
diff --git a/include/spatialindex/Version.h b/include/spatialindex/Version.h
index 60520e9..782ced3 100644
--- a/include/spatialindex/Version.h
+++ b/include/spatialindex/Version.h
@@ -5,7 +5,7 @@
  * Copyright (c) 2003, Marios Hadjieleftheriou
  *
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
@@ -30,7 +30,7 @@
 #ifndef SIDX_VERSION_MAJOR
 #define SIDX_VERSION_MAJOR    1
 #define SIDX_VERSION_MINOR    8
-#define SIDX_VERSION_REV      1
+#define SIDX_VERSION_REV      3
 #define SIDX_VERSION_BUILD    0
 #endif
 
@@ -39,10 +39,10 @@
 #endif
 
 #ifndef SIDX_RELEASE_DATE
-#define SIDX_RELEASE_DATE     20130626
+#define SIDX_RELEASE_DATE     20140920
 #endif
 
 #ifndef SIDX_RELEASE_NAME
-#define SIDX_RELEASE_NAME     "1.8.1"
+#define SIDX_RELEASE_NAME     "1.8.3"
 #endif
 
diff --git a/include/spatialindex/capi/BoundsQuery.h b/include/spatialindex/capi/BoundsQuery.h
index b0eeda7..79fdcb8 100644
--- a/include/spatialindex/capi/BoundsQuery.h
+++ b/include/spatialindex/capi/BoundsQuery.h
@@ -28,7 +28,9 @@
 
 #pragma once
 
-class BoundsQuery : public SpatialIndex::IQueryStrategy
+#include "sidx_export.h"
+
+class SIDX_DLL BoundsQuery : public SpatialIndex::IQueryStrategy
 {
 private:
     SpatialIndex::Region* m_bounds;
diff --git a/include/spatialindex/capi/CountVisitor.h b/include/spatialindex/capi/CountVisitor.h
index bf4e8c1..eaaee8d 100644
--- a/include/spatialindex/capi/CountVisitor.h
+++ b/include/spatialindex/capi/CountVisitor.h
@@ -28,7 +28,9 @@
 
 #pragma once
 
-class CountVisitor : public SpatialIndex::IVisitor
+#include "sidx_export.h"
+
+class SIDX_DLL CountVisitor : public SpatialIndex::IVisitor
 {
 private:
    uint64_t nResults;
diff --git a/include/spatialindex/capi/CustomStorage.h b/include/spatialindex/capi/CustomStorage.h
index 77a4612..e54d12a 100644
--- a/include/spatialindex/capi/CustomStorage.h
+++ b/include/spatialindex/capi/CustomStorage.h
@@ -28,11 +28,13 @@
 
 #pragma once
 
+#include "sidx_export.h"
+
 namespace SpatialIndex
 {
 	namespace StorageManager
 	{
-        struct CustomStorageManagerCallbacks
+        struct SIDX_DLL CustomStorageManagerCallbacks
         {
             CustomStorageManagerCallbacks() 
             : context(0)
@@ -52,7 +54,7 @@ namespace SpatialIndex
             void (*deleteByteArrayCallback)( const void* context, const id_type page, int* errorCode );
         };
 
-        class CustomStorageManager : public SpatialIndex::IStorageManager
+        class SIDX_DLL CustomStorageManager : public SpatialIndex::IStorageManager
         {
         public:
             // I'd like this to be an enum, but casting between enums and ints is not nice
diff --git a/include/spatialindex/capi/DataStream.h b/include/spatialindex/capi/DataStream.h
index 3425bfe..f1ab0f2 100644
--- a/include/spatialindex/capi/DataStream.h
+++ b/include/spatialindex/capi/DataStream.h
@@ -28,17 +28,19 @@
  
 #pragma once
 
-class DataStream : public SpatialIndex::IDataStream
+#include "sidx_export.h"
+
+class SIDX_DLL DataStream : public SpatialIndex::IDataStream
 {
 public:
     DataStream(int (*readNext)(SpatialIndex::id_type* id, double **pMin, double **pMax, uint32_t *nDimension, const uint8_t **pData, uint32_t *nDataLength));
     ~DataStream();
 
     SpatialIndex::IData* getNext();
-    bool hasNext() throw (Tools::NotSupportedException);
+    bool hasNext();
 
-    uint32_t size() throw (Tools::NotSupportedException);
-    void rewind() throw (Tools::NotSupportedException);
+    uint32_t size();
+    void rewind();
 
 protected:
     SpatialIndex::RTree::Data* m_pNext;
diff --git a/include/spatialindex/capi/Error.h b/include/spatialindex/capi/Error.h
index 1675fff..e8cc647 100644
--- a/include/spatialindex/capi/Error.h
+++ b/include/spatialindex/capi/Error.h
@@ -28,7 +28,9 @@
 
 #pragma once
 
-class Error
+#include "sidx_export.h"
+
+class SIDX_DLL Error
 {
 public:
 
diff --git a/include/spatialindex/capi/IdVisitor.h b/include/spatialindex/capi/IdVisitor.h
index 723791c..9596805 100644
--- a/include/spatialindex/capi/IdVisitor.h
+++ b/include/spatialindex/capi/IdVisitor.h
@@ -28,7 +28,9 @@
 
 #pragma once
 
-class IdVisitor : public SpatialIndex::IVisitor
+#include "sidx_export.h"
+
+class SIDX_DLL IdVisitor : public SpatialIndex::IVisitor
 {
 private:
     std::vector<uint64_t> m_vector;
diff --git a/include/spatialindex/capi/Index.h b/include/spatialindex/capi/Index.h
index f0e9c90..70a1fd5 100644
--- a/include/spatialindex/capi/Index.h
+++ b/include/spatialindex/capi/Index.h
@@ -6,7 +6,7 @@
  * Copyright (c) 2009, Howard Butler
  *
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
@@ -28,39 +28,51 @@
 
 #pragma once
 
-class Index
+#include "sidx_export.h"
+
+class SIDX_DLL Index
 {
 
 public:
-    Index(const Tools::PropertySet& poProperties);
-    Index(const Tools::PropertySet& poProperties, int (*readNext)(SpatialIndex::id_type *id, double **pMin, double **pMax, uint32_t *nDimension, const uint8_t **pData, uint32_t *nDataLength));
+    Index(Tools::PropertySet& poProperties);
+    Index(Tools::PropertySet& poProperties, int (*readNext)(SpatialIndex::id_type *id, double **pMin, double **pMax, uint32_t *nDimension, const uint8_t **pData, uint32_t *nDataLength));
     ~Index();
 
     const Tools::PropertySet& GetProperties() { return m_properties; }
 
     bool insertFeature(uint64_t id, double *min, double *max);
-    
+
     RTIndexType GetIndexType();
     void SetIndexType(RTIndexType v);
 
     RTStorageType GetIndexStorage();
     void SetIndexStorage(RTStorageType v);
-    
+
     RTIndexVariant GetIndexVariant();
     void SetIndexVariant(RTStorageType v);
-    
+
+    int64_t GetResultSetOffset();
+    void SetResultSetOffset(int64_t v);
+
+    int64_t GetResultSetLimit();
+    void SetResultSetLimit(int64_t v);
+
+    void flush();
+
     SpatialIndex::ISpatialIndex& index() {return *m_rtree;}
     SpatialIndex::StorageManager::IBuffer& buffer() {return *m_buffer;}
 
 private:
 
+    Index& operator=(const Index&);
+    Index();
+    
     void Initialize();
     SpatialIndex::IStorageManager* m_storage;
     SpatialIndex::StorageManager::IBuffer* m_buffer;
     SpatialIndex::ISpatialIndex* m_rtree;
-    
-    Tools::PropertySet m_properties;
 
+    Tools::PropertySet& m_properties;
 
     void Setup();
     SpatialIndex::IStorageManager* CreateStorage();
diff --git a/include/spatialindex/capi/LeafQuery.h b/include/spatialindex/capi/LeafQuery.h
index 008f09a..9f30a0f 100644
--- a/include/spatialindex/capi/LeafQuery.h
+++ b/include/spatialindex/capi/LeafQuery.h
@@ -28,9 +28,11 @@
 
 #pragma once
 
+#include "sidx_export.h"
+
 class LeafQueryResult;
 
-class LeafQuery : public SpatialIndex::IQueryStrategy
+class SIDX_DLL LeafQuery : public SpatialIndex::IQueryStrategy
 {
 private:
 	std::queue<SpatialIndex::id_type> m_ids;
@@ -45,15 +47,15 @@ public:
 	std::vector<LeafQueryResult> const& GetResults() const {return m_results;}
 };
 
-class LeafQueryResult 
+class SIDX_DLL LeafQueryResult 
 {
 private:
     std::vector<SpatialIndex::id_type> ids;
     SpatialIndex::Region* bounds;
-    uint32_t m_id;
+    SpatialIndex::id_type m_id;
     LeafQueryResult();
 public:
-    LeafQueryResult(uint32_t id) : bounds(0), m_id(id){}
+    LeafQueryResult(SpatialIndex::id_type id) : bounds(0), m_id(id){}
     ~LeafQueryResult() {if (bounds!=0) delete bounds;}
 
     /// Copy constructor.
@@ -66,6 +68,6 @@ public:
     void SetIDs(std::vector<SpatialIndex::id_type>& v);
     const SpatialIndex::Region* GetBounds() const;
     void SetBounds(const SpatialIndex::Region*  b);
-    uint32_t getIdentifier() const {return m_id;}
+    SpatialIndex::id_type getIdentifier() const {return m_id;}
     void setIdentifier(uint32_t v) {m_id = v;}
 };
diff --git a/include/spatialindex/capi/ObjVisitor.h b/include/spatialindex/capi/ObjVisitor.h
index 23234d9..2c27d5a 100644
--- a/include/spatialindex/capi/ObjVisitor.h
+++ b/include/spatialindex/capi/ObjVisitor.h
@@ -28,7 +28,9 @@
 
 #pragma once
 
-class ObjVisitor : public SpatialIndex::IVisitor
+#include "sidx_export.h"
+
+class SIDX_DLL ObjVisitor : public SpatialIndex::IVisitor
 {
 private:
     std::vector<SpatialIndex::IData*> m_vector;
@@ -39,7 +41,7 @@ public:
     ObjVisitor();
     ~ObjVisitor();
 
-    uint32_t GetResultCount() const { return nResults; }
+    uint64_t GetResultCount() const { return nResults; }
     std::vector<SpatialIndex::IData*>& GetResults()  { return m_vector; }
     
     void visitNode(const SpatialIndex::INode& n);
diff --git a/include/spatialindex/capi/Utility.h b/include/spatialindex/capi/Utility.h
index 2b82d02..9962ceb 100644
--- a/include/spatialindex/capi/Utility.h
+++ b/include/spatialindex/capi/Utility.h
@@ -6,7 +6,7 @@
  * Copyright (c) 2009, Howard Butler
  *
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
@@ -26,7 +26,13 @@
  * DEALINGS IN THE SOFTWARE.
 ******************************************************************************/
 
+#include "ObjVisitor.h"
+#include "IdVisitor.h"
+#include "sidx_export.h"
 
 #pragma once
 
-Tools::PropertySet* GetDefaults();
+SIDX_DLL Tools::PropertySet* GetDefaults();
+
+SIDX_DLL void Page_ResultSet_Ids(IdVisitor& visitor, int64_t** ids, int64_t nStart, int64_t nResultLimit, uint64_t* nResults);
+SIDX_DLL void Page_ResultSet_Obj(ObjVisitor& visitor, IndexItemH** items, int64_t nStart, int64_t nResultLimit, uint64_t* nResults);
diff --git a/include/spatialindex/capi/sidx_api.h b/include/spatialindex/capi/sidx_api.h
index 4bf251c..a912a9e 100644
--- a/include/spatialindex/capi/sidx_api.h
+++ b/include/spatialindex/capi/sidx_api.h
@@ -6,7 +6,7 @@
  * Copyright (c) 2009, Howard Butler
  *
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
@@ -44,53 +44,194 @@ SIDX_DLL IndexH Index_CreateWithStream( IndexPropertyH properties,
 SIDX_DLL void Index_Destroy(IndexH index);
 SIDX_DLL IndexPropertyH Index_GetProperties(IndexH index);
 
-SIDX_DLL RTError Index_DeleteData(	IndexH index, 
-									int64_t id, 
-									double* pdMin, 
-									double* pdMax, 
+SIDX_DLL RTError Index_DeleteData(	IndexH index,
+									int64_t id,
+									double* pdMin,
+									double* pdMax,
 									uint32_t nDimension);
-							
-SIDX_DLL RTError Index_InsertData(	IndexH index, 
-									int64_t id, 
-									double* pdMin, 
-									double* pdMax, 
-									uint32_t nDimension, 
-									const uint8_t* pData, 
+
+SIDX_C_DLL RTError Index_DeleteTPData( IndexH index,
+                  int64_t id,
+                  double* pdMin,
+                  double* pdMax,
+                  double* pdVMin,
+                  double* pdVMax,
+                  double tStart,
+                  double tEnd,
+                  uint32_t nDimension
+                  );
+
+SIDX_C_DLL RTError Index_DeleteMVRData( IndexH index,
+									int64_t id,
+									double* pdMin,
+									double* pdMax,
+									double tStart,
+									double tEnd,
+									uint32_t nDimension
+									);
+
+SIDX_DLL RTError Index_InsertData(	IndexH index,
+									int64_t id,
+									double* pdMin,
+									double* pdMax,
+									uint32_t nDimension,
+									const uint8_t* pData,
 									size_t nDataLength);
-							
+
+SIDX_C_DLL RTError Index_InsertTPData( IndexH index,
+  int64_t id,
+  double* pdMin,
+  double* pdMax,
+  double* pdVMin,
+  double* pdVMax,
+  double tStart,
+  double tEnd,
+  uint32_t nDimension,
+  const uint8_t* pData,
+  size_t nDataLength);
+
+SIDX_C_DLL RTError Index_InsertMVRData( IndexH index,
+	int64_t id,
+	double* pdMin,
+	double* pdMax,
+	double tStart,
+	double tEnd,
+	uint32_t nDimension,
+	const uint8_t* pData,
+	size_t nDataLength);
+
 SIDX_DLL uint32_t Index_IsValid(IndexH index);
 
-SIDX_DLL RTError Index_Intersects_obj(	IndexH index, 
-										double* pdMin, 
-										double* pdMax, 
-										uint32_t nDimension, 
-										IndexItemH** items, 
+SIDX_C_DLL RTError Index_TPIntersects_obj(  IndexH index,
+                    double* pdMin,
+                    double* pdMax,
+                    double* pdVMin,
+                    double* pdVMax,
+                    double tStart,
+                    double tEnd,
+                    uint32_t nDimension,
+                    IndexItemH** items,
+                    uint64_t* nResults);
+
+SIDX_C_DLL RTError Index_MVRIntersects_obj(  IndexH index,
+										double* pdMin,
+										double* pdMax,
+										double tStart,
+										double tEnd,
+										uint32_t nDimension,
+										IndexItemH** items,
+										uint64_t* nResults);
+
+SIDX_DLL RTError Index_Intersects_obj(	IndexH index,
+										double* pdMin,
+										double* pdMax,
+										uint32_t nDimension,
+										IndexItemH** items,
 										uint64_t* nResults);
 
-SIDX_DLL RTError Index_Intersects_id(	IndexH index, 
-										double* pdMin, 
-										double* pdMax, 
-										uint32_t nDimension, 
-										int64_t** items, 
+SIDX_C_DLL RTError Index_TPIntersects_id(  IndexH index,
+                    double* pdMin,
+                    double* pdMax,
+                    double* pdVMin,
+                    double* pdVMax,
+                    double tStart,
+                    double tEnd,
+                    uint32_t nDimension,
+                    int64_t** ids,
+                    uint64_t* nResults);
+
+SIDX_C_DLL RTError Index_MVRIntersects_id(  IndexH index,
+										double* pdMin,
+										double* pdMax,
+										double tStart,
+										double tEnd,
+										uint32_t nDimension,
+										int64_t** ids,
 										uint64_t* nResults);
-										
-SIDX_DLL RTError Index_Intersects_count(	IndexH index, 
-										double* pdMin, 
-										double* pdMax, 
-										uint32_t nDimension, 
+
+SIDX_DLL RTError Index_Intersects_id(	IndexH index,
+										double* pdMin,
+										double* pdMax,
+										uint32_t nDimension,
+										int64_t** items,
+										uint64_t* nResults);
+
+SIDX_C_DLL RTError Index_TPIntersects_count(	  IndexH index,
+                    double* pdMin,
+                    double* pdMax,
+                    double* pdVMin,
+                    double* pdVMax,
+                    double tStart,
+                    double tEnd,
+                    uint32_t nDimension,
+                    uint64_t* nResults);
+
+SIDX_C_DLL RTError Index_MVRIntersects_count(	  IndexH index,
+										double* pdMin,
+										double* pdMax,
+										double tStart,
+										double tEnd,
+										uint32_t nDimension,
+										uint64_t* nResults);
+
+SIDX_DLL RTError Index_Intersects_count(	IndexH index,
+										double* pdMin,
+										double* pdMax,
+										uint32_t nDimension,
 										uint64_t* nResults);
-SIDX_DLL RTError Index_NearestNeighbors_obj(IndexH index, 
-											double* pdMin, 
-											double* pdMax, 
-											uint32_t nDimension, 
-											IndexItemH** items, 
+
+SIDX_C_DLL RTError Index_TPNearestNeighbors_obj(IndexH index,
+                      double* pdMin,
+                      double* pdMax,
+                      double* pdVMin,
+                      double* pdVMax,
+                      double tStart,
+                      double tEnd,
+                      uint32_t nDimension,
+                      IndexItemH** items,
+                      uint64_t* nResults);
+
+SIDX_C_DLL RTError Index_MVRNearestNeighbors_obj(IndexH index,
+											double* pdMin,
+											double* pdMax,
+											double tStart,
+											double tEnd,
+											uint32_t nDimension,
+											IndexItemH** items,
+											uint64_t* nResults);
+
+SIDX_DLL RTError Index_NearestNeighbors_obj(IndexH index,
+											double* pdMin,
+											double* pdMax,
+											uint32_t nDimension,
+											IndexItemH** items,
+											uint64_t* nResults);
+
+SIDX_C_DLL RTError Index_TPNearestNeighbors_id(IndexH index,
+                      double* pdMin,
+                      double* pdMax,
+                      double* pdVMin,
+                      double* pdVMax,
+                      double tStart,
+                      double tEnd,
+                      uint32_t nDimension,
+                      int64_t** ids,
+                      uint64_t* nResults);
+
+SIDX_C_DLL RTError Index_MVRNearestNeighbors_id(IndexH index,
+											double* pdMin,
+											double* pdMax,
+											double tStart,
+											double tEnd,
+											uint32_t nDimension,
+											int64_t** ids,
 											uint64_t* nResults);
 
-SIDX_DLL RTError Index_NearestNeighbors_id( IndexH index, 
-											double* pdMin, 
-											double* pdMax, 
-											uint32_t nDimension, 
-											int64_t** items, 
+SIDX_DLL RTError Index_NearestNeighbors_id( IndexH index,
+											double* pdMin,
+											double* pdMax,
+											uint32_t nDimension,
+											int64_t** items,
 											uint64_t* nResults);
 
 SIDX_DLL RTError Index_GetBounds(	IndexH index,
@@ -99,18 +240,25 @@ SIDX_DLL RTError Index_GetBounds(	IndexH index,
 									uint32_t* nDimension);
 
 
-SIDX_C_DLL RTError Index_GetLeaves( IndexH index, 
+SIDX_C_DLL RTError Index_GetLeaves( IndexH index,
 									uint32_t* nLeafNodes,
-									uint32_t** nLeafSizes, 
-									int64_t** nLeafIDs, 
+									uint32_t** nLeafSizes,
+									int64_t** nLeafIDs,
 									int64_t*** nLeafChildIDs,
-									double*** pppdMin, 
-									double*** pppdMax, 
+									double*** pppdMin,
+									double*** pppdMax,
 									uint32_t* nDimension);
 
+SIDX_DLL RTError Index_SetResultSetOffset(IndexH index, int64_t value);
+SIDX_DLL int64_t Index_GetResultSetOffset(IndexH index);
+
+SIDX_DLL RTError Index_SetResultSetLimit(IndexH index, int64_t value);
+SIDX_DLL int64_t Index_GetResultSetLimit(IndexH index);
+
 SIDX_DLL void Index_DestroyObjResults(IndexItemH* results, uint32_t nResults);
 SIDX_DLL void Index_ClearBuffer(IndexH index);
 SIDX_DLL void Index_Free(void* object);
+SIDX_DLL void Index_Flush(IndexH index);
 
 SIDX_DLL void IndexItem_Destroy(IndexItemH item);
 SIDX_DLL int64_t IndexItem_GetID(IndexItemH item);
@@ -121,7 +269,7 @@ SIDX_DLL RTError IndexItem_GetBounds(	IndexItemH item,
 										double** ppdMin,
 										double** ppdMax,
 										uint32_t* nDimension);
-									
+
 SIDX_DLL IndexPropertyH IndexProperty_Create();
 SIDX_DLL void IndexProperty_Destroy(IndexPropertyH hProp);
 
@@ -206,8 +354,13 @@ SIDX_DLL int64_t IndexProperty_GetIndexID(IndexPropertyH iprop);
 SIDX_C_DLL void* SIDX_NewBuffer(size_t bytes);
 SIDX_C_DLL void  SIDX_DeleteBuffer(void* buffer);
 
+SIDX_DLL RTError IndexProperty_SetResultSetLimit(IndexPropertyH iprop, uint64_t value);
+SIDX_DLL uint64_t IndexProperty_GetResultSetLimit(IndexPropertyH iprop);
+
 SIDX_C_DLL char* SIDX_Version();
 
+SIDX_C_DLL char* Error_GetLastErrorMsg(void);
+
 IDX_C_END
 
-#endif
\ No newline at end of file
+#endif
diff --git a/include/spatialindex/capi/sidx_config.h b/include/spatialindex/capi/sidx_config.h
index 1bf32bd..8f3764c 100644
--- a/include/spatialindex/capi/sidx_config.h
+++ b/include/spatialindex/capi/sidx_config.h
@@ -59,7 +59,7 @@
 
 #include <sys/stat.h>
 
-
+#include "sidx_export.h"
 
 class Item;
 class Index;
@@ -110,17 +110,6 @@ typedef Index *IndexH;
 typedef SpatialIndex::IData *IndexItemH;
 typedef Tools::PropertySet *IndexPropertyH;
 
-#ifndef SIDX_C_DLL
-#if defined(_MSC_VER)
-#  define SIDX_C_DLL     __declspec(dllexport)
-#else
-#  if defined(USE_GCC_VISIBILITY_FLAG)
-#    define SIDX_C_DLL     __attribute__ ((visibility("default")))
-#  else
-#    define SIDX_C_DLL
-#  endif
-#endif
-#endif
 
 
 #endif
diff --git a/include/spatialindex/capi/Utility.h b/include/spatialindex/capi/sidx_export.h
similarity index 78%
copy from include/spatialindex/capi/Utility.h
copy to include/spatialindex/capi/sidx_export.h
index 2b82d02..b6c84f1 100644
--- a/include/spatialindex/capi/Utility.h
+++ b/include/spatialindex/capi/sidx_export.h
@@ -3,7 +3,7 @@
  * Purpose:  C++ object declarations to implement utilities.
  * Author:   Howard Butler, hobu.inc at gmail.com
  ******************************************************************************
- * Copyright (c) 2009, Howard Butler
+ * Copyright (c) 2014, Howard Butler
  *
  * All rights reserved.
  * 
@@ -26,7 +26,19 @@
  * DEALINGS IN THE SOFTWARE.
 ******************************************************************************/
 
-
 #pragma once
 
-Tools::PropertySet* GetDefaults();
+#ifndef SIDX_C_DLL
+#if defined(_MSC_VER)
+#  define SIDX_C_DLL     __declspec(dllexport)
+#  define SIDX_DLL     __declspec(dllexport)
+#else
+#  if defined(USE_GCC_VISIBILITY_FLAG)
+#    define SIDX_C_DLL     __attribute__ ((visibility("default")))
+#    define SIDX_DLL     __attribute__ ((visibility("default")))
+#  else
+#    define SIDX_C_DLL
+#    define SIDX_DLL
+#  endif
+#endif
+#endif
diff --git a/include/spatialindex/tools/Tools.h b/include/spatialindex/tools/Tools.h
index ca6e96a..cd18d12 100644
--- a/include/spatialindex/tools/Tools.h
+++ b/include/spatialindex/tools/Tools.h
@@ -1,507 +1,507 @@
-/******************************************************************************
- * Project:  libspatialindex - A C++ library for spatial indexing
- * Author:   Marios Hadjieleftheriou, mhadji at gmail.com
- ******************************************************************************
- * Copyright (c) 2004, Marios Hadjieleftheriou
- *
- * All rights reserved.
- * 
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
-******************************************************************************/
-
-#pragma once
-
-
-#if (defined _WIN32 || defined _WIN64 || defined WIN32 || defined WIN64) && !defined __GNUC__
-  typedef __int8 int8_t;
-  typedef __int16 int16_t;
-  typedef __int32 int32_t;
-  typedef __int64 int64_t;
-  typedef unsigned __int8 uint8_t;
-  typedef unsigned __int16 uint16_t;
-  typedef unsigned __int32 uint32_t;
-  typedef unsigned __int64 uint64_t;
-
-// Nuke this annoying warning.  See http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html
-#pragma warning( disable: 4251 )
-
-#else
-  #include <stdint.h>
-#endif
-
-#if (defined _WIN32 || defined _WIN64 || defined WIN32 || defined WIN64) && !defined __GNUC__
-  #ifdef SPATIALINDEX_CREATE_DLL
-    #define SIDX_DLL __declspec(dllexport)
-  #else
-    #define SIDX_DLL __declspec(dllimport)
-  #endif
-#else
-  #define SIDX_DLL
-#endif
-
-#include <assert.h>
-#include <iostream>
-#include <iomanip>
-#include <iterator>
-#include <string>
-#include <sstream>
-#include <fstream>
-#include <queue>
-#include <vector>
-#include <map>
-#include <set>
-#include <stack>
-#include <list>
-#include <algorithm>
-// #include <cmath>
-// #include <limits>
-// #include <climits>
-
-#if HAVE_PTHREAD_H
-  #include <pthread.h>
-#endif
-
-#include "SmartPointer.h"
-#include "PointerPool.h"
-#include "PoolPointer.h"
-
-typedef uint8_t byte;
-
-namespace Tools
-{
-	SIDX_DLL enum IntervalType
-	{
-		IT_RIGHTOPEN = 0x0,
-		IT_LEFTOPEN,
-		IT_OPEN,
-		IT_CLOSED
-	};
-
-	SIDX_DLL enum VariantType
-	{
-		VT_LONG = 0x0,
-		VT_BYTE,
-		VT_SHORT,
-		VT_FLOAT,
-		VT_DOUBLE,
-		VT_CHAR,
-		VT_USHORT,
-		VT_ULONG,
-		VT_INT,
-		VT_UINT,
-		VT_BOOL,
-		VT_PCHAR,
-		VT_PVOID,
-		VT_EMPTY,
-		VT_LONGLONG,
-		VT_ULONGLONG
-	};
-
-	SIDX_DLL enum FileMode
-	{
-		APPEND = 0x0,
-		CREATE
-	};
-
-	//
-	// Exceptions
-	//
-	class SIDX_DLL Exception
-	{
-	public:
-		virtual std::string what() = 0;
-		virtual ~Exception() {}
-	};
-
-	class SIDX_DLL IndexOutOfBoundsException : public Exception
-	{
-	public:
-		IndexOutOfBoundsException(size_t i);
-		virtual ~IndexOutOfBoundsException() {}
-		virtual std::string what();
-
-	private:
-		std::string m_error;
-	}; // IndexOutOfBoundsException
-
-	class SIDX_DLL IllegalArgumentException : public Exception
-	{
-	public:
-		IllegalArgumentException(std::string s);
-		virtual ~IllegalArgumentException() {}
-		virtual std::string what();
-
-	private:
-		std::string m_error;
-	}; // IllegalArgumentException
-
-	class SIDX_DLL IllegalStateException : public Exception
-	{
-	public:
-		IllegalStateException(std::string s);
-		virtual ~IllegalStateException() {}
-		virtual std::string what();
-
-	private:
-		std::string m_error;
-	}; // IllegalStateException
-
-	class SIDX_DLL EndOfStreamException : public Exception
-	{
-	public:
-		EndOfStreamException(std::string s);
-		virtual ~EndOfStreamException() {}
-		virtual std::string what();
-
-	private:
-		std::string m_error;
-	}; // EndOfStreamException
-
-	class SIDX_DLL ResourceLockedException : public Exception
-	{
-	public:
-		ResourceLockedException(std::string s);
-		virtual ~ResourceLockedException() {}
-		virtual std::string what();
-
-	private:
-		std::string m_error;
-	}; // ResourceLockedException
-
-	class SIDX_DLL NotSupportedException : public Exception
-	{
-	public:
-		NotSupportedException(std::string s);
-		virtual ~NotSupportedException() {}
-		virtual std::string what();
-
-	private:
-		std::string m_error;
-	}; // NotSupportedException
-
-	//
-	// Interfaces
-	//
-	class SIDX_DLL IInterval
-	{
-	public:
-		virtual ~IInterval() {}
-
-		virtual double getLowerBound() const = 0;
-		virtual double getUpperBound() const = 0;
-		virtual void setBounds(double, double) = 0;
-		virtual bool intersectsInterval(const IInterval&) const = 0;
-		virtual bool intersectsInterval(IntervalType type, const double start, const double end) const = 0;
-		virtual bool containsInterval(const IInterval&) const = 0;
-		virtual IntervalType getIntervalType() const = 0;
-	}; // IInterval
-
-	class SIDX_DLL IObject
-	{
-	public:
-		virtual ~IObject() {}
-
-		virtual IObject* clone() = 0;
-			// return a new object that is an exact copy of this one.
-			// IMPORTANT: do not return the this pointer!
-	}; // IObject
-
-	class SIDX_DLL ISerializable
-	{
-	public:
-		virtual ~ISerializable() {}
-
-		virtual uint32_t getByteArraySize() = 0;
-			// returns the size of the required byte array.
-		virtual void loadFromByteArray(const byte* data) = 0;
-			// load this object using the byte array.
-		virtual void storeToByteArray(byte** data, uint32_t& length) = 0;
-			// store this object in the byte array.
-	};
-
-	class SIDX_DLL IComparable
-	{
-	public:
-		virtual ~IComparable() {}
-
-		virtual bool operator<(const IComparable& o) const = 0;
-		virtual bool operator>(const IComparable& o) const = 0;
-		virtual bool operator==(const IComparable& o) const = 0;
-	}; //IComparable
-
-	class SIDX_DLL IObjectComparator
-	{
-	public:
-		virtual ~IObjectComparator() {}
-
-		virtual int compare(IObject* o1, IObject* o2) = 0;
-	}; // IObjectComparator
-
-	class SIDX_DLL IObjectStream
-	{
-	public:
-		virtual ~IObjectStream() {}
-
-		virtual IObject* getNext() = 0;
-			// returns a pointer to the next entry in the
-			// stream or 0 at the end of the stream.
-
-		virtual bool hasNext() = 0;
-			// returns true if there are more items in the stream.
-
-		virtual uint32_t size() = 0;
-			// returns the total number of entries available in the stream.
-
-		virtual void rewind() = 0;
-			// sets the stream pointer to the first entry, if possible.
-	}; // IObjectStream
-
-	//
-	// Classes & Functions
-	//
-
-	class SIDX_DLL Variant
-	{
-	public:
-		Variant();
-
-		VariantType m_varType;
-
-		union
-		{
-			int16_t iVal;              // VT_SHORT
-			int32_t lVal;              // VT_LONG
-			int64_t llVal;             // VT_LONGLONG
-			byte bVal;                 // VT_BYTE
-			float fltVal;              // VT_FLOAT
-			double dblVal;             // VT_DOUBLE
-			char cVal;                 // VT_CHAR
-			uint16_t uiVal;            // VT_USHORT
-			uint32_t ulVal;            // VT_ULONG
-			uint64_t ullVal;           // VT_ULONGLONG
-			bool blVal;                // VT_BOOL
-			char* pcVal;               // VT_PCHAR
-			void* pvVal;               // VT_PVOID
-		} m_val;
-	}; // Variant
-
-	class SIDX_DLL PropertySet;
-	SIDX_DLL std::ostream& operator<<(std::ostream& os, const Tools::PropertySet& p);
-
-	class SIDX_DLL PropertySet : public ISerializable
-	{
-	public:
-		PropertySet();
-		PropertySet(const byte* data);
-		virtual ~PropertySet();
-
-		Variant getProperty(std::string property);
-		void setProperty(std::string property, Variant& v);
-		void removeProperty(std::string property);
-
-		virtual uint32_t getByteArraySize();
-		virtual void loadFromByteArray(const byte* data);
-		virtual void storeToByteArray(byte** data, uint32_t& length);
-
-	private:
-		std::map<std::string, Variant> m_propertySet;
-#ifdef HAVE_PTHREAD_H
-			pthread_rwlock_t m_rwLock;
-#else
-			bool m_rwLock;
-#endif
-		friend SIDX_DLL std::ostream& Tools::operator<<(std::ostream& os, const Tools::PropertySet& p);
-	}; // PropertySet
-
-	// does not support degenerate intervals.
-	class SIDX_DLL Interval : public IInterval
-	{
-	public:
-		Interval();
-		Interval(IntervalType, double, double);
-		Interval(double, double);
-		Interval(const Interval&);
-		virtual ~Interval() {}
-		virtual IInterval& operator=(const IInterval&);
-
-		virtual bool operator==(const Interval&) const;
-		virtual bool operator!=(const Interval&) const;
-		virtual double getLowerBound() const;
-		virtual double getUpperBound() const;
-		virtual void setBounds(double, double);
-		virtual bool intersectsInterval(const IInterval&) const;
-		virtual bool intersectsInterval(IntervalType type, const double start, const double end) const;
-		virtual bool containsInterval(const IInterval&) const;
-		virtual IntervalType getIntervalType() const;
-
-		IntervalType m_type;
-		double m_low;
-		double m_high;
-	}; // Interval
-
-	SIDX_DLL std::ostream& operator<<(std::ostream& os, const Tools::Interval& iv);
-
-	class SIDX_DLL Random
-	{
-	public:
-		Random();
-		Random(uint32_t seed, uint16_t xsubi0);
-		virtual ~Random();
-
-		int32_t nextUniformLong();
-			// returns a uniformly distributed long.
-		uint32_t nextUniformUnsignedLong();
-			// returns a uniformly distributed unsigned long.
-		int32_t nextUniformLong(int32_t low, int32_t high);
-			// returns a uniformly distributed long in the range [low, high).
-		uint32_t nextUniformUnsignedLong(uint32_t low, uint32_t high);
-			// returns a uniformly distributed unsigned long in the range [low, high).
-		int64_t nextUniformLongLong();
-			// returns a uniformly distributed long long.
-		uint64_t nextUniformUnsignedLongLong();
-			// returns a uniformly distributed unsigned long long.
-		int64_t nextUniformLongLong(int64_t low, int64_t high);
-			// returns a uniformly distributed unsigned long long in the range [low, high).
-		uint64_t nextUniformUnsignedLongLong(uint64_t low, uint64_t high);
-			// returns a uniformly distributed unsigned long long in the range [low, high).
-		int16_t nextUniformShort();
-			// returns a uniformly distributed short.
-		uint16_t nextUniformUnsignedShort();
-			// returns a uniformly distributed unsigned short.
-		double nextUniformDouble();
-			// returns a uniformly distributed double in the range [0, 1).
-		double nextUniformDouble(double low, double high);
-			// returns a uniformly distributed double in the range [low, high).
-
-		bool flipCoin();
-
-	private:
-		void initDrand(uint32_t seed, uint16_t xsubi0);
-
-		uint16_t* m_pBuffer;
-	}; // Random
-
-	#if HAVE_PTHREAD_H
-	class SIDX_DLL LockGuard
-	{
-	public:
-		LockGuard(pthread_mutex_t* pLock);
-		~LockGuard();
-
-	private:
-		pthread_mutex_t* m_pLock;
-	}; // LockGuard
-	#endif
-
-	class SIDX_DLL BufferedFile
-	{
-	public:
-		BufferedFile(uint32_t u32BufferSize = 16384);
-		virtual ~BufferedFile();
-
-		virtual void close();
-		virtual bool eof();
-		virtual void rewind() = 0;
-		virtual void seek(std::fstream::off_type offset) = 0;
-
-	protected:
-		std::fstream m_file;
-		char* m_buffer;
-		uint32_t m_u32BufferSize;
-		bool m_bEOF;
-	};
-
-	class SIDX_DLL BufferedFileReader : public BufferedFile
-	{
-	public:
-		BufferedFileReader();
-		BufferedFileReader(const std::string& sFileName, uint32_t u32BufferSize = 32768);
-		virtual ~BufferedFileReader();
-
-		virtual void open(const std::string& sFileName);
-		virtual void rewind();
-		virtual void seek(std::fstream::off_type offset);
-
-		virtual uint8_t readUInt8();
-		virtual uint16_t readUInt16();
-		virtual uint32_t readUInt32();
-		virtual uint64_t readUInt64();
-		virtual float readFloat();
-		virtual double readDouble();
-		virtual bool readBoolean();
-		virtual std::string readString();
-		virtual void readBytes(uint32_t u32Len, byte** pData);
-	};
-
-	class SIDX_DLL BufferedFileWriter : public BufferedFile
-	{
-	public:
-		BufferedFileWriter();
-		BufferedFileWriter(const std::string& sFileName, FileMode mode = CREATE, uint32_t u32BufferSize = 32768);
-		virtual ~BufferedFileWriter();
-
-		virtual void open(const std::string& sFileName, FileMode mode = CREATE);
-		virtual void rewind();
-		virtual void seek(std::fstream::off_type offset);
-
-		virtual void write(uint8_t i);
-		virtual void write(uint16_t i);
-		virtual void write(uint32_t i);
-		virtual void write(uint64_t i);
-		virtual void write(float i);
-		virtual void write(double i);
-		virtual void write(bool b);
-		virtual void write(const std::string& s);
-		virtual void write(uint32_t u32Len, byte* pData);
-	};
-
-	class SIDX_DLL TemporaryFile
-	{
-	public:
-		TemporaryFile();
-		virtual ~TemporaryFile();
-
-		void rewindForReading();
-		void rewindForWriting();
-		bool eof();
-		std::string getFileName() const;
-
-		uint8_t readUInt8();
-		uint16_t readUInt16();
-		uint32_t readUInt32();
-		uint64_t readUInt64();
-		float readFloat();
-		double readDouble();
-		std::string readString();
-		void readBytes(uint32_t u32Len, byte** pData);
-
-		void write(uint8_t i);
-		void write(uint16_t i);
-		void write(uint32_t i);
-		void write(uint64_t i);
-		void write(float i);
-		void write(double i);
-		void write(const std::string& s);
-		void write(uint32_t u32Len, byte* pData);
-
-	private:
-		std::string m_sFile;
-		BufferedFile* m_pFile;
-	};
-}
+/******************************************************************************
+ * Project:  libspatialindex - A C++ library for spatial indexing
+ * Author:   Marios Hadjieleftheriou, mhadji at gmail.com
+ ******************************************************************************
+ * Copyright (c) 2004, Marios Hadjieleftheriou
+ *
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+
+#pragma once
+
+
+#if (defined _WIN32 || defined _WIN64 || defined WIN32 || defined WIN64) && !defined __GNUC__
+  typedef __int8 int8_t;
+  typedef __int16 int16_t;
+  typedef __int32 int32_t;
+  typedef __int64 int64_t;
+  typedef unsigned __int8 uint8_t;
+  typedef unsigned __int16 uint16_t;
+  typedef unsigned __int32 uint32_t;
+  typedef unsigned __int64 uint64_t;
+
+// Nuke this annoying warning.  See http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html
+#pragma warning( disable: 4251 )
+
+#else
+  #include <stdint.h>
+#endif
+
+#if (defined _WIN32 || defined _WIN64 || defined WIN32 || defined WIN64) && !defined __GNUC__
+  #ifdef SPATIALINDEX_CREATE_DLL
+    #define SIDX_DLL __declspec(dllexport)
+  #else
+    #define SIDX_DLL __declspec(dllimport)
+  #endif
+#else
+  #define SIDX_DLL
+#endif
+
+#include <assert.h>
+#include <iostream>
+#include <iomanip>
+#include <iterator>
+#include <string>
+#include <sstream>
+#include <fstream>
+#include <queue>
+#include <vector>
+#include <map>
+#include <set>
+#include <stack>
+#include <list>
+#include <algorithm>
+#include <cwchar>
+
+#if HAVE_PTHREAD_H
+  #include <pthread.h>
+#endif
+
+#include "SmartPointer.h"
+#include "PointerPool.h"
+#include "PoolPointer.h"
+
+typedef uint8_t byte;
+
+namespace Tools
+{
+	SIDX_DLL enum IntervalType
+	{
+		IT_RIGHTOPEN = 0x0,
+		IT_LEFTOPEN,
+		IT_OPEN,
+		IT_CLOSED
+	};
+
+	SIDX_DLL enum VariantType
+	{
+		VT_LONG = 0x0,
+		VT_BYTE,
+		VT_SHORT,
+		VT_FLOAT,
+		VT_DOUBLE,
+		VT_CHAR,
+		VT_USHORT,
+		VT_ULONG,
+		VT_INT,
+		VT_UINT,
+		VT_BOOL,
+		VT_PCHAR,
+		VT_PVOID,
+		VT_EMPTY,
+		VT_LONGLONG,
+		VT_ULONGLONG,
+        VT_PWCHAR
+    };
+
+	SIDX_DLL enum FileMode
+	{
+		APPEND = 0x0,
+		CREATE
+	};
+
+	//
+	// Exceptions
+	//
+	class SIDX_DLL Exception
+	{
+	public:
+		virtual std::string what() = 0;
+		virtual ~Exception() {}
+	};
+
+	class SIDX_DLL IndexOutOfBoundsException : public Exception
+	{
+	public:
+		IndexOutOfBoundsException(size_t i);
+		virtual ~IndexOutOfBoundsException() {}
+		virtual std::string what();
+
+	private:
+		std::string m_error;
+	}; // IndexOutOfBoundsException
+
+	class SIDX_DLL IllegalArgumentException : public Exception
+	{
+	public:
+		IllegalArgumentException(std::string s);
+		virtual ~IllegalArgumentException() {}
+		virtual std::string what();
+
+	private:
+		std::string m_error;
+	}; // IllegalArgumentException
+
+	class SIDX_DLL IllegalStateException : public Exception
+	{
+	public:
+		IllegalStateException(std::string s);
+		virtual ~IllegalStateException() {}
+		virtual std::string what();
+
+	private:
+		std::string m_error;
+	}; // IllegalStateException
+
+	class SIDX_DLL EndOfStreamException : public Exception
+	{
+	public:
+		EndOfStreamException(std::string s);
+		virtual ~EndOfStreamException() {}
+		virtual std::string what();
+
+	private:
+		std::string m_error;
+	}; // EndOfStreamException
+
+	class SIDX_DLL ResourceLockedException : public Exception
+	{
+	public:
+		ResourceLockedException(std::string s);
+		virtual ~ResourceLockedException() {}
+		virtual std::string what();
+
+	private:
+		std::string m_error;
+	}; // ResourceLockedException
+
+	class SIDX_DLL NotSupportedException : public Exception
+	{
+	public:
+		NotSupportedException(std::string s);
+		virtual ~NotSupportedException() {}
+		virtual std::string what();
+
+	private:
+		std::string m_error;
+	}; // NotSupportedException
+
+	//
+	// Interfaces
+	//
+	class SIDX_DLL IInterval
+	{
+	public:
+		virtual ~IInterval() {}
+
+		virtual double getLowerBound() const = 0;
+		virtual double getUpperBound() const = 0;
+		virtual void setBounds(double, double) = 0;
+		virtual bool intersectsInterval(const IInterval&) const = 0;
+		virtual bool intersectsInterval(IntervalType type, const double start, const double end) const = 0;
+		virtual bool containsInterval(const IInterval&) const = 0;
+		virtual IntervalType getIntervalType() const = 0;
+	}; // IInterval
+
+	class SIDX_DLL IObject
+	{
+	public:
+		virtual ~IObject() {}
+
+		virtual IObject* clone() = 0;
+			// return a new object that is an exact copy of this one.
+			// IMPORTANT: do not return the this pointer!
+	}; // IObject
+
+	class SIDX_DLL ISerializable
+	{
+	public:
+		virtual ~ISerializable() {}
+
+		virtual uint32_t getByteArraySize() = 0;
+			// returns the size of the required byte array.
+		virtual void loadFromByteArray(const byte* data) = 0;
+			// load this object using the byte array.
+		virtual void storeToByteArray(byte** data, uint32_t& length) = 0;
+			// store this object in the byte array.
+	};
+
+	class SIDX_DLL IComparable
+	{
+	public:
+		virtual ~IComparable() {}
+
+		virtual bool operator<(const IComparable& o) const = 0;
+		virtual bool operator>(const IComparable& o) const = 0;
+		virtual bool operator==(const IComparable& o) const = 0;
+	}; //IComparable
+
+	class SIDX_DLL IObjectComparator
+	{
+	public:
+		virtual ~IObjectComparator() {}
+
+		virtual int compare(IObject* o1, IObject* o2) = 0;
+	}; // IObjectComparator
+
+	class SIDX_DLL IObjectStream
+	{
+	public:
+		virtual ~IObjectStream() {}
+
+		virtual IObject* getNext() = 0;
+			// returns a pointer to the next entry in the
+			// stream or 0 at the end of the stream.
+
+		virtual bool hasNext() = 0;
+			// returns true if there are more items in the stream.
+
+		virtual uint32_t size() = 0;
+			// returns the total number of entries available in the stream.
+
+		virtual void rewind() = 0;
+			// sets the stream pointer to the first entry, if possible.
+	}; // IObjectStream
+
+	//
+	// Classes & Functions
+	//
+
+	class SIDX_DLL Variant
+	{
+	public:
+		Variant();
+
+		VariantType m_varType;
+
+		union
+		{
+			int16_t iVal;              // VT_SHORT
+			int32_t lVal;              // VT_LONG
+			int64_t llVal;             // VT_LONGLONG
+			byte bVal;                 // VT_BYTE
+			float fltVal;              // VT_FLOAT
+			double dblVal;             // VT_DOUBLE
+			char cVal;                 // VT_CHAR
+			uint16_t uiVal;            // VT_USHORT
+			uint32_t ulVal;            // VT_ULONG
+			uint64_t ullVal;           // VT_ULONGLONG
+			bool blVal;                // VT_BOOL
+			char* pcVal;               // VT_PCHAR
+			void* pvVal;               // VT_PVOID
+            wchar_t* pwcVal;
+		} m_val;
+	}; // Variant
+
+	class SIDX_DLL PropertySet;
+	SIDX_DLL std::ostream& operator<<(std::ostream& os, const Tools::PropertySet& p);
+
+	class SIDX_DLL PropertySet : public ISerializable
+	{
+	public:
+		PropertySet();
+		PropertySet(const byte* data);
+		virtual ~PropertySet();
+
+		Variant getProperty(std::string property) const;
+		void setProperty(std::string property, Variant const& v);
+		void removeProperty(std::string property);
+
+		virtual uint32_t getByteArraySize();
+		virtual void loadFromByteArray(const byte* data);
+		virtual void storeToByteArray(byte** data, uint32_t& length);
+
+	private:
+		std::map<std::string, Variant> m_propertySet;
+// #ifdef HAVE_PTHREAD_H
+//             pthread_rwlock_t m_rwLock;
+// #else
+//             bool m_rwLock;
+// #endif
+		friend SIDX_DLL std::ostream& Tools::operator<<(std::ostream& os, const Tools::PropertySet& p);
+	}; // PropertySet
+
+	// does not support degenerate intervals.
+	class SIDX_DLL Interval : public IInterval
+	{
+	public:
+		Interval();
+		Interval(IntervalType, double, double);
+		Interval(double, double);
+		Interval(const Interval&);
+		virtual ~Interval() {}
+		virtual IInterval& operator=(const IInterval&);
+
+		virtual bool operator==(const Interval&) const;
+		virtual bool operator!=(const Interval&) const;
+		virtual double getLowerBound() const;
+		virtual double getUpperBound() const;
+		virtual void setBounds(double, double);
+		virtual bool intersectsInterval(const IInterval&) const;
+		virtual bool intersectsInterval(IntervalType type, const double start, const double end) const;
+		virtual bool containsInterval(const IInterval&) const;
+		virtual IntervalType getIntervalType() const;
+
+		IntervalType m_type;
+		double m_low;
+		double m_high;
+	}; // Interval
+
+	SIDX_DLL std::ostream& operator<<(std::ostream& os, const Tools::Interval& iv);
+
+	class SIDX_DLL Random
+	{
+	public:
+		Random();
+		Random(uint32_t seed, uint16_t xsubi0);
+		virtual ~Random();
+
+		int32_t nextUniformLong();
+			// returns a uniformly distributed long.
+		uint32_t nextUniformUnsignedLong();
+			// returns a uniformly distributed unsigned long.
+		int32_t nextUniformLong(int32_t low, int32_t high);
+			// returns a uniformly distributed long in the range [low, high).
+		uint32_t nextUniformUnsignedLong(uint32_t low, uint32_t high);
+			// returns a uniformly distributed unsigned long in the range [low, high).
+		int64_t nextUniformLongLong();
+			// returns a uniformly distributed long long.
+		uint64_t nextUniformUnsignedLongLong();
+			// returns a uniformly distributed unsigned long long.
+		int64_t nextUniformLongLong(int64_t low, int64_t high);
+			// returns a uniformly distributed unsigned long long in the range [low, high).
+		uint64_t nextUniformUnsignedLongLong(uint64_t low, uint64_t high);
+			// returns a uniformly distributed unsigned long long in the range [low, high).
+		int16_t nextUniformShort();
+			// returns a uniformly distributed short.
+		uint16_t nextUniformUnsignedShort();
+			// returns a uniformly distributed unsigned short.
+		double nextUniformDouble();
+			// returns a uniformly distributed double in the range [0, 1).
+		double nextUniformDouble(double low, double high);
+			// returns a uniformly distributed double in the range [low, high).
+
+		bool flipCoin();
+
+	private:
+		void initDrand(uint32_t seed, uint16_t xsubi0);
+
+		uint16_t* m_pBuffer;
+	}; // Random
+
+	#if HAVE_PTHREAD_H
+	class SIDX_DLL LockGuard
+	{
+	public:
+		LockGuard(pthread_mutex_t* pLock);
+		~LockGuard();
+
+	private:
+		pthread_mutex_t* m_pLock;
+	}; // LockGuard
+	#endif
+
+	class SIDX_DLL BufferedFile
+	{
+	public:
+		BufferedFile(uint32_t u32BufferSize = 16384);
+		virtual ~BufferedFile();
+
+		virtual void close();
+		virtual bool eof();
+		virtual void rewind() = 0;
+		virtual void seek(std::fstream::off_type offset) = 0;
+
+	protected:
+		std::fstream m_file;
+		char* m_buffer;
+		uint32_t m_u32BufferSize;
+		bool m_bEOF;
+	};
+
+	class SIDX_DLL BufferedFileReader : public BufferedFile
+	{
+	public:
+		BufferedFileReader();
+		BufferedFileReader(const std::string& sFileName, uint32_t u32BufferSize = 32768);
+		virtual ~BufferedFileReader();
+
+		virtual void open(const std::string& sFileName);
+		virtual void rewind();
+		virtual void seek(std::fstream::off_type offset);
+
+		virtual uint8_t readUInt8();
+		virtual uint16_t readUInt16();
+		virtual uint32_t readUInt32();
+		virtual uint64_t readUInt64();
+		virtual float readFloat();
+		virtual double readDouble();
+		virtual bool readBoolean();
+		virtual std::string readString();
+		virtual void readBytes(uint32_t u32Len, byte** pData);
+	};
+
+	class SIDX_DLL BufferedFileWriter : public BufferedFile
+	{
+	public:
+		BufferedFileWriter();
+		BufferedFileWriter(const std::string& sFileName, FileMode mode = CREATE, uint32_t u32BufferSize = 32768);
+		virtual ~BufferedFileWriter();
+
+		virtual void open(const std::string& sFileName, FileMode mode = CREATE);
+		virtual void rewind();
+		virtual void seek(std::fstream::off_type offset);
+
+		virtual void write(uint8_t i);
+		virtual void write(uint16_t i);
+		virtual void write(uint32_t i);
+		virtual void write(uint64_t i);
+		virtual void write(float i);
+		virtual void write(double i);
+		virtual void write(bool b);
+		virtual void write(const std::string& s);
+		virtual void write(uint32_t u32Len, byte* pData);
+	};
+
+	class SIDX_DLL TemporaryFile
+	{
+	public:
+		TemporaryFile();
+		virtual ~TemporaryFile();
+
+		void rewindForReading();
+		void rewindForWriting();
+		bool eof();
+		std::string getFileName() const;
+
+		uint8_t readUInt8();
+		uint16_t readUInt16();
+		uint32_t readUInt32();
+		uint64_t readUInt64();
+		float readFloat();
+		double readDouble();
+		std::string readString();
+		void readBytes(uint32_t u32Len, byte** pData);
+
+		void write(uint8_t i);
+		void write(uint16_t i);
+		void write(uint32_t i);
+		void write(uint64_t i);
+		void write(float i);
+		void write(double i);
+		void write(const std::string& s);
+		void write(uint32_t u32Len, byte* pData);
+
+	private:
+		std::string m_sFile;
+		BufferedFile* m_pFile;
+	};
+}
diff --git a/ltmain.sh b/ltmain.sh
index 63ae69d..a356aca 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -70,7 +70,7 @@
 #         compiler:		$LTCC
 #         compiler flags:		$LTCFLAGS
 #         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4.2
+#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1
 #         automake:	$automake_version
 #         autoconf:	$autoconf_version
 #
@@ -80,7 +80,7 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION=2.4.2
+VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1"
 TIMESTAMP=""
 package_revision=1.3337
 
@@ -6124,7 +6124,10 @@ func_mode_link ()
 	case $pass in
 	dlopen) libs="$dlfiles" ;;
 	dlpreopen) libs="$dlprefiles" ;;
-	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	link)
+	  libs="$deplibs %DEPLIBS%"
+	  test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
+	  ;;
 	esac
       fi
       if test "$linkmode,$pass" = "lib,dlpreopen"; then
@@ -6444,19 +6447,19 @@ func_mode_link ()
 	    # It is a libtool convenience library, so add in its objects.
 	    func_append convenience " $ladir/$objdir/$old_library"
 	    func_append old_convenience " $ladir/$objdir/$old_library"
+	    tmp_libs=
+	    for deplib in $dependency_libs; do
+	      deplibs="$deplib $deplibs"
+	      if $opt_preserve_dup_deps ; then
+		case "$tmp_libs " in
+		*" $deplib "*) func_append specialdeplibs " $deplib" ;;
+		esac
+	      fi
+	      func_append tmp_libs " $deplib"
+	    done
 	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
 	    func_fatal_error "\`$lib' is not a convenience library"
 	  fi
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    deplibs="$deplib $deplibs"
-	    if $opt_preserve_dup_deps ; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
-	      esac
-	    fi
-	    func_append tmp_libs " $deplib"
-	  done
 	  continue
 	fi # $pass = conv
 
@@ -7349,6 +7352,9 @@ func_mode_link ()
 	    revision="$number_minor"
 	    lt_irix_increment=no
 	    ;;
+	  *)
+	    func_fatal_configuration "$modename: unknown library version type \`$version_type'"
+	    ;;
 	  esac
 	  ;;
 	no)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a917439..5842857 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -15,143 +15,143 @@
 #   SIDX_<dirname>_CPP - all the .cpp files for the given subdir/namespace
 #   ...
 
-set(SIDX_HEADERS_DIR ${PROJECT_SOURCE_DIR}/include/spatialindex/)
-set(SIDX_HEADERS_CAPI_DIR ${PROJECT_SOURCE_DIR}/include/spatialindex/capi)
+set(SIDX_HEADERS_DIR "${PROJECT_SOURCE_DIR}/include/spatialindex/")
+set(SIDX_HEADERS_CAPI_DIR "${PROJECT_SOURCE_DIR}/include/spatialindex/capi")
 set(SIDX_HPP "")
 set(SIDX_CPP "")
 
-set(SIDX_SRC_DIR ${PROJECT_SOURCE_DIR}/src)
-set(SIDX_CAPI_DIR ${PROJECT_SOURCE_DIR}/src/capi)
+set(SIDX_SRC_DIR "${PROJECT_SOURCE_DIR}/src")
+set(SIDX_CAPI_DIR "${PROJECT_SOURCE_DIR}/src/capi")
 
 #
 # base
 #
 set(SIDX_BASE_HPP
-  ${SIDX_HEADERS_DIR}/LineSegment.h
-  ${SIDX_HEADERS_DIR}/MovingPoint.h
-  ${SIDX_HEADERS_DIR}/MVRTree.h
-  ${SIDX_HEADERS_DIR}/Point.h
-  ${SIDX_HEADERS_DIR}/Region.h
-  ${SIDX_HEADERS_DIR}/RTree.h
-  ${SIDX_HEADERS_DIR}/SpatialIndex.h
-  ${SIDX_HEADERS_DIR}/TimePoint.h
-  ${SIDX_HEADERS_DIR}/TimeRegion.h
-  ${SIDX_HEADERS_DIR}/TPRTree.h
-  ${SIDX_HEADERS_DIR}/Version.h
+  "${SIDX_HEADERS_DIR}/LineSegment.h"
+  "${SIDX_HEADERS_DIR}/MovingPoint.h"
+  "${SIDX_HEADERS_DIR}/MVRTree.h"
+  "${SIDX_HEADERS_DIR}/Point.h"
+  "${SIDX_HEADERS_DIR}/Region.h"
+  "${SIDX_HEADERS_DIR}/RTree.h"
+  "${SIDX_HEADERS_DIR}/SpatialIndex.h"
+  "${SIDX_HEADERS_DIR}/TimePoint.h"
+  "${SIDX_HEADERS_DIR}/TimeRegion.h"
+  "${SIDX_HEADERS_DIR}/TPRTree.h"
+  "${SIDX_HEADERS_DIR}/Version.h"
 )
 list (APPEND SIDX_HPP ${SIDX_BASE_HPP} )
 
 set(SIDX_CAPI_HPP
-  ${SIDX_HEADERS_CAPI_DIR}/BoundsQuery.h
-  ${SIDX_HEADERS_CAPI_DIR}/CountVisitor.h
-  ${SIDX_HEADERS_CAPI_DIR}/CustomStorage.h
-  ${SIDX_HEADERS_CAPI_DIR}/DataStream.h
-  ${SIDX_HEADERS_CAPI_DIR}/Error.h
-  ${SIDX_HEADERS_CAPI_DIR}/IdVisitor.h
-  ${SIDX_HEADERS_CAPI_DIR}/Index.h
-  ${SIDX_HEADERS_CAPI_DIR}/LeafQuery.h
-  ${SIDX_HEADERS_CAPI_DIR}/ObjVisitor.h
-  ${SIDX_HEADERS_CAPI_DIR}/sidx_api.h 
-  ${SIDX_HEADERS_CAPI_DIR}/sidx_config.h 
-  ${SIDX_HEADERS_CAPI_DIR}/sidx_impl.h
-  ${SIDX_HEADERS_CAPI_DIR}/Utility.h
+  "${SIDX_HEADERS_CAPI_DIR}/BoundsQuery.h"
+  "${SIDX_HEADERS_CAPI_DIR}/CountVisitor.h"
+  "${SIDX_HEADERS_CAPI_DIR}/CustomStorage.h"
+  "${SIDX_HEADERS_CAPI_DIR}/DataStream.h"
+  "${SIDX_HEADERS_CAPI_DIR}/Error.h"
+  "${SIDX_HEADERS_CAPI_DIR}/IdVisitor.h"
+  "${SIDX_HEADERS_CAPI_DIR}/Index.h"
+  "${SIDX_HEADERS_CAPI_DIR}/LeafQuery.h"
+  "${SIDX_HEADERS_CAPI_DIR}/ObjVisitor.h"
+  "${SIDX_HEADERS_CAPI_DIR}/sidx_api.h"
+  "${SIDX_HEADERS_CAPI_DIR}/sidx_config.h" 
+  "${SIDX_HEADERS_CAPI_DIR}/sidx_impl.h"
+  "${SIDX_HEADERS_CAPI_DIR}/Utility.h"
 )
 list (APPEND SIDX_HPP ${SIDX_CAPI_HPP} )
 
 set(SIDX_CAPI_CPP
-  ${SIDX_CAPI_DIR}/BoundsQuery.cc
-  ${SIDX_CAPI_DIR}/CountVisitor.cc
-  ${SIDX_CAPI_DIR}/CustomStorage.cc
-  ${SIDX_CAPI_DIR}/DataStream.cc
-  ${SIDX_CAPI_DIR}/Error.cc
-  ${SIDX_CAPI_DIR}/IdVisitor.cc
-  ${SIDX_CAPI_DIR}/Index.cc
-  ${SIDX_CAPI_DIR}/LeafQuery.cc
-  ${SIDX_CAPI_DIR}/ObjVisitor.cc
-  ${SIDX_CAPI_DIR}/sidx_api.cc
-  ${SIDX_CAPI_DIR}/Utility.cc
+  "${SIDX_CAPI_DIR}/BoundsQuery.cc"
+  "${SIDX_CAPI_DIR}/CountVisitor.cc"
+  "${SIDX_CAPI_DIR}/CustomStorage.cc"
+  "${SIDX_CAPI_DIR}/DataStream.cc"
+  "${SIDX_CAPI_DIR}/Error.cc"
+  "${SIDX_CAPI_DIR}/IdVisitor.cc"
+  "${SIDX_CAPI_DIR}/Index.cc"
+  "${SIDX_CAPI_DIR}/LeafQuery.cc"
+  "${SIDX_CAPI_DIR}/ObjVisitor.cc"
+  "${SIDX_CAPI_DIR}/sidx_api.cc"
+  "${SIDX_CAPI_DIR}/Utility.cc"
 )
 
 
 set(SIDX_SPATIALINDEX_CPP
-  ${SIDX_SRC_DIR}/spatialindex/LineSegment.cc
-  ${SIDX_SRC_DIR}/spatialindex/MovingPoint.cc
-  ${SIDX_SRC_DIR}/spatialindex/MovingRegion.cc
-  ${SIDX_SRC_DIR}/spatialindex/Point.cc
-  ${SIDX_SRC_DIR}/spatialindex/Region.cc
-  ${SIDX_SRC_DIR}/spatialindex/SpatialIndexImpl.cc
-  ${SIDX_SRC_DIR}/spatialindex/TimePoint.cc
-  ${SIDX_SRC_DIR}/spatialindex/TimeRegion.cc
+  "${SIDX_SRC_DIR}/spatialindex/LineSegment.cc"
+  "${SIDX_SRC_DIR}/spatialindex/MovingPoint.cc"
+  "${SIDX_SRC_DIR}/spatialindex/MovingRegion.cc"
+  "${SIDX_SRC_DIR}/spatialindex/Point.cc"
+  "${SIDX_SRC_DIR}/spatialindex/Region.cc"
+  "${SIDX_SRC_DIR}/spatialindex/SpatialIndexImpl.cc"
+  "${SIDX_SRC_DIR}/spatialindex/TimePoint.cc"
+  "${SIDX_SRC_DIR}/spatialindex/TimeRegion.cc"
 )
 list (APPEND SIDX_CPP ${SIDX_SPATIALINDEX_CPP} )
 
 set(SIDX_MVRTREE_CPP
-  ${SIDX_SRC_DIR}/mvrtree/Index.cc
-  ${SIDX_SRC_DIR}/mvrtree/Index.h
-  ${SIDX_SRC_DIR}/mvrtree/Leaf.cc
-  ${SIDX_SRC_DIR}/mvrtree/Leaf.h
-  ${SIDX_SRC_DIR}/mvrtree/MVRTree.cc
-  ${SIDX_SRC_DIR}/mvrtree/MVRTree.h
-  ${SIDX_SRC_DIR}/mvrtree/Node.cc
-  ${SIDX_SRC_DIR}/mvrtree/Node.h
-  ${SIDX_SRC_DIR}/mvrtree/PointerPoolNode.h
-  ${SIDX_SRC_DIR}/mvrtree/Statistics.cc
-  ${SIDX_SRC_DIR}/mvrtree/Statistics.h
+  "${SIDX_SRC_DIR}/mvrtree/Index.cc"
+  "${SIDX_SRC_DIR}/mvrtree/Index.h"
+  "${SIDX_SRC_DIR}/mvrtree/Leaf.cc"
+  "${SIDX_SRC_DIR}/mvrtree/Leaf.h"
+  "${SIDX_SRC_DIR}/mvrtree/MVRTree.cc"
+  "${SIDX_SRC_DIR}/mvrtree/MVRTree.h"
+  "${SIDX_SRC_DIR}/mvrtree/Node.cc"
+  "${SIDX_SRC_DIR}/mvrtree/Node.h"
+  "${SIDX_SRC_DIR}/mvrtree/PointerPoolNode.h"
+  "${SIDX_SRC_DIR}/mvrtree/Statistics.cc"
+  "${SIDX_SRC_DIR}/mvrtree/Statistics.h"
 )
 list (APPEND SIDX_CPP ${SIDX_MVRTREE_CPP})
 
 set(SIDX_RTREE_CPP
-  ${SIDX_SRC_DIR}/rtree/BulkLoader.cc
-  ${SIDX_SRC_DIR}/rtree/BulkLoader.h
-  ${SIDX_SRC_DIR}/rtree/Index.cc
-  ${SIDX_SRC_DIR}/rtree/Index.h
-  ${SIDX_SRC_DIR}/rtree/Leaf.cc
-  ${SIDX_SRC_DIR}/rtree/Leaf.h
-  ${SIDX_SRC_DIR}/rtree/Node.cc
-  ${SIDX_SRC_DIR}/rtree/Node.h
-  ${SIDX_SRC_DIR}/rtree/PointerPoolNode.h
-  ${SIDX_SRC_DIR}/rtree/RTree.cc
-  ${SIDX_SRC_DIR}/rtree/RTree.h
-  ${SIDX_SRC_DIR}/rtree/Statistics.cc
-  ${SIDX_SRC_DIR}/rtree/Statistics.h
+  "${SIDX_SRC_DIR}/rtree/BulkLoader.cc"
+  "${SIDX_SRC_DIR}/rtree/BulkLoader.h"
+  "${SIDX_SRC_DIR}/rtree/Index.cc"
+  "${SIDX_SRC_DIR}/rtree/Index.h"
+  "${SIDX_SRC_DIR}/rtree/Leaf.cc"
+  "${SIDX_SRC_DIR}/rtree/Leaf.h"
+  "${SIDX_SRC_DIR}/rtree/Node.cc"
+  "${SIDX_SRC_DIR}/rtree/Node.h"
+  "${SIDX_SRC_DIR}/rtree/PointerPoolNode.h"
+  "${SIDX_SRC_DIR}/rtree/RTree.cc"
+  "${SIDX_SRC_DIR}/rtree/RTree.h"
+  "${SIDX_SRC_DIR}/rtree/Statistics.cc"
+  "${SIDX_SRC_DIR}/rtree/Statistics.h"
 )
 list (APPEND SIDX_CPP ${SIDX_RTREE_CPP})
 
 set(SIDX_STORAGEMANAGER_CPP
-  ${SIDX_SRC_DIR}/storagemanager/Buffer.cc
-  ${SIDX_SRC_DIR}/storagemanager/DiskStorageManager.cc
-  ${SIDX_SRC_DIR}/storagemanager/DiskStorageManager.h
-  ${SIDX_SRC_DIR}/storagemanager/MemoryStorageManager.cc
-  ${SIDX_SRC_DIR}/storagemanager/MemoryStorageManager.h
-  ${SIDX_SRC_DIR}/storagemanager/RandomEvictionsBuffer.cc
-  ${SIDX_SRC_DIR}/storagemanager/RandomEvictionsBuffer.h
+  "${SIDX_SRC_DIR}/storagemanager/Buffer.cc"
+  "${SIDX_SRC_DIR}/storagemanager/DiskStorageManager.cc"
+  "${SIDX_SRC_DIR}/storagemanager/DiskStorageManager.h"
+  "${SIDX_SRC_DIR}/storagemanager/MemoryStorageManager.cc"
+  "${SIDX_SRC_DIR}/storagemanager/MemoryStorageManager.h"
+  "${SIDX_SRC_DIR}/storagemanager/RandomEvictionsBuffer.cc"
+  "${SIDX_SRC_DIR}/storagemanager/RandomEvictionsBuffer.h"
 )
 list (APPEND SIDX_CPP ${SIDX_STORAGEMANAGER_CPP})
 
 set(SIDX_RAND48 )
 
 if (NOT HAVE_SRAND48)
-    set(SIDX_RAND48 ${SIDX_SRC_DIR}/tools/rand48.cc)
+    set(SIDX_RAND48 "${SIDX_SRC_DIR}/tools/rand48.cc")
 endif()
 
 set(SIDX_TOOLS_CPP
   ${SIDX_RAND48}
-  ${SIDX_SRC_DIR}/tools/Tools.cc
+  "${SIDX_SRC_DIR}/tools/Tools.cc"
 )
 list (APPEND SIDX_CPP ${SIDX_TOOLS_CPP})
 
 set(SIDX_TOOLS_CPP
-  ${SIDX_SRC_DIR}/tprtree/Index.cc
-  ${SIDX_SRC_DIR}/tprtree/Index.h
-  ${SIDX_SRC_DIR}/tprtree/Leaf.cc
-  ${SIDX_SRC_DIR}/tprtree/Leaf.h
-  ${SIDX_SRC_DIR}/tprtree/Node.cc
-  ${SIDX_SRC_DIR}/tprtree/Node.h
-  ${SIDX_SRC_DIR}/tprtree/PointerPoolNode.h
-  ${SIDX_SRC_DIR}/tprtree/Statistics.cc
-  ${SIDX_SRC_DIR}/tprtree/Statistics.h
-  ${SIDX_SRC_DIR}/tprtree/TPRTree.cc
-  ${SIDX_SRC_DIR}/tprtree/TPRTree.h
+  "${SIDX_SRC_DIR}/tprtree/Index.cc"
+  "${SIDX_SRC_DIR}/tprtree/Index.h"
+  "${SIDX_SRC_DIR}/tprtree/Leaf.cc"
+  "${SIDX_SRC_DIR}/tprtree/Leaf.h"
+  "${SIDX_SRC_DIR}/tprtree/Node.cc"
+  "${SIDX_SRC_DIR}/tprtree/Node.h"
+  "${SIDX_SRC_DIR}/tprtree/PointerPoolNode.h"
+  "${SIDX_SRC_DIR}/tprtree/Statistics.cc"
+  "${SIDX_SRC_DIR}/tprtree/Statistics.h"
+  "${SIDX_SRC_DIR}/tprtree/TPRTree.cc"
+  "${SIDX_SRC_DIR}/tprtree/TPRTree.h"
 )
 list (APPEND SIDX_CPP ${SIDX_TOOLS_CPP} )
 #
@@ -190,7 +190,7 @@ set(SIDX_SOURCES
 if(WIN32)
     add_definitions("-DSIDX_DLL_EXPORT=1")
 if (NOT WITH_STATIC_LASZIP)
-    add_definitions("-DLASZIP_DLL_IMPORT=1")
+    add_definitions("-DSIDX_DLL_IMPORT=1")
 endif()
 endif()
 
@@ -216,12 +216,12 @@ if (APPLE)
   set_target_properties(
     ${SIDX_LIB_NAME}
     PROPERTIES
-    INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+    INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH OFF)
 
   set_target_properties(
     ${SIDX_C_LIB_NAME}
     PROPERTIES
-    INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+    INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH OFF)
 endif()
 
 ###############################################################################
diff --git a/src/Makefile.in b/src/Makefile.in
index db4341c..f796601 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,23 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -362,13 +390,12 @@ uninstall-pkgconfigDATA:
 #     (which will cause the Makefiles to be regenerated when you run 'make');
 # (2) otherwise, pass the desired values on the 'make' command line.
 $(am__recursive_targets):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
 	case "$@" in \
diff --git a/src/capi/BoundsQuery.cc b/src/capi/BoundsQuery.cc
index a544a9e..177bc44 100644
--- a/src/capi/BoundsQuery.cc
+++ b/src/capi/BoundsQuery.cc
@@ -34,7 +34,7 @@ BoundsQuery::BoundsQuery()
 }
 
 void BoundsQuery::getNextEntry( const SpatialIndex::IEntry& entry, 
-								SpatialIndex::id_type& nextEntry, 
+								SpatialIndex::id_type&, 
 								bool& hasNext) 
 {
 	SpatialIndex::IShape* ps;
diff --git a/src/capi/CountVisitor.cc b/src/capi/CountVisitor.cc
index fdda445..aadef21 100644
--- a/src/capi/CountVisitor.cc
+++ b/src/capi/CountVisitor.cc
@@ -37,16 +37,16 @@ CountVisitor::~CountVisitor()
 
 }
 
-void CountVisitor::visitNode(const SpatialIndex::INode& n)
+void CountVisitor::visitNode(const SpatialIndex::INode& )
 {
 
 }
 
-void CountVisitor::visitData(const SpatialIndex::IData& d)
+void CountVisitor::visitData(const SpatialIndex::IData& )
 {
    nResults += 1;
 }
 
-void CountVisitor::visitData(std::vector<const SpatialIndex::IData*>& v)
+void CountVisitor::visitData(std::vector<const SpatialIndex::IData*>& )
 {
 }
diff --git a/src/capi/DataStream.cc b/src/capi/DataStream.cc
index 4249c3d..16db57f 100644
--- a/src/capi/DataStream.cc
+++ b/src/capi/DataStream.cc
@@ -91,17 +91,17 @@ SpatialIndex::IData* DataStream::getNext()
 	return ret;
 }
 
-bool DataStream::hasNext() throw (Tools::NotSupportedException)
+bool DataStream::hasNext()
 {
 	return (m_pNext != 0);
 }
 
-uint32_t DataStream::size() throw (Tools::NotSupportedException)
+uint32_t DataStream::size()
 {
 	throw Tools::NotSupportedException("Operation not supported.");
 }
 
-void DataStream::rewind() throw (Tools::NotSupportedException)
+void DataStream::rewind()
 {
 	throw Tools::NotSupportedException("Operation not supported.");
 
diff --git a/src/capi/IdVisitor.cc b/src/capi/IdVisitor.cc
index b7e6f40..dc52c1c 100644
--- a/src/capi/IdVisitor.cc
+++ b/src/capi/IdVisitor.cc
@@ -37,7 +37,7 @@ IdVisitor::~IdVisitor()
 
 }
 
-void IdVisitor::visitNode(const SpatialIndex::INode& n)
+void IdVisitor::visitNode(const SpatialIndex::INode& )
 {
 
 }
@@ -49,6 +49,6 @@ void IdVisitor::visitData(const SpatialIndex::IData& d)
 	m_vector.push_back(d.getIdentifier());
 }
 
-void IdVisitor::visitData(std::vector<const SpatialIndex::IData*>& v)
+void IdVisitor::visitData(std::vector<const SpatialIndex::IData*>& )
 {
 }
diff --git a/src/capi/Index.cc b/src/capi/Index.cc
index 351ab86..565fa86 100644
--- a/src/capi/Index.cc
+++ b/src/capi/Index.cc
@@ -6,7 +6,7 @@
  * Copyright (c) 2009, Howard Butler
  *
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
@@ -28,91 +28,84 @@
 
 #include <spatialindex/capi/sidx_impl.h>
 
-SpatialIndex::ISpatialIndex* Index::CreateIndex() 
+SpatialIndex::ISpatialIndex* Index::CreateIndex()
 {
 	using namespace SpatialIndex;
-	
+
 	ISpatialIndex* index = 0;
-	
+
 	Tools::Variant var;
 
 	if (GetIndexType() == RT_RTree) {
 
 		try {
-			index = RTree::returnRTree(	 *m_buffer, m_properties); 
+			index = RTree::returnRTree(	 *m_buffer, m_properties);
 		} catch (Tools::Exception& e) {
 			std::ostringstream os;
 			os << "Spatial Index Error: " << e.what();
 			throw std::runtime_error(os.str());
-		}	 
+		}
 	}
 
 	else if (GetIndexType() == RT_MVRTree) {
 
 		try {
-			index = MVRTree::returnMVRTree(	 *m_buffer, m_properties); 
+			index = MVRTree::returnMVRTree(	 *m_buffer, m_properties);
 		} catch (Tools::Exception& e) {
 			std::ostringstream os;
 			os << "Spatial Index Error: " << e.what();
 			throw std::runtime_error(os.str());
-		}	
+		}
 	}
 
 	else if (GetIndexType() == RT_TPRTree) {
 
 		try {
-			index = TPRTree::returnTPRTree(	 *m_buffer,m_properties); 
+			index = TPRTree::returnTPRTree(	 *m_buffer,m_properties);
 		} catch (Tools::Exception& e) {
 			std::ostringstream os;
 			os << "Spatial Index Error: " << e.what();
 			throw std::runtime_error(os.str());
-		}	
+		}
 	}
 
 	return index;
 }
 
 
-Index::Index(const Tools::PropertySet& poProperties) 
+Index::Index(Tools::PropertySet& poProperties): m_properties(poProperties)
 {
 	Setup();
-	
-	m_properties = poProperties;
 
 	Initialize();
 }
 
 
-Index::~Index() 
+Index::~Index()
 {
-	if (m_rtree != 0)
-		delete m_rtree;
-	if (m_buffer != 0)
-		delete m_buffer;
-	if (m_storage != 0)
-		delete m_storage;
-
+	delete m_rtree;
+	delete m_buffer;
+	delete m_storage;
 }
 
-Index::Index(	const Tools::PropertySet& poProperties, 
-				int (*readNext)(SpatialIndex::id_type *id, 
-								double **pMin, 
-								double **pMax, 
-								uint32_t *nDimension, 
-								const uint8_t **pData, 
-								uint32_t *nDataLength)) 
+Index::Index(	Tools::PropertySet& poProperties,
+				int (*readNext)(SpatialIndex::id_type *id,
+								double **pMin,
+								double **pMax,
+								uint32_t *nDimension,
+								const uint8_t **pData,
+								uint32_t *nDataLength))
+: m_properties(poProperties)
 {
 	using namespace SpatialIndex;
-		
+
 	Setup();
-	
-	m_properties = poProperties;
 
 	m_storage = CreateStorage();
 	m_buffer = CreateIndexBuffer(*m_storage);
-	
+
 	DataStream ds(readNext);
-	
+
 	double dFillFactor = 0.7;
 	uint32_t nIdxCapacity = 100;
 	uint32_t nIdxLeafCap = 100;
@@ -120,7 +113,7 @@ Index::Index(	const Tools::PropertySet& poProperties,
 	SpatialIndex::RTree::RTreeVariant eVariant = SpatialIndex::RTree::RV_RSTAR;
 	SpatialIndex::id_type m_IdxIdentifier;
 
-	// Fetch a bunch of properties.	 We can't bulk load an rtree using merely 
+	// Fetch a bunch of properties.	 We can't bulk load an rtree using merely
 	// properties, we have to use the helper method(s).
 
 	Tools::Variant var;
@@ -130,17 +123,17 @@ Index::Index(	const Tools::PropertySet& poProperties,
 		if (var.m_varType != Tools::VT_DOUBLE)
 			throw std::runtime_error("Index::Index (streaming):"
 									 " Property FillFactor must be Tools::VT_DOUBLE");
-		
+
 		dFillFactor = var.m_val.dblVal;
 	}
-	
+
 	var = m_properties.getProperty("IndexCapacity");
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_ULONG)
 			throw std::runtime_error("Index::Index (streaming): "
 									 "Property IndexCapacity must be Tools::VT_ULONG");
-		
+
 		nIdxCapacity = var.m_val.ulVal;
 	}
 
@@ -150,7 +143,7 @@ Index::Index(	const Tools::PropertySet& poProperties,
 		if (var.m_varType != Tools::VT_ULONG)
 			throw std::runtime_error("Index::Index (streaming): "
 									 "Property LeafCapacity must be Tools::VT_ULONG");
-		
+
 		nIdxLeafCap = var.m_val.ulVal;
 	}
 
@@ -160,7 +153,7 @@ Index::Index(	const Tools::PropertySet& poProperties,
 		if (var.m_varType != Tools::VT_ULONG)
 			throw std::runtime_error("Index::Index (streaming): "
 									 "Property Dimension must be Tools::VT_ULONG");
-		
+
 		nIdxDimension = var.m_val.ulVal;
 	}
 
@@ -170,7 +163,7 @@ Index::Index(	const Tools::PropertySet& poProperties,
 		if (var.m_varType != Tools::VT_LONG)
 			throw std::runtime_error("Index::Index (streaming): "
 									 "Property TreeVariant must be Tools::VT_LONG");
-		
+
 		eVariant = static_cast<SpatialIndex::RTree::RTreeVariant>(var.m_val.lVal);
 	}
 
@@ -180,10 +173,10 @@ Index::Index(	const Tools::PropertySet& poProperties,
 		if (var.m_varType != Tools::VT_LONGLONG)
 			throw std::runtime_error("Index::Index (streaming): "
 									 "Property IndexIdentifier must be Tools::VT_LONGLONG");
-		
+
 		m_IdxIdentifier = var.m_val.llVal;
 	}
-	
+
 	m_rtree = RTree::createAndBulkLoadNewRTree(	  SpatialIndex::RTree::BLM_STR,
 												  ds,
 												  *m_buffer,
@@ -194,14 +187,14 @@ Index::Index(	const Tools::PropertySet& poProperties,
 												  eVariant,
 												  m_IdxIdentifier);
 }
-	
+
 
 SpatialIndex::StorageManager::IBuffer* Index::CreateIndexBuffer(SpatialIndex::IStorageManager& storage)
 {
 	using namespace SpatialIndex::StorageManager;
 	IBuffer* buffer = 0;
 	try {
-		if ( m_storage == 0 ) 
+		if ( m_storage == 0 )
 			throw std::runtime_error("Storage was invalid to create index buffer");
 		buffer = returnRandomEvictionsBuffer(storage, m_properties);
 	} catch (Tools::Exception& e) {
@@ -216,10 +209,10 @@ SpatialIndex::StorageManager::IBuffer* Index::CreateIndexBuffer(SpatialIndex::IS
 SpatialIndex::IStorageManager* Index::CreateStorage()
 {
 	using namespace SpatialIndex::StorageManager;
-	
+
 	SpatialIndex::IStorageManager* storage = 0;
 	std::string filename("");
-	
+
 	Tools::Variant var;
 	var = m_properties.getProperty("FileName");
 
@@ -228,10 +221,10 @@ SpatialIndex::IStorageManager* Index::CreateStorage()
 		if (var.m_varType != Tools::VT_PCHAR)
 			throw std::runtime_error("Index::CreateStorage: "
 									 "Property FileName must be Tools::VT_PCHAR");
-		
+
 		filename = std::string(var.m_val.pcVal);
 	}
-	
+
 	if (GetIndexStorage() == RT_Disk) {
 		if (filename.empty()) {
 				std::ostringstream os;
@@ -246,7 +239,7 @@ SpatialIndex::IStorageManager* Index::CreateStorage()
 				std::ostringstream os;
 				os << "Spatial Index Error: " << e.what();
 				throw std::runtime_error(os.str());
-			}		  
+			}
 
 	} else if (GetIndexStorage() == RT_Memory) {
 
@@ -257,8 +250,8 @@ SpatialIndex::IStorageManager* Index::CreateStorage()
 			std::ostringstream os;
 			os << "Spatial Index Error: " << e.what();
 			throw std::runtime_error(os.str());
-		} 
-					
+		}
+
 	} else if (GetIndexStorage() == RT_Custom) {
 
 		try {
@@ -268,10 +261,10 @@ SpatialIndex::IStorageManager* Index::CreateStorage()
 			std::ostringstream os;
 			os << "Spatial Index Error: " << e.what();
 			throw std::runtime_error(os.str());
-		} 
-					
+		}
+
 	}
-	return storage;				  
+	return storage;
 }
 
 
@@ -286,13 +279,13 @@ void Index::Initialize()
 
 void Index::Setup()
 
-{	
+{
 	m_buffer = 0;
 	m_storage = 0;
 	m_rtree = 0;
 }
 
-RTIndexType Index::GetIndexType() 
+RTIndexType Index::GetIndexType()
 {
 	Tools::Variant var;
 	var = m_properties.getProperty("IndexType");
@@ -302,13 +295,13 @@ RTIndexType Index::GetIndexType()
 		if (var.m_varType != Tools::VT_ULONG)
 			throw std::runtime_error("Index::GetIndexType: "
 									 "Property IndexType must be Tools::VT_ULONG");
-		
+
 		return static_cast<RTIndexType>(var.m_val.ulVal);
 	}
-	
+
 	// if we didn't get anything, we're returning an error condition
 	return RT_InvalidIndexType;
-	
+
 }
 void Index::SetIndexType(RTIndexType v)
 {
@@ -329,10 +322,10 @@ RTStorageType Index::GetIndexStorage()
 		if (var.m_varType != Tools::VT_ULONG)
 			throw std::runtime_error("Index::GetIndexStorage: "
 									 "Property IndexStorageType must be Tools::VT_ULONG");
-		
+
 		return static_cast<RTStorageType>(var.m_val.ulVal);
 	}
-	
+
 	// if we didn't get anything, we're returning an error condition
 	return RT_InvalidStorageType;
 }
@@ -356,10 +349,10 @@ RTIndexVariant Index::GetIndexVariant()
 		if (var.m_varType != Tools::VT_ULONG)
 			throw std::runtime_error("Index::GetIndexVariant: "
 									 "Property TreeVariant must be Tools::VT_ULONG");
-		
+
 		return static_cast<RTIndexVariant>(var.m_val.ulVal);
 	}
-	
+
 	// if we didn't get anything, we're returning an error condition
 	return RT_InvalidIndexVariant;
 }
@@ -374,9 +367,65 @@ void Index::SetIndexVariant(RTStorageType v)
 		m_properties.setProperty("TreeVariant", var);
 	} else if (GetIndexType() == RT_MVRTree) {
 		var.m_val.ulVal = static_cast<MVRTree::MVRTreeVariant>(v);
-		m_properties.setProperty("TreeVariant", var);	
+		m_properties.setProperty("TreeVariant", var);
 	} else if (GetIndexType() == RT_TPRTree) {
 		var.m_val.ulVal = static_cast<TPRTree::TPRTreeVariant>(v);
-		m_properties.setProperty("TreeVariant", var);	
+		m_properties.setProperty("TreeVariant", var);
 	}
 }
+
+int64_t Index::GetResultSetOffset()
+{
+    Tools::Variant var;
+    var = m_properties.getProperty("ResultSetOffset");
+
+    if (var.m_varType != Tools::VT_EMPTY)
+    {
+        if (var.m_varType != Tools::VT_LONGLONG)
+            throw std::runtime_error("Index::ResultSetOffset: "
+                                     "Property ResultSetOffset must be Tools::VT_LONGLONG");
+        return var.m_val.llVal;
+    }
+
+    // if we didn't get anything, we're returning 0 as there is no limit
+    return 0;
+}
+
+void Index::SetResultSetOffset(int64_t v)
+{
+    Tools::Variant var;
+    var.m_varType = Tools::VT_LONGLONG;
+    var.m_val.llVal = v;
+    m_properties.setProperty("ResultSetOffset", var);
+}
+
+
+int64_t Index::GetResultSetLimit()
+{
+    Tools::Variant var;
+    var = m_properties.getProperty("ResultSetLimit");
+
+    if (var.m_varType != Tools::VT_EMPTY)
+    {
+        if (var.m_varType != Tools::VT_LONGLONG)
+            throw std::runtime_error("Index::ResultSetLimit: "
+                                     "Property ResultSetLimit must be Tools::VT_LONGLONG");
+        return var.m_val.llVal;
+    }
+
+    // if we didn't get anything, we're returning 0 as there is no limit
+    return 0;
+}
+
+void Index::SetResultSetLimit(int64_t v)
+{
+    Tools::Variant var;
+    var.m_varType = Tools::VT_LONGLONG;
+    var.m_val.llVal = v;
+    m_properties.setProperty("ResultSetLimit", var);
+}
+
+void Index::flush()
+{
+	m_storage->flush();
+}
diff --git a/src/capi/LeafQuery.cc b/src/capi/LeafQuery.cc
index c79dbf9..670ccf8 100644
--- a/src/capi/LeafQuery.cc
+++ b/src/capi/LeafQuery.cc
@@ -41,7 +41,7 @@ LeafQueryResult get_results(const SpatialIndex::INode* n)
 	n->getShape(&ps);
 	SpatialIndex::Region* pr = dynamic_cast<SpatialIndex::Region*>(ps);
 	std::vector<SpatialIndex::id_type> ids;
-	for (size_t cChild = 0; cChild < n->getChildrenCount(); cChild++)
+	for (uint32_t cChild = 0; cChild < n->getChildrenCount(); cChild++)
 	{
 		ids.push_back(n->getChildIdentifier(cChild));
 	}
diff --git a/src/capi/Makefile.in b/src/capi/Makefile.in
index 3336d83..d36f5e9 100644
--- a/src/capi/Makefile.in
+++ b/src/capi/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,23 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -309,6 +337,7 @@ clean-noinstLTLIBRARIES:
 	  echo rm -f $${locs}; \
 	  rm -f $${locs}; \
 	}
+
 libsidxc.la: $(libsidxc_la_OBJECTS) $(libsidxc_la_DEPENDENCIES) $(EXTRA_libsidxc_la_DEPENDENCIES) 
 	$(AM_V_CXXLD)$(CXXLINK)  $(libsidxc_la_OBJECTS) $(libsidxc_la_LIBADD) $(LIBS)
 
diff --git a/src/capi/ObjVisitor.cc b/src/capi/ObjVisitor.cc
index 3dd8d89..dc66b5c 100644
--- a/src/capi/ObjVisitor.cc
+++ b/src/capi/ObjVisitor.cc
@@ -41,7 +41,7 @@ ObjVisitor::~ObjVisitor()
 
 }
 
-void ObjVisitor::visitNode(const SpatialIndex::INode& n)
+void ObjVisitor::visitNode(const SpatialIndex::INode& )
 {
 }
 
@@ -55,7 +55,7 @@ void ObjVisitor::visitData(const SpatialIndex::IData& d)
 	m_vector.push_back(item);
 }
 
-void ObjVisitor::visitData(std::vector<const SpatialIndex::IData*>& v)
+void ObjVisitor::visitData(std::vector<const SpatialIndex::IData*>& )
 {
 }
 
diff --git a/src/capi/Utility.cc b/src/capi/Utility.cc
index d33d705..b7ab2c7 100644
--- a/src/capi/Utility.cc
+++ b/src/capi/Utility.cc
@@ -6,7 +6,7 @@
  * Copyright (c) 2009, Howard Butler
  *
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
@@ -31,23 +31,23 @@
 Tools::PropertySet* GetDefaults()
 {
 	Tools::PropertySet* ps = new Tools::PropertySet;
-	
+
 	Tools::Variant var;
-	
+
 	// Rtree defaults
-	
+
 	var.m_varType = Tools::VT_DOUBLE;
 	var.m_val.dblVal = 0.7;
 	ps->setProperty("FillFactor", var);
-	
+
 	var.m_varType = Tools::VT_ULONG;
 	var.m_val.ulVal = 100;
 	ps->setProperty("IndexCapacity", var);
-	
+
 	var.m_varType = Tools::VT_ULONG;
 	var.m_val.ulVal = 100;
 	ps->setProperty("LeafCapacity", var);
-	
+
 	var.m_varType = Tools::VT_LONG;
 	var.m_val.lVal = SpatialIndex::RTree::RV_RSTAR;
 	ps->setProperty("TreeVariant", var);
@@ -55,11 +55,11 @@ Tools::PropertySet* GetDefaults()
 	// var.m_varType = Tools::VT_LONGLONG;
 	// var.m_val.llVal = 0;
 	// ps->setProperty("IndexIdentifier", var);
-	
+
 	var.m_varType = Tools::VT_ULONG;
 	var.m_val.ulVal = 32;
 	ps->setProperty("NearMinimumOverlapFactor", var);
-	
+
 	var.m_varType = Tools::VT_DOUBLE;
 	var.m_val.dblVal = 0.4;
 	ps->setProperty("SplitDistributionFactor", var);
@@ -71,15 +71,15 @@ Tools::PropertySet* GetDefaults()
 	var.m_varType = Tools::VT_ULONG;
 	var.m_val.ulVal = 2;
 	ps->setProperty("Dimension", var);
-		
+
 	var.m_varType = Tools::VT_BOOL;
 	var.m_val.bVal = true;
 	ps->setProperty("EnsureTightMBRs", var);
-	
+
 	var.m_varType = Tools::VT_ULONG;
 	var.m_val.ulVal = 100;
 	ps->setProperty("IndexPoolCapacity", var);
-	
+
 	var.m_varType = Tools::VT_ULONG;
 	var.m_val.ulVal = 100;
 	ps->setProperty("LeafPoolCapacity", var);
@@ -96,30 +96,34 @@ Tools::PropertySet* GetDefaults()
 	var.m_varType = Tools::VT_DOUBLE;
 	var.m_val.dblVal = 20.0;
 	ps->setProperty("Horizon", var);
-	
+
 	// Buffering defaults
 	var.m_varType = Tools::VT_ULONG;
 	var.m_val.ulVal = 10;
 	ps->setProperty("Capacity", var);
-	
+
 	var.m_varType = Tools::VT_BOOL;
 	var.m_val.bVal = false;
 	ps->setProperty("WriteThrough", var);
-	
+
 	// Disk Storage Manager defaults
 	var.m_varType = Tools::VT_BOOL;
 	var.m_val.bVal = true;
 	ps->setProperty("Overwrite", var);
-	
+
 	var.m_varType = Tools::VT_PCHAR;
 	var.m_val.pcVal = const_cast<char*>("");
 	ps->setProperty("FileName", var);
-	
+
 	var.m_varType = Tools::VT_ULONG;
 	var.m_val.ulVal = 4096;
 	ps->setProperty("PageSize", var);
-	
-	// Our custom properties related to whether 
+
+	var.m_varType = Tools::VT_LONGLONG;
+	var.m_val.llVal = 0;
+	ps->setProperty("ResultSetLimit", var);
+
+	// Our custom properties related to whether
 	// or not we are using a disk or memory storage manager
 
 	var.m_varType = Tools::VT_ULONG;
@@ -149,3 +153,83 @@ Tools::PropertySet* GetDefaults()
 
     return ps;
 }
+
+void Page_ResultSet_Ids(IdVisitor& visitor, int64_t** ids, int64_t nStart, int64_t nResultLimit, uint64_t* nResults)
+{
+  int64_t nResultCount;
+
+  nResultCount = visitor.GetResultCount();
+
+  if (nResultLimit == 0)
+  {
+    // no offset paging
+    nResultLimit = nResultCount;
+    nStart = 0;
+  }
+  else
+  {
+    if ((nResultCount - (nStart + nResultLimit)) < 0)
+    {
+      // not enough results to fill nResultCount
+      nStart = std::min(nStart, nResultCount);
+      nResultCount = nStart + std::min(nResultLimit, nResultCount - nStart);
+    }
+    else
+    {
+      nResultCount = std::min(nResultCount, nStart + nResultLimit);
+    }
+  }
+
+  *ids = (int64_t*) malloc (nResultLimit * sizeof(int64_t));
+
+  std::vector<uint64_t>& results = visitor.GetResults();
+
+  for (int64_t i = nStart; i < nResultCount; ++i)
+  {
+    (*ids)[i - nStart] = results[i];
+  }
+
+  *nResults = nResultCount - nStart;
+}
+
+void Page_ResultSet_Obj(ObjVisitor& visitor, IndexItemH** items, int64_t nStart, int64_t nResultLimit, uint64_t* nResults)
+{
+	int64_t nResultCount;
+
+	nResultCount = visitor.GetResultCount();
+
+	if (nResultLimit == 0)
+	{
+		// no offset paging
+		nResultLimit = nResultCount;
+		nStart = 0;
+	}
+	else
+	{
+		if ((nResultCount - (nStart + nResultLimit)) < 0)
+		{
+			// not enough results to fill nResultCount
+			nStart = std::min(nStart, nResultCount);
+			nResultCount = nStart + std::min(nResultLimit, nResultCount - nStart);
+		}
+		else
+		{
+			nResultCount = std::min(nResultCount, nStart + nResultLimit);
+		}
+	}
+
+	*items = (SpatialIndex::IData**) malloc (nResultLimit * sizeof(SpatialIndex::IData*));
+
+	std::vector<SpatialIndex::IData*>& results = visitor.GetResults();
+
+	// copy the Items into the newly allocated item array
+	// we need to make sure to copy the actual Item instead
+	// of just the pointers, as the visitor will nuke them
+	// upon ~
+	for (int64_t i = nStart; i < nResultCount; ++i)
+	{
+		SpatialIndex::IData* result =results[i];
+		(*items)[i - nStart] =  dynamic_cast<SpatialIndex::IData*>(result->clone());
+	}
+	*nResults = nResultCount - nStart;
+}
diff --git a/src/capi/sidx_api.cc b/src/capi/sidx_api.cc
index 2bb6378..be45527 100644
--- a/src/capi/sidx_api.cc
+++ b/src/capi/sidx_api.cc
@@ -6,7 +6,7 @@
  * Copyright (c) 2009, Howard Butler
  *
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
@@ -32,6 +32,12 @@
 
 static std::stack<Error> errors;
 
+
+#ifdef _WIN32
+#  pragma warning(push)
+#  pragma warning(disable: 4127)  // assignment operator could not be generated
+#endif
+
 #define VALIDATE_POINTER0(ptr, func) \
    do { if( NULL == ptr ) { \
 		RTError const ret = RT_Failure; \
@@ -74,7 +80,7 @@ SIDX_C_DLL int Error_GetLastErrorNum(void){
 }
 
 SIDX_C_DLL char* Error_GetLastErrorMsg(void){
-	if (errors.empty()) 
+	if (errors.empty())
 		return NULL;
 	else {
 		Error err = errors.top();
@@ -83,7 +89,7 @@ SIDX_C_DLL char* Error_GetLastErrorMsg(void){
 }
 
 SIDX_C_DLL char* Error_GetLastErrorMethod(void){
-	if (errors.empty()) 
+	if (errors.empty())
 		return NULL;
 	else {
 		Error err = errors.top();
@@ -102,28 +108,28 @@ SIDX_C_DLL int Error_GetErrorCount(void) {
 
 SIDX_C_DLL IndexH Index_Create(IndexPropertyH hProp)
 {
-	VALIDATE_POINTER1(hProp, "Index_Create", NULL);	  
+	VALIDATE_POINTER1(hProp, "Index_Create", NULL);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
-	
-	try { 
-		return (IndexH) new Index(*prop); 
+
+	try {
+		return (IndexH) new Index(*prop);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"Index_Create");
 		return NULL;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"Index_Create");
 		return NULL;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"Index_Create");
-		return NULL;		
+		return NULL;
 	}
 	return NULL;
 }
@@ -132,94 +138,329 @@ SIDX_C_DLL IndexH Index_CreateWithStream( IndexPropertyH hProp,
 										int (*readNext)(SpatialIndex::id_type *id, double **pMin, double **pMax, uint32_t *nDimension, const uint8_t **pData, uint32_t *nDataLength)
 									   )
 {
-	VALIDATE_POINTER1(hProp, "Index_CreateWithStream", NULL);	
+	VALIDATE_POINTER1(hProp, "Index_CreateWithStream", NULL);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
-	
-	try { 
-		return (IndexH) new Index(*prop, readNext); 
+
+	try {
+		return (IndexH) new Index(*prop, readNext);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"Index_CreateWithStream");
 		return NULL;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"Index_CreateWithStream");
 		return NULL;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"Index_CreateWithStream");
-		return NULL;		
+		return NULL;
 	}
 	return NULL;
 }
 
 SIDX_C_DLL void Index_Destroy(IndexH index)
 {
-	VALIDATE_POINTER0(index, "Index_Destroy"); 
+	VALIDATE_POINTER0(index, "Index_Destroy");
 	Index* idx = (Index*) index;
 	if (idx) delete idx;
 }
 
-SIDX_C_DLL RTError Index_DeleteData(  IndexH index, 
-									int64_t id, 
-									double* pdMin, 
-									double* pdMax, 
+SIDX_C_DLL void Index_Flush(IndexH index)
+{
+	VALIDATE_POINTER0(index, "Index_Flush");
+	Index* idx = (Index*) index;
+	if (idx)
+	{
+		idx->flush();
+	}
+}
+
+SIDX_C_DLL RTError Index_DeleteTPData( IndexH index,
+  int64_t id,
+  double* pdMin,
+  double* pdMax,
+  double* pdVMin,
+  double* pdVMax,
+  double tStart,
+  double tEnd,
+  uint32_t nDimension
+  )
+{
+  VALIDATE_POINTER1(index, "Index_DeleteTPData", RT_Failure);
+
+  Index* idx = static_cast<Index*>(index);
+
+  try {
+    idx->index().deleteData(SpatialIndex::MovingRegion(pdMin, pdMax, pdVMin, pdVMax, tStart, tEnd, nDimension), id);
+    return RT_None;
+  } catch (Tools::Exception& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what().c_str(),
+            "Index_DeleteTPData");
+    return RT_Failure;
+  } catch (std::exception const& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what(),
+            "Index_DeleteTPData");
+    return RT_Failure;
+  } catch (...) {
+    Error_PushError(RT_Failure,
+            "Unknown Error",
+            "Index_DeleteTPData");
+    return RT_Failure;
+  }
+  return RT_None;
+}
+
+SIDX_C_DLL RTError Index_DeleteMVRData( IndexH index,
+  int64_t id,
+  double* pdMin,
+  double* pdMax,
+  double tStart,
+  double tEnd,
+  uint32_t nDimension
+  )
+{
+  VALIDATE_POINTER1(index, "Index_DeleteMVRData", RT_Failure);
+
+  Index* idx = static_cast<Index*>(index);
+
+  try {
+    idx->index().deleteData(SpatialIndex::TimeRegion(pdMin, pdMax, tStart, tEnd, nDimension), id);
+    return RT_None;
+  } catch (Tools::Exception& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what().c_str(),
+            "Index_DeleteMVRData");
+    return RT_Failure;
+  } catch (std::exception const& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what(),
+            "Index_DeleteMVRData");
+    return RT_Failure;
+  } catch (...) {
+    Error_PushError(RT_Failure,
+            "Unknown Error",
+            "Index_DeleteMVRData");
+    return RT_Failure;
+  }
+  return RT_None;
+}
+
+SIDX_C_DLL RTError Index_DeleteData(  IndexH index,
+									int64_t id,
+									double* pdMin,
+									double* pdMax,
 									uint32_t nDimension)
 {
-	VALIDATE_POINTER1(index, "Index_DeleteData", RT_Failure);	   
+	VALIDATE_POINTER1(index, "Index_DeleteData", RT_Failure);
 
 	Index* idx = static_cast<Index*>(index);
 
-	try {	 
+	try {
 		idx->index().deleteData(SpatialIndex::Region(pdMin, pdMax, nDimension), id);
 		return RT_None;
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"Index_DeleteData");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"Index_DeleteData");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"Index_DeleteData");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
 
-SIDX_C_DLL RTError Index_InsertData(  IndexH index, 
-									int64_t id, 
-									double* pdMin, 
-									double* pdMax, 
+SIDX_C_DLL RTError Index_InsertTPData( IndexH index,
+  int64_t id,
+  double* pdMin,
+  double* pdMax,
+  double* pdVMin,
+  double* pdVMax,
+  double tStart,
+  double tEnd,
+  uint32_t nDimension,
+  const uint8_t* pData,
+  uint32_t nDataLength
+  )
+{
+  VALIDATE_POINTER1(index, "Index_InsertTPData", RT_Failure);
+
+  Index* idx = static_cast<Index*>(index);
+
+  // Test the data and check for the case when mins equal maxs (x,y,z,v)
+  // In that case, we will insert a SpatialIndex::MovingPoint
+  // instead of a SpatialIndex::MovingRegion
+
+  bool isPoint = false;
+  SpatialIndex::IShape* shape = 0;
+  double const epsilon = std::numeric_limits<double>::epsilon();
+
+  double length(0), vlength(0);
+  for (uint32_t i = 0; i < nDimension; ++i) {
+    double delta = pdMin[i] - pdMax[i];
+    length += std::fabs(delta);
+
+    double vDelta = pdVMin[i] - pdVMax[i];
+    vlength += std::fabs(vDelta);
+  }
+
+  if ((length <= epsilon) && (vlength <= epsilon)){
+    isPoint = true;
+  }
+
+  if (isPoint == true) {
+    shape = new SpatialIndex::MovingPoint(pdMin, pdVMin, tStart, tEnd, nDimension);
+  } else {
+    shape = new SpatialIndex::MovingRegion(pdMin, pdMax, pdVMin, pdVMax, tStart, tEnd, nDimension);
+  }
+  try {
+    idx->index().insertData(nDataLength,
+                pData,
+                *shape,
+                id);
+
+    delete shape;
+    return RT_None;
+
+  } catch (Tools::Exception& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what().c_str(),
+            "Index_InsertTPData");
+    delete shape;
+    return RT_Failure;
+  } catch (std::exception const& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what(),
+            "Index_InsertTPData");
+    delete shape;
+    return RT_Failure;
+  } catch (...) {
+    Error_PushError(RT_Failure,
+            "Unknown Error",
+            "Index_InsertTPData");
+    delete shape;
+    return RT_Failure;
+  }
+  return RT_None;
+
+}
+
+SIDX_C_DLL RTError Index_InsertMVRData( IndexH index,
+  int64_t id,
+  double* pdMin,
+  double* pdMax,
+  double tStart,
+  double tEnd,
+  uint32_t nDimension,
+  const uint8_t* pData,
+  uint32_t nDataLength
+  )
+{
+  VALIDATE_POINTER1(index, "Index_InsertMVRData", RT_Failure);
+
+  Index* idx = static_cast<Index*>(index);
+
+  // Test the data and check for the case when mins equal maxs
+  // In that case, we will insert a SpatialIndex::TimePoint
+  // instead of a SpatialIndex::timeRegion
+
+  bool isPoint = false;
+  SpatialIndex::IShape* shape = 0;
+  double const epsilon = std::numeric_limits<double>::epsilon();
+
+  double length(0);
+  for (uint32_t i = 0; i < nDimension; ++i) {
+    double delta = pdMin[i] - pdMax[i];
+    length += std::fabs(delta);
+  }
+
+  if (length <= epsilon){
+    isPoint = true;
+  }
+
+  if (isPoint == true) {
+    shape = new SpatialIndex::TimePoint(pdMin, tStart, tEnd, nDimension);
+  } else {
+    shape = new SpatialIndex::TimeRegion(pdMin, pdMax, tStart, tEnd, nDimension);
+  }
+  try {
+    idx->index().insertData(nDataLength,
+                pData,
+                *shape,
+                id);
+
+    delete shape;
+    return RT_None;
+
+  } catch (Tools::Exception& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what().c_str(),
+            "Index_InsertMVRData");
+    delete shape;
+    return RT_Failure;
+  } catch (std::exception const& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what(),
+            "Index_InsertMVRData");
+    delete shape;
+    return RT_Failure;
+  } catch (...) {
+    Error_PushError(RT_Failure,
+            "Unknown Error",
+            "Index_InsertMVRData");
+    delete shape;
+    return RT_Failure;
+  }
+  return RT_None;
+}
+
+
+SIDX_C_DLL RTError Index_InsertData(  IndexH index,
+									int64_t id,
+									double* pdMin,
+									double* pdMax,
 									uint32_t nDimension,
-									const uint8_t* pData, 
+									const uint8_t* pData,
 									uint32_t nDataLength)
 {
-	VALIDATE_POINTER1(index, "Index_InsertData", RT_Failure);	   
+	VALIDATE_POINTER1(index, "Index_InsertData", RT_Failure);
 
 	Index* idx = static_cast<Index*>(index);
-	
+
 	// Test the data and check for the case when minx == maxx, miny == maxy
-	// and minz == maxz.  In that case, we will insert a SpatialIndex::Point 
+	// and minz == maxz.  In that case, we will insert a SpatialIndex::Point
 	// instead of a SpatialIndex::Region
-	
+
 	bool isPoint = false;
 	SpatialIndex::IShape* shape = 0;
-	double const epsilon = std::numeric_limits<double>::epsilon(); 
-	
+	double const epsilon = std::numeric_limits<double>::epsilon();
+
 	double length(0);
 	for (uint32_t i = 0; i < nDimension; ++i) {
 		double delta = pdMin[i] - pdMax[i];
@@ -236,9 +477,9 @@ SIDX_C_DLL RTError Index_InsertData(  IndexH index,
 		shape = new SpatialIndex::Region(pdMin, pdMax, nDimension);
 	}
 	try {
-		idx->index().insertData(nDataLength, 
-								pData, 
-								*shape, 
+		idx->index().insertData(nDataLength,
+								pData,
+								*shape,
 								id);
 
 		delete shape;
@@ -246,155 +487,444 @@ SIDX_C_DLL RTError Index_InsertData(  IndexH index,
 
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"Index_InsertData");
 		delete shape;
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"Index_InsertData");
 		delete shape;
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"Index_InsertData");
 		delete shape;
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
 
-SIDX_C_DLL RTError Index_Intersects_obj(  IndexH index, 
-										double* pdMin, 
-										double* pdMax, 
-										uint32_t nDimension, 
-										IndexItemH** items, 
+SIDX_C_DLL RTError Index_TPIntersects_obj(  IndexH index,
+                    double* pdMin,
+                    double* pdMax,
+                    double* pdVMin,
+                    double* pdVMax,
+                    double tStart,
+                    double tEnd,
+                    uint32_t nDimension,
+                    IndexItemH** items,
+                    uint64_t* nResults)
+{
+  VALIDATE_POINTER1(index, "Index_TPIntersects_obj", RT_Failure);
+  Index* idx = static_cast<Index*>(index);
+  int64_t nResultLimit, nStart;
+
+  nResultLimit = idx->GetResultSetLimit();
+  nStart = idx->GetResultSetOffset();
+
+  ObjVisitor* visitor = new ObjVisitor;
+  try {
+    SpatialIndex::MovingRegion* r = new SpatialIndex::MovingRegion(pdMin, pdMax, pdVMin, pdVMax, tStart, tEnd, nDimension);
+    idx->index().intersectsWithQuery(	*r,
+                      *visitor);
+
+    Page_ResultSet_Obj(*visitor, items, nStart, nResultLimit, nResults);
+
+    delete r;
+    delete visitor;
+
+  } catch (Tools::Exception& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what().c_str(),
+            "Index_TPIntersects_obj");
+    delete visitor;
+    return RT_Failure;
+  } catch (std::exception const& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what(),
+            "Index_TPIntersects_obj");
+    delete visitor;
+    return RT_Failure;
+  } catch (...) {
+    Error_PushError(RT_Failure,
+            "Unknown Error",
+            "Index_TPIntersects_obj");
+    delete visitor;
+    return RT_Failure;
+  }
+  return RT_None;
+}
+
+SIDX_C_DLL RTError Index_MVRIntersects_obj(  IndexH index,
+                    double* pdMin,
+                    double* pdMax,
+                    double tStart,
+                    double tEnd,
+                    uint32_t nDimension,
+                    IndexItemH** items,
+                    uint64_t* nResults)
+{
+  VALIDATE_POINTER1(index, "Index_MVRIntersects_obj", RT_Failure);
+  Index* idx = static_cast<Index*>(index);
+  int64_t nResultLimit, nStart;
+
+  nResultLimit = idx->GetResultSetLimit();
+  nStart = idx->GetResultSetOffset();
+
+  ObjVisitor* visitor = new ObjVisitor;
+  try {
+    SpatialIndex::TimeRegion* r = new SpatialIndex::TimeRegion(pdMin, pdMax, tStart, tEnd, nDimension);
+    idx->index().intersectsWithQuery(	*r,
+                      *visitor);
+
+    Page_ResultSet_Obj(*visitor, items, nStart, nResultLimit, nResults);
+
+    delete r;
+    delete visitor;
+
+  } catch (Tools::Exception& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what().c_str(),
+            "Index_MVRIntersects_obj");
+    delete visitor;
+    return RT_Failure;
+  } catch (std::exception const& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what(),
+            "Index_TPIntersects_obj");
+    delete visitor;
+    return RT_Failure;
+  } catch (...) {
+    Error_PushError(RT_Failure,
+            "Unknown Error",
+            "Index_TPIntersects_obj");
+    delete visitor;
+    return RT_Failure;
+  }
+  return RT_None;
+}
+
+SIDX_C_DLL RTError Index_Intersects_obj(  IndexH index,
+										double* pdMin,
+										double* pdMax,
+										uint32_t nDimension,
+										IndexItemH** items,
 										uint64_t* nResults)
 {
-	VALIDATE_POINTER1(index, "Index_Intersects_obj", RT_Failure);	   
+	VALIDATE_POINTER1(index, "Index_Intersects_obj", RT_Failure);
 	Index* idx = static_cast<Index*>(index);
+	int64_t nResultLimit, nStart;
+
+	nResultLimit = idx->GetResultSetLimit();
+	nStart = idx->GetResultSetOffset();
 
 	ObjVisitor* visitor = new ObjVisitor;
-	try {	 
-        SpatialIndex::Region* r = new SpatialIndex::Region(pdMin, pdMax, nDimension);
-		idx->index().intersectsWithQuery(	*r, 
+	try {
+    SpatialIndex::Region* r = new SpatialIndex::Region(pdMin, pdMax, nDimension);
+		idx->index().intersectsWithQuery(	*r,
 											*visitor);
 
-		*items = (SpatialIndex::IData**) malloc (visitor->GetResultCount() * sizeof(SpatialIndex::IData*));
-		
-		std::vector<SpatialIndex::IData*>& results = visitor->GetResults();
-
-		// copy the Items into the newly allocated item array
-		// we need to make sure to copy the actual Item instead 
-		// of just the pointers, as the visitor will nuke them 
-		// upon ~
-		for (uint32_t i=0; i < visitor->GetResultCount(); ++i)
-		{
-			SpatialIndex::IData* result =results[i];
-			(*items)[i] =  dynamic_cast<SpatialIndex::IData*>(result->clone());
+    Page_ResultSet_Obj(*visitor, items, nStart, nResultLimit, nResults);
 
-		}
-		*nResults = visitor->GetResultCount();
-		
-        delete r;
+    delete r;
 		delete visitor;
 
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"Index_Intersects_obj");
 		delete visitor;
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"Index_Intersects_obj");
 		delete visitor;
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"Index_Intersects_obj");
 		delete visitor;
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
 
-SIDX_C_DLL RTError Index_Intersects_id(	  IndexH index, 
-										double* pdMin, 
-										double* pdMax, 
-										uint32_t nDimension, 
-										int64_t** ids, 
+SIDX_C_DLL RTError Index_TPIntersects_id(  IndexH index,
+                    double* pdMin,
+                    double* pdMax,
+                    double* pdVMin,
+                    double* pdVMax,
+                    double tStart,
+                    double tEnd,
+                    uint32_t nDimension,
+                    int64_t** ids,
+                    uint64_t* nResults)
+{
+  VALIDATE_POINTER1(index, "Index_TPIntersects_id", RT_Failure);
+  Index* idx = static_cast<Index*>(index);
+
+  int64_t nResultLimit, nStart;
+
+  nResultLimit = idx->GetResultSetLimit();
+  nStart = idx->GetResultSetOffset();
+
+  IdVisitor* visitor = new IdVisitor;
+  try {
+    SpatialIndex::MovingRegion* r = new SpatialIndex::MovingRegion(pdMin, pdMax, pdVMin, pdVMax, tStart, tEnd, nDimension);
+    idx->index().intersectsWithQuery(	*r,
+                      *visitor);
+
+    Page_ResultSet_Ids(*visitor, ids, nStart, nResultLimit, nResults);
+
+    delete r;
+    delete visitor;
+
+  } catch (Tools::Exception& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what().c_str(),
+            "Index_TPIntersects_id");
+    delete visitor;
+    return RT_Failure;
+  } catch (std::exception const& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what(),
+            "Index_TPIntersects_id");
+    delete visitor;
+    return RT_Failure;
+  } catch (...) {
+    Error_PushError(RT_Failure,
+            "Unknown Error",
+            "Index_TPIntersects_id");
+    delete visitor;
+    return RT_Failure;
+  }
+  return RT_None;
+}
+
+SIDX_C_DLL RTError Index_MVRIntersects_id(  IndexH index,
+                    double* pdMin,
+                    double* pdMax,
+                    double tStart,
+                    double tEnd,
+                    uint32_t nDimension,
+                    int64_t** ids,
+                    uint64_t* nResults)
+{
+  VALIDATE_POINTER1(index, "Index_MVRIntersects_id", RT_Failure);
+  Index* idx = static_cast<Index*>(index);
+
+  int64_t nResultLimit, nStart;
+
+  nResultLimit = idx->GetResultSetLimit();
+  nStart = idx->GetResultSetOffset();
+
+  IdVisitor* visitor = new IdVisitor;
+  try {
+    SpatialIndex::TimeRegion* r = new SpatialIndex::TimeRegion(pdMin, pdMax, tStart, tEnd, nDimension);
+    idx->index().intersectsWithQuery(	*r,
+                      *visitor);
+
+    Page_ResultSet_Ids(*visitor, ids, nStart, nResultLimit, nResults);
+
+    delete r;
+    delete visitor;
+
+  } catch (Tools::Exception& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what().c_str(),
+            "Index_MVRIntersects_id");
+    delete visitor;
+    return RT_Failure;
+  } catch (std::exception const& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what(),
+            "Index_MVRIntersects_id");
+    delete visitor;
+    return RT_Failure;
+  } catch (...) {
+    Error_PushError(RT_Failure,
+            "Unknown Error",
+            "Index_MVRIntersects_id");
+    delete visitor;
+    return RT_Failure;
+  }
+  return RT_None;
+}
+
+SIDX_C_DLL RTError Index_Intersects_id(	  IndexH index,
+										double* pdMin,
+										double* pdMax,
+										uint32_t nDimension,
+										int64_t** ids,
 										uint64_t* nResults)
 {
-	VALIDATE_POINTER1(index, "Index_Intersects_id", RT_Failure);	  
+	VALIDATE_POINTER1(index, "Index_Intersects_id", RT_Failure);
 	Index* idx = static_cast<Index*>(index);
 
+	int64_t nResultLimit, nStart;
+
+	nResultLimit = idx->GetResultSetLimit();
+  nStart = idx->GetResultSetOffset();
+
 	IdVisitor* visitor = new IdVisitor;
 	try {
-        SpatialIndex::Region* r = new SpatialIndex::Region(pdMin, pdMax, nDimension);
-		idx->index().intersectsWithQuery(	*r, 
+    SpatialIndex::Region* r = new SpatialIndex::Region(pdMin, pdMax, nDimension);
+		idx->index().intersectsWithQuery(	*r,
 											*visitor);
 
-		*nResults = visitor->GetResultCount();
-
-		*ids = (int64_t*) malloc (*nResults * sizeof(int64_t));
-		
-		std::vector<uint64_t>& results = visitor->GetResults();
-
-		for (uint32_t i=0; i < *nResults; ++i)
-		{
-			(*ids)[i] = results[i];
+    Page_ResultSet_Ids(*visitor, ids, nStart, nResultLimit, nResults);
 
-		}
-
-        delete r;
+    delete r;
 		delete visitor;
 
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"Index_Intersects_id");
 		delete visitor;
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"Index_Intersects_id");
 		delete visitor;
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"Index_Intersects_id");
 		delete visitor;
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
 
-SIDX_C_DLL RTError Index_Intersects_count(	  IndexH index, 
-										double* pdMin, 
-										double* pdMax, 
-										uint32_t nDimension, 
+SIDX_C_DLL RTError Index_TPIntersects_count(	  IndexH index,
+                    double* pdMin,
+                    double* pdMax,
+                    double* pdVMin,
+                    double* pdVMax,
+                    double tStart,
+                    double tEnd,
+                    uint32_t nDimension,
+                    uint64_t* nResults)
+{
+  VALIDATE_POINTER1(index, "Index_TPIntersects_count", RT_Failure);
+  Index* idx = static_cast<Index*>(index);
+
+  CountVisitor* visitor = new CountVisitor;
+  try {
+    SpatialIndex::MovingRegion* r = new SpatialIndex::MovingRegion(pdMin, pdMax, pdVMin, pdVMax, tStart, tEnd, nDimension);
+    idx->index().intersectsWithQuery(	*r,
+                      *visitor);
+
+    *nResults = visitor->GetResultCount();
+
+    delete r;
+    delete visitor;
+
+  } catch (Tools::Exception& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what().c_str(),
+            "Index_TPIntersects_count");
+    delete visitor;
+    return RT_Failure;
+  } catch (std::exception const& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what(),
+            "Index_TPIntersects_count");
+    delete visitor;
+    return RT_Failure;
+  } catch (...) {
+    Error_PushError(RT_Failure,
+            "Unknown Error",
+            "Index_TPIntersects_count");
+    delete visitor;
+    return RT_Failure;
+  }
+  return RT_None;
+}
+
+SIDX_C_DLL RTError Index_MVRIntersects_count(	  IndexH index,
+                    double* pdMin,
+                    double* pdMax,
+                    double tStart,
+                    double tEnd,
+                    uint32_t nDimension,
+                    uint64_t* nResults)
+{
+  VALIDATE_POINTER1(index, "Index_MVRIntersects_count", RT_Failure);
+  Index* idx = static_cast<Index*>(index);
+
+  CountVisitor* visitor = new CountVisitor;
+  try {
+    SpatialIndex::TimeRegion* r = new SpatialIndex::TimeRegion(pdMin, pdMax, tStart, tEnd, nDimension);
+    idx->index().intersectsWithQuery(	*r,
+                      *visitor);
+
+    *nResults = visitor->GetResultCount();
+
+    delete r;
+    delete visitor;
+
+  } catch (Tools::Exception& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what().c_str(),
+            "Index_MVRIntersects_count");
+    delete visitor;
+    return RT_Failure;
+  } catch (std::exception const& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what(),
+            "Index_MVRIntersects_count");
+    delete visitor;
+    return RT_Failure;
+  } catch (...) {
+    Error_PushError(RT_Failure,
+            "Unknown Error",
+            "Index_MVRIntersects_count");
+    delete visitor;
+    return RT_Failure;
+  }
+  return RT_None;
+}
+
+SIDX_C_DLL RTError Index_Intersects_count(	  IndexH index,
+										double* pdMin,
+										double* pdMax,
+										uint32_t nDimension,
 										uint64_t* nResults)
 {
-	VALIDATE_POINTER1(index, "Index_Intersects_count", RT_Failure);	  
+	VALIDATE_POINTER1(index, "Index_Intersects_count", RT_Failure);
 	Index* idx = static_cast<Index*>(index);
 
 	CountVisitor* visitor = new CountVisitor;
 	try {
-        SpatialIndex::Region* r = new SpatialIndex::Region(pdMin, pdMax, nDimension);
-		idx->index().intersectsWithQuery(	*r, 
+    SpatialIndex::Region* r = new SpatialIndex::Region(pdMin, pdMax, nDimension);
+		idx->index().intersectsWithQuery(	*r,
 											*visitor);
 
 		*nResults = visitor->GetResultCount();
@@ -404,155 +934,140 @@ SIDX_C_DLL RTError Index_Intersects_count(	  IndexH index,
 
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"Index_Intersects_count");
 		delete visitor;
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"Index_Intersects_count");
 		delete visitor;
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"Index_Intersects_count");
 		delete visitor;
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
 
-SIDX_C_DLL RTError Index_SegmentIntersects_obj(  IndexH index, 
-										double* pdStartPoint, 
-										double* pdEndPoint, 
-										uint32_t nDimension, 
-										IndexItemH** items, 
+SIDX_C_DLL RTError Index_SegmentIntersects_obj(  IndexH index,
+										double* pdStartPoint,
+										double* pdEndPoint,
+										uint32_t nDimension,
+										IndexItemH** items,
 										uint64_t* nResults)
 {
-	VALIDATE_POINTER1(index, "Index_Intersects_obj", RT_Failure);	   
+	VALIDATE_POINTER1(index, "Index_Intersects_obj", RT_Failure);
 	Index* idx = static_cast<Index*>(index);
 
+  int64_t nResultLimit, nStart;
+
+  nResultLimit = idx->GetResultSetLimit();
+  nStart = idx->GetResultSetOffset();
+
 	ObjVisitor* visitor = new ObjVisitor;
-	try {	 
-        SpatialIndex::LineSegment* l = new SpatialIndex::LineSegment(pdStartPoint, pdEndPoint, nDimension);
-		idx->index().intersectsWithQuery(	*l, 
+	try {
+    SpatialIndex::LineSegment* l = new SpatialIndex::LineSegment(pdStartPoint, pdEndPoint, nDimension);
+		idx->index().intersectsWithQuery(	*l,
 											*visitor);
 
-		*items = (SpatialIndex::IData**) malloc (visitor->GetResultCount() * sizeof(SpatialIndex::IData*));
-		
-		std::vector<SpatialIndex::IData*>& results = visitor->GetResults();
-
-		// copy the Items into the newly allocated item array
-		// we need to make sure to copy the actual Item instead 
-		// of just the pointers, as the visitor will nuke them 
-		// upon ~
-		for (uint32_t i=0; i < visitor->GetResultCount(); ++i)
-		{
-			SpatialIndex::IData* result =results[i];
-			(*items)[i] =  dynamic_cast<SpatialIndex::IData*>(result->clone());
+    Page_ResultSet_Obj(*visitor, items, nStart, nResultLimit, nResults);
 
-		}
-		*nResults = visitor->GetResultCount();
-		
-        delete l;
+    delete l;
 		delete visitor;
 
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"Index_Intersects_obj");
 		delete visitor;
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"Index_Intersects_obj");
 		delete visitor;
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"Index_Intersects_obj");
 		delete visitor;
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
 
-SIDX_C_DLL RTError Index_SegmentIntersects_id(	  IndexH index, 
-										double* pdStartPoint, 
-										double* pdEndPoint, 
-										uint32_t nDimension, 
-										int64_t** ids, 
+SIDX_C_DLL RTError Index_SegmentIntersects_id(	  IndexH index,
+										double* pdStartPoint,
+										double* pdEndPoint,
+										uint32_t nDimension,
+										int64_t** ids,
 										uint64_t* nResults)
 {
-	VALIDATE_POINTER1(index, "Index_Intersects_id", RT_Failure);	  
+	VALIDATE_POINTER1(index, "Index_Intersects_id", RT_Failure);
 	Index* idx = static_cast<Index*>(index);
+  int64_t nResultLimit, nStart;
+
+  nResultLimit = idx->GetResultSetLimit();
+  nStart = idx->GetResultSetOffset();
 
 	IdVisitor* visitor = new IdVisitor;
 	try {
-        SpatialIndex::LineSegment* l = new SpatialIndex::LineSegment(pdStartPoint, pdEndPoint, nDimension);
-		idx->index().intersectsWithQuery(	*l, 
+    SpatialIndex::LineSegment* l = new SpatialIndex::LineSegment(pdStartPoint, pdEndPoint, nDimension);
+		idx->index().intersectsWithQuery(	*l,
 											*visitor);
 
-		*nResults = visitor->GetResultCount();
-
-		*ids = (int64_t*) malloc (*nResults * sizeof(int64_t));
-		
-		std::vector<uint64_t>& results = visitor->GetResults();
+    Page_ResultSet_Ids(*visitor, ids, nStart, nResultLimit, nResults);
 
-		for (uint32_t i=0; i < *nResults; ++i)
-		{
-			(*ids)[i] = results[i];
-
-		}
-
-        delete l;
+    delete l;
 		delete visitor;
 
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"Index_Intersects_id");
 		delete visitor;
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"Index_Intersects_id");
 		delete visitor;
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"Index_Intersects_id");
 		delete visitor;
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
 
-SIDX_C_DLL RTError Index_SegmentIntersects_count(	  IndexH index, 
-										double* pdStartPoint, 
-										double* pdEndPoint, 
-										uint32_t nDimension, 
+SIDX_C_DLL RTError Index_SegmentIntersects_count(	  IndexH index,
+										double* pdStartPoint,
+										double* pdEndPoint,
+										uint32_t nDimension,
 										uint64_t* nResults)
 {
-	VALIDATE_POINTER1(index, "Index_Intersects_count", RT_Failure);	  
+	VALIDATE_POINTER1(index, "Index_Intersects_count", RT_Failure);
 	Index* idx = static_cast<Index*>(index);
 
 	CountVisitor* visitor = new CountVisitor;
 	try {
         SpatialIndex::LineSegment* l = new SpatialIndex::LineSegment(pdStartPoint, pdEndPoint, nDimension);
-		idx->index().intersectsWithQuery(	*l, 
+		idx->index().intersectsWithQuery(	*l,
 											*visitor);
 
 		*nResults = visitor->GetResultCount();
@@ -562,146 +1077,353 @@ SIDX_C_DLL RTError Index_SegmentIntersects_count(	  IndexH index,
 
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"Index_Intersects_count");
 		delete visitor;
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"Index_Intersects_count");
 		delete visitor;
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"Index_Intersects_count");
 		delete visitor;
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
 
-SIDX_C_DLL RTError Index_NearestNeighbors_id(IndexH index, 
-											double* pdMin, 
-											double* pdMax, 
-											uint32_t nDimension, 
-											int64_t** ids, 
+SIDX_C_DLL RTError Index_TPNearestNeighbors_id(IndexH index,
+                      double* pdMin,
+                      double* pdMax,
+                      double* pdVMin,
+                      double* pdVMax,
+                      double tStart,
+                      double tEnd,
+                      uint32_t nDimension,
+                      int64_t** ids,
+                      uint64_t* nResults)
+{
+  VALIDATE_POINTER1(index, "Index_TPNearestNeighbors_id", RT_Failure);
+  Index* idx = static_cast<Index*>(index);
+  int64_t nResultLimit, nStart;
+
+  nResultLimit = idx->GetResultSetLimit();
+  nStart = idx->GetResultSetOffset();
+
+  IdVisitor* visitor = new IdVisitor;
+
+  try {
+    SpatialIndex::MovingRegion* r = new SpatialIndex::MovingRegion(pdMin, pdMax, pdVMin, pdVMax, tStart, tEnd, nDimension);
+    idx->index().nearestNeighborQuery(	static_cast<uint32_t>(*nResults),
+                      *r,
+                      *visitor);
+
+    Page_ResultSet_Ids(*visitor, ids, nStart, nResultLimit, nResults);
+
+    delete r;
+    delete visitor;
+
+  } catch (Tools::Exception& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what().c_str(),
+            "Index_TPNearestNeighbors_id");
+    delete visitor;
+    return RT_Failure;
+  } catch (std::exception const& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what(),
+            "Index_TPNearestNeighbors_id");
+    delete visitor;
+    return RT_Failure;
+  } catch (...) {
+    Error_PushError(RT_Failure,
+            "Unknown Error",
+            "Index_TPNearestNeighbors_id");
+    delete visitor;
+    return RT_Failure;
+  }
+  return RT_None;
+}
+
+SIDX_C_DLL RTError Index_MVRNearestNeighbors_id(IndexH index,
+                      double* pdMin,
+                      double* pdMax,
+                      double tStart,
+                      double tEnd,
+                      uint32_t nDimension,
+                      int64_t** ids,
+                      uint64_t* nResults)
+{
+  VALIDATE_POINTER1(index, "Index_MVRNearestNeighbors_id", RT_Failure);
+  Index* idx = static_cast<Index*>(index);
+  int64_t nResultLimit, nStart;
+
+  nResultLimit = idx->GetResultSetLimit();
+  nStart = idx->GetResultSetOffset();
+
+  IdVisitor* visitor = new IdVisitor;
+
+  try {
+    SpatialIndex::TimeRegion* r = new SpatialIndex::TimeRegion(pdMin, pdMax, tStart, tEnd, nDimension);
+    idx->index().nearestNeighborQuery(	*nResults,
+                      *r,
+                      *visitor);
+
+    Page_ResultSet_Ids(*visitor, ids, nStart, nResultLimit, nResults);
+
+    delete r;
+    delete visitor;
+
+  } catch (Tools::Exception& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what().c_str(),
+            "Index_MVRNearestNeighbors_id");
+    delete visitor;
+    return RT_Failure;
+  } catch (std::exception const& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what(),
+            "Index_MVRNearestNeighbors_id");
+    delete visitor;
+    return RT_Failure;
+  } catch (...) {
+    Error_PushError(RT_Failure,
+            "Unknown Error",
+            "Index_MVRNearestNeighbors_id");
+    delete visitor;
+    return RT_Failure;
+  }
+  return RT_None;
+}
+
+SIDX_C_DLL RTError Index_NearestNeighbors_id(IndexH index,
+											double* pdMin,
+											double* pdMax,
+											uint32_t nDimension,
+											int64_t** ids,
 											uint64_t* nResults)
 {
-	VALIDATE_POINTER1(index, "Index_NearestNeighbors_id", RT_Failure);	
+	VALIDATE_POINTER1(index, "Index_NearestNeighbors_id", RT_Failure);
 	Index* idx = static_cast<Index*>(index);
+  int64_t nResultLimit, nStart;
+
+  nResultLimit = idx->GetResultSetLimit();
+  nStart = idx->GetResultSetOffset();
 
 	IdVisitor* visitor = new IdVisitor;
 
-	try {	 
-		idx->index().nearestNeighborQuery(	*nResults,
-											SpatialIndex::Region(pdMin, pdMax, nDimension), 
+	try {
+    SpatialIndex::Region* r = new SpatialIndex::Region(pdMin, pdMax, nDimension);
+
+		idx->index().nearestNeighborQuery(	static_cast<uint32_t>(*nResults),
+											*r,
 											*visitor);
-		
-		*ids = (int64_t*) malloc (visitor->GetResultCount() * sizeof(int64_t));
-		
-		std::vector<uint64_t>& results = visitor->GetResults();
-
-		*nResults = results.size();
-		
-		for (uint32_t i=0; i < *nResults; ++i)
-		{
-			(*ids)[i] = results[i];
 
-		}
+		Page_ResultSet_Ids(*visitor, ids, nStart, nResultLimit, nResults);
 
-		
+    delete r;
 		delete visitor;
-		
+
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"Index_NearestNeighbors_id");
 		delete visitor;
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"Index_NearestNeighbors_id");
 		delete visitor;
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"Index_NearestNeighbors_id");
 		delete visitor;
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
 
-SIDX_C_DLL RTError Index_NearestNeighbors_obj(IndexH index, 
-											double* pdMin, 
-											double* pdMax, 
-											uint32_t nDimension, 
-											IndexItemH** items, 
-											int64_t* nResults)
+SIDX_C_DLL RTError Index_TPNearestNeighbors_obj(IndexH index,
+                      double* pdMin,
+                      double* pdMax,
+                      double* pdVMin,
+                      double* pdVMax,
+                      double tStart,
+                      double tEnd,
+                      uint32_t nDimension,
+                      IndexItemH** items,
+                      uint64_t* nResults)
+{
+  VALIDATE_POINTER1(index, "Index_TPNearestNeighbors_obj", RT_Failure);
+  Index* idx = static_cast<Index*>(index);
+
+  int64_t nResultLimit, nStart;
+
+  nResultLimit = idx->GetResultSetLimit();
+  nStart = idx->GetResultSetOffset();
+
+  ObjVisitor* visitor = new ObjVisitor;
+  try {
+    SpatialIndex::MovingRegion* r = new SpatialIndex::MovingRegion(pdMin, pdMax, pdVMin, pdVMax, tStart, tEnd, nDimension);
+
+    idx->index().nearestNeighborQuery(	static_cast<uint32_t>(*nResults),
+                      *r,
+                      *visitor);
+
+    Page_ResultSet_Obj(*visitor, items, nStart, nResultLimit, nResults);
+
+    delete r;
+    delete visitor;
+
+  } catch (Tools::Exception& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what().c_str(),
+            "Index_TPNearestNeighbors_obj");
+    delete visitor;
+    return RT_Failure;
+  } catch (std::exception const& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what(),
+            "Index_TPNearestNeighbors_obj");
+    delete visitor;
+    return RT_Failure;
+  } catch (...) {
+    Error_PushError(RT_Failure,
+            "Unknown Error",
+            "Index_NearestNeighbors_obj");
+    delete visitor;
+    return RT_Failure;
+  }
+  return RT_None;
+}
+
+SIDX_C_DLL RTError Index_MVRNearestNeighbors_obj(IndexH index,
+                      double* pdMin,
+                      double* pdMax,
+                      double tStart,
+                      double tEnd,
+                      uint32_t nDimension,
+                      IndexItemH** items,
+                      uint64_t* nResults)
+{
+  VALIDATE_POINTER1(index, "Index_MVRNearestNeighbors_obj", RT_Failure);
+  Index* idx = static_cast<Index*>(index);
+
+  int64_t nResultLimit, nStart;
+
+  nResultLimit = idx->GetResultSetLimit();
+  nStart = idx->GetResultSetOffset();
+
+  ObjVisitor* visitor = new ObjVisitor;
+  try {
+    SpatialIndex::TimeRegion* r = new SpatialIndex::TimeRegion(pdMin, pdMax, tStart, tEnd, nDimension);
+
+    idx->index().nearestNeighborQuery(	*nResults,
+                      *r,
+                      *visitor);
+
+    Page_ResultSet_Obj(*visitor, items, nStart, nResultLimit, nResults);
+
+    delete r;
+    delete visitor;
+
+  } catch (Tools::Exception& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what().c_str(),
+            "Index_MVRNearestNeighbors_obj");
+    delete visitor;
+    return RT_Failure;
+  } catch (std::exception const& e)
+  {
+    Error_PushError(RT_Failure,
+            e.what(),
+            "Index_MVRNearestNeighbors_obj");
+    delete visitor;
+    return RT_Failure;
+  } catch (...) {
+    Error_PushError(RT_Failure,
+            "Unknown Error",
+            "Index_NearestNeighbors_obj");
+    delete visitor;
+    return RT_Failure;
+  }
+  return RT_None;
+}
+
+SIDX_C_DLL RTError Index_NearestNeighbors_obj(IndexH index,
+											double* pdMin,
+											double* pdMax,
+											uint32_t nDimension,
+											IndexItemH** items,
+											uint64_t* nResults)
 {
-	VALIDATE_POINTER1(index, "Index_NearestNeighbors_obj", RT_Failure);	 
+	VALIDATE_POINTER1(index, "Index_NearestNeighbors_obj", RT_Failure);
 	Index* idx = static_cast<Index*>(index);
 
+  int64_t nResultLimit, nStart;
+
+  nResultLimit = idx->GetResultSetLimit();
+  nStart = idx->GetResultSetOffset();
+
 	ObjVisitor* visitor = new ObjVisitor;
-	try {	 
-		idx->index().nearestNeighborQuery(	*nResults,
-											SpatialIndex::Region(pdMin, pdMax, nDimension), 
+	try {
+    SpatialIndex::Region* r = new SpatialIndex::Region(pdMin, pdMax, nDimension);
+
+		idx->index().nearestNeighborQuery(	static_cast<uint32_t>(*nResults),
+											*r,
 											*visitor);
 
-				
-		*items = (SpatialIndex::IData**) malloc (visitor->GetResultCount() * sizeof(Item*));
-		
-		std::vector<SpatialIndex::IData*> results = visitor->GetResults();
-		*nResults = results.size();
-		
-		// copy the Items into the newly allocated item array
-		// we need to make sure to copy the actual Item instead 
-		// of just the pointers, as the visitor will nuke them 
-		// upon ~
-		for (uint32_t i=0; i < visitor->GetResultCount(); ++i)
-		{
-			SpatialIndex::IData* result = results[i];
-			(*items)[i] =  dynamic_cast<SpatialIndex::IData*>(result->clone());
+    Page_ResultSet_Obj(*visitor, items, nStart, nResultLimit, nResults);
 
-		}
-		
+    delete r;
 		delete visitor;
 
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"Index_NearestNeighbors_obj");
 		delete visitor;
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"Index_NearestNeighbors_obj");
 		delete visitor;
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"Index_NearestNeighbors_obj");
 		delete visitor;
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
 
-SIDX_C_DLL RTError Index_GetBounds(	  IndexH index, 
-									double** ppdMin, 
-									double** ppdMax, 
+SIDX_C_DLL RTError Index_GetBounds(	  IndexH index,
+									double** ppdMin,
+									double** ppdMax,
 									uint32_t* nDimension)
 {
 	VALIDATE_POINTER1(index, "Index_GetBounds", RT_Failure);
@@ -709,72 +1431,120 @@ SIDX_C_DLL RTError Index_GetBounds(	  IndexH index,
 
 	BoundsQuery* query = new BoundsQuery;
 
-	try {	 
+	try {
 		idx->index().queryStrategy( *query);
-		
+
 		const SpatialIndex::Region* bounds = query->GetBounds();
-		if (bounds == 0) { 
+		if (bounds == 0) {
 			*nDimension = 0;
 			delete query;
 			return RT_None;
 		}
-		
+
 		*nDimension =bounds->getDimension();
-		
+
 		*ppdMin = (double*) malloc (*nDimension * sizeof(double));
 		*ppdMax = (double*) malloc (*nDimension * sizeof(double));
-		
+
 		for (uint32_t i=0; i< *nDimension; ++i) {
 			(*ppdMin)[i] = bounds->getLow(i);
 			(*ppdMax)[i] = bounds->getHigh(i);
 		}
-		
+
 		delete query;
 
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"Index_GetBounds");
 		delete query;
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"Index_GetBounds");
 		delete query;
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"Index_GetBounds");
 		delete query;
-		return RT_Failure;		  
+		return RT_Failure;
+	}
+	return RT_None;
+}
+
+SIDX_DLL RTError Index_SetResultSetOffset(IndexH index, int64_t value)
+{
+	try
+	{
+		VALIDATE_POINTER1(index, "Index_SetResultSetOffset", RT_Failure);
+		Index* idx = static_cast<Index*>(index);
+		idx->SetResultSetOffset(value);
+	}
+	catch (...) {
+		Error_PushError(RT_Failure,
+						"Unknown Error",
+						"Index_SetResultSetOffset");
+		return RT_Failure;
 	}
 	return RT_None;
 }
 
+SIDX_DLL int64_t Index_GetResultSetOffset(IndexH index)
+{
+	VALIDATE_POINTER1(index, "Index_GetResultSetOffset", 0);
+	Index* idx = static_cast<Index*>(index);
+	return idx->GetResultSetOffset();
+}
+
+SIDX_DLL RTError Index_SetResultSetLimit(IndexH index, int64_t value)
+{
+	try
+	{
+		VALIDATE_POINTER1(index, "Index_SetResultSetLimit", RT_Failure);
+		Index* idx = static_cast<Index*>(index);
+		idx->SetResultSetLimit(value);
+	}
+	catch (...) {
+		Error_PushError(RT_Failure,
+						"Unknown Error",
+						"Index_SetResultSetLimit");
+		return RT_Failure;
+	}
+	return RT_None;
+}
+
+SIDX_DLL int64_t Index_GetResultSetLimit(IndexH index)
+{
+	VALIDATE_POINTER1(index, "Index_GetResultSetLimit", 0);
+	Index* idx = static_cast<Index*>(index);
+	return idx->GetResultSetLimit();
+}
+
 SIDX_C_DLL uint32_t Index_IsValid(IndexH index)
 {
-	VALIDATE_POINTER1(index, "Index_IsValid", 0); 
+	VALIDATE_POINTER1(index, "Index_IsValid", 0);
 	Index* idx = static_cast<Index*>(index);
-	return static_cast<uint32_t>(idx->index().isIndexValid());	  
+	return static_cast<uint32_t>(idx->index().isIndexValid());
 }
 
 SIDX_C_DLL IndexPropertyH Index_GetProperties(IndexH index)
 {
-	VALIDATE_POINTER1(index, "Index_GetProperties", 0); 
+	VALIDATE_POINTER1(index, "Index_GetProperties", 0);
 	Index* idx = static_cast<Index*>(index);
 	Tools::PropertySet* ps = new Tools::PropertySet;
-	
+
 	idx->index().getIndexProperties(*ps);
 	return (IndexPropertyH)ps;
 }
 
 SIDX_C_DLL void Index_ClearBuffer(IndexH index)
 {
-	VALIDATE_POINTER0(index, "Index_ClearBuffer"); 
+	VALIDATE_POINTER0(index, "Index_ClearBuffer");
 	Index* idx = static_cast<Index*>(index);
 	idx->buffer().clear();
 }
@@ -786,11 +1556,11 @@ SIDX_C_DLL void Index_DestroyObjResults(IndexItemH* results, uint32_t nResults)
 	for (uint32_t i=0; i< nResults; ++i) {
 		if (results[i] != NULL) {
 			it = static_cast<SpatialIndex::IData*>(results[i]);
-			if (it != 0) 
+			if (it != 0)
 				delete it;
 		}
 	}
-	
+
 	std::free(results);
 }
 
@@ -802,18 +1572,18 @@ SIDX_C_DLL void Index_Free(void* results)
 	    std::free(results);
 }
 
-SIDX_C_DLL RTError Index_GetLeaves(	IndexH index, 
+SIDX_C_DLL RTError Index_GetLeaves(	IndexH index,
 									uint32_t* nNumLeafNodes,
-									uint32_t** nLeafSizes, 
-									int64_t** nLeafIDs, 
+									uint32_t** nLeafSizes,
+									int64_t** nLeafIDs,
 									int64_t*** nLeafChildIDs,
-									double*** pppdMin, 
-									double*** pppdMax, 
+									double*** pppdMin,
+									double*** pppdMax,
 									uint32_t* nDimension)
 {
 	VALIDATE_POINTER1(index, "Index_GetLeaves", RT_Failure);
 	Index* idx = static_cast<Index*>(index);
-	
+
 	std::vector<LeafQueryResult>::const_iterator i;
 	LeafQuery* query = new LeafQuery;
 
@@ -827,37 +1597,37 @@ SIDX_C_DLL RTError Index_GetLeaves(	IndexH index,
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_ULONG) {
-			Error_PushError(RT_Failure, 
-							"Property Dimension must be Tools::VT_ULONG", 
+			Error_PushError(RT_Failure,
+							"Property Dimension must be Tools::VT_ULONG",
 							"Index_GetLeaves");
 			return RT_Failure;
 		}
 	}
-	
+
 	*nDimension = var.m_val.ulVal;
-		
-	try {	 
+
+	try {
 		idx->index().queryStrategy( *query);
-		
+
 		const std::vector<LeafQueryResult>& results = query->GetResults();
 
-		*nNumLeafNodes = results.size();
-		
+		*nNumLeafNodes = (uint32_t)results.size();
+
 		*nLeafSizes = (uint32_t*) malloc (*nNumLeafNodes * sizeof(uint32_t));
 		*nLeafIDs = (int64_t*) malloc (*nNumLeafNodes * sizeof(int64_t));
 
 		*nLeafChildIDs = (int64_t**) malloc(*nNumLeafNodes * sizeof(int64_t*));
 		*pppdMin = (double**) malloc (*nNumLeafNodes * sizeof(double*));
 		*pppdMax = (double**) malloc (*nNumLeafNodes * sizeof(double*));
-		
+
 		uint32_t k=0;
 		for (i = results.begin(); i != results.end(); ++i)
 		{
 			std::vector<SpatialIndex::id_type> const& ids = (*i).GetIDs();
 			const SpatialIndex::Region* b = (*i).GetBounds();
-			
+
 			(*nLeafIDs)[k] = (*i).getIdentifier();
-			(*nLeafSizes)[k] = ids.size();
+			(*nLeafSizes)[k] = (uint32_t)ids.size();
 
 			(*nLeafChildIDs)[k] = (int64_t*) malloc( (*nLeafSizes)[k] * sizeof(int64_t));
 			(*pppdMin)[k] = (double*) malloc ( (*nLeafSizes)[k] *  sizeof(double));
@@ -873,29 +1643,29 @@ SIDX_C_DLL RTError Index_GetLeaves(	IndexH index,
 			++k;
 		}
 
-		
+
 		delete query;
 
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"Index_GetLeaves");
 		delete query;
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"Index_GetLeaves");
 		delete query;
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"Index_GetLeaves");
 		delete query;
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -903,7 +1673,7 @@ SIDX_C_DLL RTError Index_GetLeaves(	IndexH index,
 
 SIDX_C_DLL void IndexItem_Destroy(IndexItemH item)
 {
-	VALIDATE_POINTER0(item, "IndexItem_Destroy"); 
+	VALIDATE_POINTER0(item, "IndexItem_Destroy");
 	SpatialIndex::IData* it = static_cast<SpatialIndex::IData*>(item);
 	if (it != 0) delete it;
 }
@@ -912,7 +1682,7 @@ SIDX_C_DLL RTError IndexItem_GetData( IndexItemH item,
 									uint8_t** data,
 									uint64_t* length)
 {
-	VALIDATE_POINTER1(item, "IndexItem_GetData", RT_Failure);  
+	VALIDATE_POINTER1(item, "IndexItem_GetData", RT_Failure);
 	SpatialIndex::IData* it = static_cast<SpatialIndex::IData*>(item);
     uint8_t* p_data;
     uint32_t* l= new uint32_t;
@@ -925,49 +1695,49 @@ SIDX_C_DLL RTError IndexItem_GetData( IndexItemH item,
         delete[] p_data;
         delete l;
 	return RT_None;
-	
+
 }
 
-SIDX_C_DLL int64_t IndexItem_GetID(IndexItemH item) 
+SIDX_C_DLL int64_t IndexItem_GetID(IndexItemH item)
 {
-	VALIDATE_POINTER1(item, "IndexItem_GetID",0); 
+	VALIDATE_POINTER1(item, "IndexItem_GetID",0);
 	SpatialIndex::IData* it = static_cast<SpatialIndex::IData*>(item);
 	int64_t value = it->getIdentifier();
 	return value;
 }
 
-SIDX_C_DLL RTError IndexItem_GetBounds(	  IndexItemH item, 
-										double** ppdMin, 
-										double** ppdMax, 
+SIDX_C_DLL RTError IndexItem_GetBounds(	  IndexItemH item,
+										double** ppdMin,
+										double** ppdMax,
 										uint32_t* nDimension)
 {
 	VALIDATE_POINTER1(item, "IndexItem_GetBounds", RT_Failure);
 	SpatialIndex::IData* it = static_cast<SpatialIndex::IData*>(item);
-	
+
 	SpatialIndex::IShape* s;
     it->getShape(&s);
-    
+
 	SpatialIndex::Region *bounds = new SpatialIndex::Region();
     s->getMBR(*bounds);
-	
-	if (bounds == 0) { 
+
+	if (bounds == 0) {
 		*nDimension = 0;
                 delete bounds;
                 delete s;
 		return RT_None;
 	}
 	*nDimension = bounds->getDimension();
-		
+
 	*ppdMin = (double*) malloc (*nDimension * sizeof(double));
 	*ppdMax = (double*) malloc (*nDimension * sizeof(double));
-	
+
 	if (ppdMin == NULL || ppdMax == NULL) {
-		Error_PushError(RT_Failure, 
-						"Unable to allocation bounds array(s)", 
+		Error_PushError(RT_Failure,
+						"Unable to allocation bounds array(s)",
 						"IndexItem_GetBounds");
-		return RT_Failure;			 
+		return RT_Failure;
 	}
-	
+
 	for (uint32_t i=0; i< *nDimension; ++i) {
 		(*ppdMin)[i] = bounds->getLow(i);
 		(*ppdMax)[i] = bounds->getHigh(i);
@@ -985,15 +1755,15 @@ SIDX_C_DLL IndexPropertyH IndexProperty_Create()
 
 SIDX_C_DLL void IndexProperty_Destroy(IndexPropertyH hProp)
 {
-	VALIDATE_POINTER0(hProp, "IndexProperty_Destroy");	  
+	VALIDATE_POINTER0(hProp, "IndexProperty_Destroy");
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 	if (prop != 0) delete prop;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetIndexType(IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetIndexType(IndexPropertyH hProp,
 											RTIndexType value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetIndexType", RT_Failure);	   
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetIndexType", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -1009,21 +1779,21 @@ SIDX_C_DLL RTError IndexProperty_SetIndexType(IndexPropertyH hProp,
 
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetIndexType");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetIndexType");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetIndexType");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -1039,24 +1809,24 @@ SIDX_C_DLL RTIndexType IndexProperty_GetIndexType(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_ULONG) {
-			Error_PushError(RT_Failure, 
-							"Property IndexType must be Tools::VT_ULONG", 
+			Error_PushError(RT_Failure,
+							"Property IndexType must be Tools::VT_ULONG",
 							"IndexProperty_GetIndexType");
 			return RT_InvalidIndexType;
 		}
 		return (RTIndexType) var.m_val.ulVal;
 	}
 
-	Error_PushError(RT_Failure, 
-					"Property IndexType was empty", 
-					"IndexProperty_GetIndexType");	  
+	Error_PushError(RT_Failure,
+					"Property IndexType was empty",
+					"IndexProperty_GetIndexType");
 	return RT_InvalidIndexType;
 
 }
 
 SIDX_C_DLL RTError IndexProperty_SetDimension(IndexPropertyH hProp, uint32_t value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetDimension", RT_Failure);	   
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetDimension", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -1067,28 +1837,28 @@ SIDX_C_DLL RTError IndexProperty_SetDimension(IndexPropertyH hProp, uint32_t val
 		prop->setProperty("Dimension", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetDimension");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetDimension");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetDimension");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
 
 SIDX_C_DLL uint32_t IndexProperty_GetDimension(IndexPropertyH hProp)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_GetDimension", RT_InvalidIndexType);
+	VALIDATE_POINTER1(hProp, "IndexProperty_GetDimension", 0);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	Tools::Variant var;
@@ -1097,44 +1867,44 @@ SIDX_C_DLL uint32_t IndexProperty_GetDimension(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_ULONG) {
-			Error_PushError(RT_Failure, 
-							"Property IndexType must be Tools::VT_ULONG", 
+			Error_PushError(RT_Failure,
+							"Property IndexType must be Tools::VT_ULONG",
 							"IndexProperty_GetDimension");
 			return 0;
 		}
-		
+
 		return var.m_val.ulVal;
 	}
-	
+
 	// A zero dimension index is invalid.
-	Error_PushError(RT_Failure, 
-					"Property Dimension was empty", 
+	Error_PushError(RT_Failure,
+					"Property Dimension was empty",
 					"IndexProperty_GetDimension");
 	return 0;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetIndexVariant( IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetIndexVariant( IndexPropertyH hProp,
 												RTIndexVariant value)
 {
 	using namespace SpatialIndex;
 
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetIndexVariant", RT_Failure);	  
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetIndexVariant", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	Tools::Variant var;
-	
+
 	try
 	{
 
 		if (!(value == RT_Linear || value == RT_Quadratic || value == RT_Star)) {
 			throw std::runtime_error("Inputted value is not a valid index variant");
 		}
-		
+
 		var.m_varType = Tools::VT_LONG;
 		RTIndexType type = IndexProperty_GetIndexType(hProp);
 		if (type == RT_InvalidIndexType ) {
-			Error_PushError(RT_Failure, 
-							"Index type is not properly set", 
+			Error_PushError(RT_Failure,
+							"Index type is not properly set",
 							"IndexProperty_SetIndexVariant");
 			return RT_Failure;
 		}
@@ -1143,37 +1913,37 @@ SIDX_C_DLL RTError IndexProperty_SetIndexVariant( IndexPropertyH hProp,
 			prop->setProperty("TreeVariant", var);
 		} else if (type	 == RT_MVRTree) {
 			var.m_val.lVal = static_cast<MVRTree::MVRTreeVariant>(value);
-			prop->setProperty("TreeVariant", var);	 
+			prop->setProperty("TreeVariant", var);
 		} else if (type == RT_TPRTree) {
 			var.m_val.lVal = static_cast<TPRTree::TPRTreeVariant>(value);
-			prop->setProperty("TreeVariant", var);	 
+			prop->setProperty("TreeVariant", var);
 		}
-	
+
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetIndexVariant");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetIndexCapacity");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetIndexCapacity");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
 
 SIDX_C_DLL RTIndexVariant IndexProperty_GetIndexVariant(IndexPropertyH hProp)
 {
-	VALIDATE_POINTER1(	hProp, 
-						"IndexProperty_GetIndexVariant", 
+	VALIDATE_POINTER1(	hProp,
+						"IndexProperty_GetIndexVariant",
 						RT_InvalidIndexVariant);
 
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
@@ -1181,31 +1951,31 @@ SIDX_C_DLL RTIndexVariant IndexProperty_GetIndexVariant(IndexPropertyH hProp)
 	Tools::Variant var;
 	var = prop->getProperty("TreeVariant");
 
-	
+
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_LONG) {
-			Error_PushError(RT_Failure, 
-							"Property IndexVariant must be Tools::VT_LONG", 
+			Error_PushError(RT_Failure,
+							"Property IndexVariant must be Tools::VT_LONG",
 							"IndexProperty_GetIndexVariant");
 			return RT_InvalidIndexVariant;
 		}
-		
+
 		return static_cast<RTIndexVariant>(var.m_val.lVal);
 	}
-	
+
 	// if we didn't get anything, we're returning an error condition
-	Error_PushError(RT_Failure, 
-					"Property IndexVariant was empty", 
+	Error_PushError(RT_Failure,
+					"Property IndexVariant was empty",
 					"IndexProperty_GetIndexVariant");
 	return RT_InvalidIndexVariant;
 
 }
 
-SIDX_C_DLL RTError IndexProperty_SetIndexStorage( IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetIndexStorage( IndexPropertyH hProp,
 												RTStorageType value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetIndexStorage", RT_Failure);	  
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetIndexStorage", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -1219,29 +1989,29 @@ SIDX_C_DLL RTError IndexProperty_SetIndexStorage( IndexPropertyH hProp,
 		prop->setProperty("IndexStorageType", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetIndexStorage");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetIndexStorage");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetIndexStorage");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
 
 SIDX_C_DLL RTStorageType IndexProperty_GetIndexStorage(IndexPropertyH hProp)
 {
-	VALIDATE_POINTER1(	hProp, 
-						"IndexProperty_GetIndexStorage", 
+	VALIDATE_POINTER1(	hProp,
+						"IndexProperty_GetIndexStorage",
 						RT_InvalidStorageType);
 
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
@@ -1252,27 +2022,27 @@ SIDX_C_DLL RTStorageType IndexProperty_GetIndexStorage(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_ULONG) {
-			Error_PushError(RT_Failure, 
-							"Property IndexStorage must be Tools::VT_ULONG", 
+			Error_PushError(RT_Failure,
+							"Property IndexStorage must be Tools::VT_ULONG",
 							"IndexProperty_GetIndexStorage");
 			return RT_InvalidStorageType;
 		}
-		
+
 		return static_cast<RTStorageType>(var.m_val.ulVal);
 	}
-	
+
 	// if we didn't get anything, we're returning an error condition
-	Error_PushError(RT_Failure, 
-					"Property IndexStorage was empty", 
+	Error_PushError(RT_Failure,
+					"Property IndexStorage was empty",
 					"IndexProperty_GetIndexStorage");
 	return RT_InvalidStorageType;
 
 }
 
-SIDX_C_DLL RTError IndexProperty_SetIndexCapacity(IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetIndexCapacity(IndexPropertyH hProp,
 												uint32_t value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetIndexCapacity", RT_Failure);	   
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetIndexCapacity", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -1283,21 +2053,21 @@ SIDX_C_DLL RTError IndexProperty_SetIndexCapacity(IndexPropertyH hProp,
 		prop->setProperty("IndexCapacity", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetIndexCapacity");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetIndexCapacity");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetIndexCapacity");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -1313,26 +2083,26 @@ SIDX_C_DLL uint32_t IndexProperty_GetIndexCapacity(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_ULONG) {
-			Error_PushError(RT_Failure, 
-							"Property IndexCapacity must be Tools::VT_ULONG", 
+			Error_PushError(RT_Failure,
+							"Property IndexCapacity must be Tools::VT_ULONG",
 							"IndexProperty_GetIndexCapacity");
 			return 0;
 		}
-		
+
 		return var.m_val.ulVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property IndexCapacity was empty", 
+	Error_PushError(RT_Failure,
+					"Property IndexCapacity was empty",
 					"IndexProperty_GetIndexCapacity");
 	return 0;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetLeafCapacity( IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetLeafCapacity( IndexPropertyH hProp,
 												uint32_t value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetLeafCapacity", RT_Failure);	  
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetLeafCapacity", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -1343,21 +2113,21 @@ SIDX_C_DLL RTError IndexProperty_SetLeafCapacity( IndexPropertyH hProp,
 		prop->setProperty("LeafCapacity", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetLeafCapacity");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetLeafCapacity");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetLeafCapacity");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -1373,26 +2143,26 @@ SIDX_C_DLL uint32_t IndexProperty_GetLeafCapacity(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_ULONG) {
-			Error_PushError(RT_Failure, 
-							"Property LeafCapacity must be Tools::VT_ULONG", 
+			Error_PushError(RT_Failure,
+							"Property LeafCapacity must be Tools::VT_ULONG",
 							"IndexProperty_GetLeafCapacity");
 			return 0;
 		}
-		
+
 		return var.m_val.ulVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property LeafCapacity was empty", 
+	Error_PushError(RT_Failure,
+					"Property LeafCapacity was empty",
 					"IndexProperty_GetLeafCapacity");
 	return 0;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetPagesize( IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetPagesize( IndexPropertyH hProp,
 											uint32_t value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetPagesize", RT_Failure);	  
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetPagesize", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -1403,21 +2173,21 @@ SIDX_C_DLL RTError IndexProperty_SetPagesize( IndexPropertyH hProp,
 		prop->setProperty("PageSize", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetPagesize");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetPagesize");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetPagesize");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -1433,26 +2203,26 @@ SIDX_C_DLL uint32_t IndexProperty_GetPagesize(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_ULONG) {
-			Error_PushError(RT_Failure, 
-							"Property PageSize must be Tools::VT_ULONG", 
+			Error_PushError(RT_Failure,
+							"Property PageSize must be Tools::VT_ULONG",
 							"IndexProperty_GetPagesize");
 			return 0;
 		}
-		
+
 		return var.m_val.ulVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property PageSize was empty", 
+	Error_PushError(RT_Failure,
+					"Property PageSize was empty",
 					"IndexProperty_GetPagesize");
 	return 0;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetLeafPoolCapacity( IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetLeafPoolCapacity( IndexPropertyH hProp,
 													uint32_t value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetLeafPoolCapacity", RT_Failure);	  
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetLeafPoolCapacity", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -1463,21 +2233,21 @@ SIDX_C_DLL RTError IndexProperty_SetLeafPoolCapacity( IndexPropertyH hProp,
 		prop->setProperty("LeafPoolCapacity", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetLeafPoolCapacity");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetLeafPoolCapacity");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetLeafPoolCapacity");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -1493,26 +2263,26 @@ SIDX_C_DLL uint32_t IndexProperty_GetLeafPoolCapacity(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_ULONG) {
-			Error_PushError(RT_Failure, 
-							"Property LeafPoolCapacity must be Tools::VT_ULONG", 
+			Error_PushError(RT_Failure,
+							"Property LeafPoolCapacity must be Tools::VT_ULONG",
 							"IndexProperty_GetLeafPoolCapacity");
 			return 0;
 		}
-		
+
 		return var.m_val.ulVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property LeafPoolCapacity was empty", 
+	Error_PushError(RT_Failure,
+					"Property LeafPoolCapacity was empty",
 					"IndexProperty_GetLeafPoolCapacity");
 	return 0;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetIndexPoolCapacity(IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetIndexPoolCapacity(IndexPropertyH hProp,
 													uint32_t value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetIndexPoolCapacity", RT_Failure);	   
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetIndexPoolCapacity", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -1523,21 +2293,21 @@ SIDX_C_DLL RTError IndexProperty_SetIndexPoolCapacity(IndexPropertyH hProp,
 		prop->setProperty("IndexPoolCapacity", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetIndexPoolCapacity");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetIndexPoolCapacity");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetIndexPoolCapacity");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -1553,26 +2323,26 @@ SIDX_C_DLL uint32_t IndexProperty_GetIndexPoolCapacity(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_ULONG) {
-			Error_PushError(RT_Failure, 
-							"Property IndexPoolCapacity must be Tools::VT_ULONG", 
+			Error_PushError(RT_Failure,
+							"Property IndexPoolCapacity must be Tools::VT_ULONG",
 							"IndexProperty_GetIndexPoolCapacity");
 			return 0;
 		}
-		
+
 		return var.m_val.ulVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property IndexPoolCapacity was empty", 
+	Error_PushError(RT_Failure,
+					"Property IndexPoolCapacity was empty",
 					"IndexProperty_GetIndexPoolCapacity");
 	return 0;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetRegionPoolCapacity(IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetRegionPoolCapacity(IndexPropertyH hProp,
 													uint32_t value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetRegionPoolCapacity", RT_Failure);	
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetRegionPoolCapacity", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -1583,21 +2353,21 @@ SIDX_C_DLL RTError IndexProperty_SetRegionPoolCapacity(IndexPropertyH hProp,
 		prop->setProperty("RegionPoolCapacity", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetRegionPoolCapacity");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetRegionPoolCapacity");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetRegionPoolCapacity");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -1613,26 +2383,26 @@ SIDX_C_DLL uint32_t IndexProperty_GetRegionPoolCapacity(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_ULONG) {
-			Error_PushError(RT_Failure, 
-							"Property RegionPoolCapacity must be Tools::VT_ULONG", 
+			Error_PushError(RT_Failure,
+							"Property RegionPoolCapacity must be Tools::VT_ULONG",
 							"IndexProperty_GetRegionPoolCapacity");
 			return 0;
 		}
-		
+
 		return var.m_val.ulVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property RegionPoolCapacity was empty", 
+	Error_PushError(RT_Failure,
+					"Property RegionPoolCapacity was empty",
 					"IndexProperty_GetRegionPoolCapacity");
 	return 0;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetPointPoolCapacity(IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetPointPoolCapacity(IndexPropertyH hProp,
 													uint32_t value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetPointPoolCapacity", RT_Failure);	   
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetPointPoolCapacity", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -1643,21 +2413,21 @@ SIDX_C_DLL RTError IndexProperty_SetPointPoolCapacity(IndexPropertyH hProp,
 		prop->setProperty("PointPoolCapacity", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetPointPoolCapacity");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetPointPoolCapacity");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetPointPoolCapacity");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -1673,28 +2443,28 @@ SIDX_C_DLL uint32_t IndexProperty_GetPointPoolCapacity(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_ULONG) {
-			Error_PushError(RT_Failure, 
-							"Property PointPoolCapacity must be Tools::VT_ULONG", 
+			Error_PushError(RT_Failure,
+							"Property PointPoolCapacity must be Tools::VT_ULONG",
 							"IndexProperty_GetPointPoolCapacity");
 			return 0;
 		}
-		
+
 		return var.m_val.ulVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property PointPoolCapacity was empty", 
+	Error_PushError(RT_Failure,
+					"Property PointPoolCapacity was empty",
 					"IndexProperty_GetPointPoolCapacity");
 	return 0;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetNearMinimumOverlapFactor( IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetNearMinimumOverlapFactor( IndexPropertyH hProp,
 															uint32_t value)
 {
-	VALIDATE_POINTER1(	hProp, 
-						"IndexProperty_SetNearMinimumOverlapFactor", 
-						RT_Failure);	
+	VALIDATE_POINTER1(	hProp,
+						"IndexProperty_SetNearMinimumOverlapFactor",
+						RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -1705,21 +2475,21 @@ SIDX_C_DLL RTError IndexProperty_SetNearMinimumOverlapFactor( IndexPropertyH hPr
 		prop->setProperty("NearMinimumOverlapFactor", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetNearMinimumOverlapFactor");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetNearMinimumOverlapFactor");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetNearMinimumOverlapFactor");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -1735,27 +2505,27 @@ SIDX_C_DLL uint32_t IndexProperty_GetNearMinimumOverlapFactor(IndexPropertyH hPr
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_ULONG) {
-			Error_PushError(RT_Failure, 
-							"Property NearMinimumOverlapFactor must be Tools::VT_ULONG", 
+			Error_PushError(RT_Failure,
+							"Property NearMinimumOverlapFactor must be Tools::VT_ULONG",
 							"IndexProperty_GetNearMinimumOverlapFactor");
 			return 0;
 		}
-		
+
 		return var.m_val.ulVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property NearMinimumOverlapFactor was empty", 
+	Error_PushError(RT_Failure,
+					"Property NearMinimumOverlapFactor was empty",
 					"IndexProperty_GetNearMinimumOverlapFactor");
 	return 0;
 }
 
 
-SIDX_C_DLL RTError IndexProperty_SetBufferingCapacity(IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetBufferingCapacity(IndexPropertyH hProp,
 												uint32_t value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetBufferingCapacity", RT_Failure);	   
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetBufferingCapacity", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -1766,21 +2536,21 @@ SIDX_C_DLL RTError IndexProperty_SetBufferingCapacity(IndexPropertyH hProp,
 		prop->setProperty("Capacity", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetBufferingCapacity");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetBufferingCapacity");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetBufferingCapacity");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -1796,57 +2566,57 @@ SIDX_C_DLL uint32_t IndexProperty_GetBufferingCapacity(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_ULONG) {
-			Error_PushError(RT_Failure, 
-							"Property Capacity must be Tools::VT_ULONG", 
+			Error_PushError(RT_Failure,
+							"Property Capacity must be Tools::VT_ULONG",
 							"IndexProperty_GetBufferingCapacity");
 			return 0;
 		}
-		
+
 		return var.m_val.ulVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property Capacity was empty", 
+	Error_PushError(RT_Failure,
+					"Property Capacity was empty",
 					"IndexProperty_GetBufferingCapacity");
 	return 0;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetEnsureTightMBRs(  IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetEnsureTightMBRs(  IndexPropertyH hProp,
 													uint32_t value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetEnsureTightMBRs", RT_Failure);	 
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetEnsureTightMBRs", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
 	{
 		if (value > 1 ) {
-			Error_PushError(RT_Failure, 
-							"EnsureTightMBRs is a boolean value and must be 1 or 0", 
+			Error_PushError(RT_Failure,
+							"EnsureTightMBRs is a boolean value and must be 1 or 0",
 							"IndexProperty_SetEnsureTightMBRs");
 			return RT_Failure;
 		}
 		Tools::Variant var;
 		var.m_varType = Tools::VT_BOOL;
-		var.m_val.blVal = (bool)value;
+		var.m_val.blVal = value != 0;
 		prop->setProperty("EnsureTightMBRs", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetEnsureTightMBRs");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetEnsureTightMBRs");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetEnsureTightMBRs");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -1862,57 +2632,57 @@ SIDX_C_DLL uint32_t IndexProperty_GetEnsureTightMBRs(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_BOOL) {
-			Error_PushError(RT_Failure, 
-							"Property EnsureTightMBRs must be Tools::VT_BOOL", 
+			Error_PushError(RT_Failure,
+							"Property EnsureTightMBRs must be Tools::VT_BOOL",
 							"IndexProperty_GetEnsureTightMBRs");
 			return 0;
 		}
-		
+
 		return var.m_val.blVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property EnsureTightMBRs was empty", 
+	Error_PushError(RT_Failure,
+					"Property EnsureTightMBRs was empty",
 					"IndexProperty_GetEnsureTightMBRs");
 	return 0;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetWriteThrough(IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetWriteThrough(IndexPropertyH hProp,
 													uint32_t value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetWriteThrough", RT_Failure);	  
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetWriteThrough", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
 	{
 		if (value > 1 ) {
-			Error_PushError(RT_Failure, 
-							"WriteThrough is a boolean value and must be 1 or 0", 
+			Error_PushError(RT_Failure,
+							"WriteThrough is a boolean value and must be 1 or 0",
 							"IndexProperty_SetWriteThrough");
 			return RT_Failure;
 		}
 		Tools::Variant var;
 		var.m_varType = Tools::VT_BOOL;
-		var.m_val.blVal = value;
+		var.m_val.blVal = value != 0;
 		prop->setProperty("WriteThrough", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetWriteThrough");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetWriteThrough");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetWriteThrough");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -1928,57 +2698,57 @@ SIDX_C_DLL uint32_t IndexProperty_GetWriteThrough(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_BOOL) {
-			Error_PushError(RT_Failure, 
-							"Property WriteThrough must be Tools::VT_BOOL", 
+			Error_PushError(RT_Failure,
+							"Property WriteThrough must be Tools::VT_BOOL",
 							"IndexProperty_GetWriteThrough");
 			return 0;
 		}
-		
+
 		return var.m_val.blVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property WriteThrough was empty", 
+	Error_PushError(RT_Failure,
+					"Property WriteThrough was empty",
 					"IndexProperty_GetWriteThrough");
 	return 0;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetOverwrite(IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetOverwrite(IndexPropertyH hProp,
 											uint32_t value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetOverwrite", RT_Failure);	   
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetOverwrite", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
 	{
 		if (value > 1 ) {
-			Error_PushError(RT_Failure, 
-							"Overwrite is a boolean value and must be 1 or 0", 
+			Error_PushError(RT_Failure,
+							"Overwrite is a boolean value and must be 1 or 0",
 							"IndexProperty_SetOverwrite");
 			return RT_Failure;
 		}
 		Tools::Variant var;
 		var.m_varType = Tools::VT_BOOL;
-		var.m_val.blVal = value;
+		var.m_val.blVal = value != 0;
 		prop->setProperty("Overwrite", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetOverwrite");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetOverwrite");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetOverwrite");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -1994,27 +2764,27 @@ SIDX_C_DLL uint32_t IndexProperty_GetOverwrite(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_BOOL) {
-			Error_PushError(RT_Failure, 
-							"Property Overwrite must be Tools::VT_BOOL", 
+			Error_PushError(RT_Failure,
+							"Property Overwrite must be Tools::VT_BOOL",
 							"IndexProperty_GetOverwrite");
 			return 0;
 		}
-		
+
 		return var.m_val.blVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property Overwrite was empty", 
+	Error_PushError(RT_Failure,
+					"Property Overwrite was empty",
 					"IndexProperty_GetOverwrite");
 	return 0;
 }
 
 
-SIDX_C_DLL RTError IndexProperty_SetFillFactor(	  IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetFillFactor(	  IndexPropertyH hProp,
 												double value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetFillFactor", RT_Failure);	
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetFillFactor", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -2025,21 +2795,21 @@ SIDX_C_DLL RTError IndexProperty_SetFillFactor(	  IndexPropertyH hProp,
 		prop->setProperty("FillFactor", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetFillFactor");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetFillFactor");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetFillFactor");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -2055,28 +2825,28 @@ SIDX_C_DLL double IndexProperty_GetFillFactor(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_DOUBLE) {
-			Error_PushError(RT_Failure, 
-							"Property FillFactor must be Tools::VT_DOUBLE", 
+			Error_PushError(RT_Failure,
+							"Property FillFactor must be Tools::VT_DOUBLE",
 							"IndexProperty_GetFillFactor");
 			return 0;
 		}
-		
+
 		return var.m_val.dblVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property FillFactor was empty", 
+	Error_PushError(RT_Failure,
+					"Property FillFactor was empty",
 					"IndexProperty_GetFillFactor");
 	return 0;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetSplitDistributionFactor(  IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetSplitDistributionFactor(  IndexPropertyH hProp,
 															double value)
 {
-	VALIDATE_POINTER1(	hProp, 
-						"IndexProperty_SetSplitDistributionFactor", 
-						RT_Failure);	
+	VALIDATE_POINTER1(	hProp,
+						"IndexProperty_SetSplitDistributionFactor",
+						RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -2087,21 +2857,21 @@ SIDX_C_DLL RTError IndexProperty_SetSplitDistributionFactor(  IndexPropertyH hPr
 		prop->setProperty("SplitDistributionFactor", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetSplitDistributionFactor");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetSplitDistributionFactor");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetSplitDistributionFactor");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -2117,28 +2887,28 @@ SIDX_C_DLL double IndexProperty_GetSplitDistributionFactor(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_DOUBLE) {
-			Error_PushError(RT_Failure, 
-							"Property SplitDistributionFactor must be Tools::VT_DOUBLE", 
+			Error_PushError(RT_Failure,
+							"Property SplitDistributionFactor must be Tools::VT_DOUBLE",
 							"IndexProperty_GetSplitDistributionFactor");
 			return 0;
 		}
-		
+
 		return var.m_val.dblVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property SplitDistributionFactor was empty", 
+	Error_PushError(RT_Failure,
+					"Property SplitDistributionFactor was empty",
 					"IndexProperty_GetSplitDistributionFactor");
 	return 0;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetTPRHorizon(IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetTPRHorizon(IndexPropertyH hProp,
 											 double value)
 {
-	VALIDATE_POINTER1(	hProp, 
-						"IndexProperty_SetTPRHorizon", 
-						RT_Failure);	
+	VALIDATE_POINTER1(	hProp,
+						"IndexProperty_SetTPRHorizon",
+						RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -2149,21 +2919,21 @@ SIDX_C_DLL RTError IndexProperty_SetTPRHorizon(IndexPropertyH hProp,
 		prop->setProperty("Horizon", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetTPRHorizon");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetTPRHorizon");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetTPRHorizon");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -2179,28 +2949,28 @@ SIDX_C_DLL double IndexProperty_GetTPRHorizon(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_DOUBLE) {
-			Error_PushError(RT_Failure, 
-							"Property Horizon must be Tools::VT_DOUBLE", 
+			Error_PushError(RT_Failure,
+							"Property Horizon must be Tools::VT_DOUBLE",
 							"IndexProperty_GetTPRHorizon");
 			return 0;
 		}
-		
+
 		return var.m_val.dblVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property Horizon was empty", 
+	Error_PushError(RT_Failure,
+					"Property Horizon was empty",
 					"IndexProperty_GetTPRHorizon");
 	return 0;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetReinsertFactor(	  IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetReinsertFactor(	  IndexPropertyH hProp,
 													double value)
 {
-	VALIDATE_POINTER1(	hProp, 
-						"IndexProperty_SetReinsertFactor", 
-						RT_Failure);	
+	VALIDATE_POINTER1(	hProp,
+						"IndexProperty_SetReinsertFactor",
+						RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -2211,21 +2981,21 @@ SIDX_C_DLL RTError IndexProperty_SetReinsertFactor(	  IndexPropertyH hProp,
 		prop->setProperty("ReinsertFactor", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetReinsertFactor");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetReinsertFactor");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetReinsertFactor");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -2241,28 +3011,28 @@ SIDX_C_DLL double IndexProperty_GetReinsertFactor(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_DOUBLE) {
-			Error_PushError(RT_Failure, 
-							"Property ReinsertFactor must be Tools::VT_DOUBLE", 
+			Error_PushError(RT_Failure,
+							"Property ReinsertFactor must be Tools::VT_DOUBLE",
 							"IndexProperty_GetReinsertFactor");
 			return 0;
 		}
-		
+
 		return var.m_val.dblVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property ReinsertFactor was empty", 
+	Error_PushError(RT_Failure,
+					"Property ReinsertFactor was empty",
 					"IndexProperty_GetReinsertFactor");
 	return 0;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetFileName( IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetFileName( IndexPropertyH hProp,
 											const char* value)
 {
-	VALIDATE_POINTER1(	hProp, 
-						"IndexProperty_SetFileName", 
-						RT_Failure);	
+	VALIDATE_POINTER1(	hProp,
+						"IndexProperty_SetFileName",
+						RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -2273,21 +3043,21 @@ SIDX_C_DLL RTError IndexProperty_SetFileName( IndexPropertyH hProp,
 		prop->setProperty("FileName", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetFileName");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetFileName");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetFileName");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -2303,29 +3073,29 @@ SIDX_C_DLL char* IndexProperty_GetFileName(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_PCHAR) {
-			Error_PushError(RT_Failure, 
-							"Property FileName must be Tools::VT_PCHAR", 
+			Error_PushError(RT_Failure,
+							"Property FileName must be Tools::VT_PCHAR",
 							"IndexProperty_GetFileName");
 			return NULL;
 		}
-		
+
 		return STRDUP(var.m_val.pcVal);
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property FileName was empty", 
+	Error_PushError(RT_Failure,
+					"Property FileName was empty",
 					"IndexProperty_GetFileName");
 	return NULL;
 }
 
 
-SIDX_C_DLL RTError IndexProperty_SetFileNameExtensionDat( IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetFileNameExtensionDat( IndexPropertyH hProp,
 														const char* value)
 {
-	VALIDATE_POINTER1(	hProp, 
-						"IndexProperty_SetFileNameExtensionDat", 
-						RT_Failure);	
+	VALIDATE_POINTER1(	hProp,
+						"IndexProperty_SetFileNameExtensionDat",
+						RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -2337,21 +3107,21 @@ SIDX_C_DLL RTError IndexProperty_SetFileNameExtensionDat( IndexPropertyH hProp,
 
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetFileNameExtensionDat");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetFileNameExtensionDat");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetFileNameExtensionDat");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -2367,28 +3137,28 @@ SIDX_C_DLL char* IndexProperty_GetFileNameExtensionDat(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_PCHAR) {
-			Error_PushError(RT_Failure, 
-							"Property FileNameDat must be Tools::VT_PCHAR", 
+			Error_PushError(RT_Failure,
+							"Property FileNameDat must be Tools::VT_PCHAR",
 							"IndexProperty_GetFileNameExtensionDat");
 			return NULL;
 		}
-		
+
 		return STRDUP(var.m_val.pcVal);
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property FileNameDat was empty", 
+	Error_PushError(RT_Failure,
+					"Property FileNameDat was empty",
 					"IndexProperty_GetFileNameExtensionDat");
 	return NULL;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetFileNameExtensionIdx( IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetFileNameExtensionIdx( IndexPropertyH hProp,
 														const char* value)
 {
-	VALIDATE_POINTER1(	hProp, 
-						"IndexProperty_SetFileNameExtensionIdx", 
-						RT_Failure);	
+	VALIDATE_POINTER1(	hProp,
+						"IndexProperty_SetFileNameExtensionIdx",
+						RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -2400,21 +3170,21 @@ SIDX_C_DLL RTError IndexProperty_SetFileNameExtensionIdx( IndexPropertyH hProp,
 
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetFileNameExtensionIdx");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetFileNameExtensionIdx");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetFileNameExtensionIdx");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -2430,26 +3200,26 @@ SIDX_C_DLL char* IndexProperty_GetFileNameExtensionIdx(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_PCHAR) {
-			Error_PushError(RT_Failure, 
-							"Property FileNameIdx must be Tools::VT_PCHAR", 
+			Error_PushError(RT_Failure,
+							"Property FileNameIdx must be Tools::VT_PCHAR",
 							"IndexProperty_GetFileNameExtensionIdx");
 			return NULL;
 		}
-		
+
 		return STRDUP(var.m_val.pcVal);
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property FileNameIdx was empty", 
+	Error_PushError(RT_Failure,
+					"Property FileNameIdx was empty",
 					"IndexProperty_GetFileNameExtensionIdx");
 	return NULL;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetCustomStorageCallbacksSize(IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetCustomStorageCallbacksSize(IndexPropertyH hProp,
 												uint32_t value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetCustomStorageCallbacksSize", RT_Failure);	   
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetCustomStorageCallbacksSize", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -2460,21 +3230,21 @@ SIDX_C_DLL RTError IndexProperty_SetCustomStorageCallbacksSize(IndexPropertyH hP
 		prop->setProperty("CustomStorageCallbacksSize", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetCustomStorageCallbacksSize");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetCustomStorageCallbacksSize");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetCustomStorageCallbacksSize");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -2490,28 +3260,28 @@ SIDX_C_DLL uint32_t IndexProperty_GetCustomStorageCallbacksSize(IndexPropertyH h
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_ULONG) {
-			Error_PushError(RT_Failure, 
-							"Property CustomStorageCallbacksSize must be Tools::VT_ULONG", 
+			Error_PushError(RT_Failure,
+							"Property CustomStorageCallbacksSize must be Tools::VT_ULONG",
 							"IndexProperty_GetCustomStorageCallbacksSize");
 			return 0;
 		}
-		
+
 		return var.m_val.ulVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property CustomStorageCallbacksSize was empty", 
+	Error_PushError(RT_Failure,
+					"Property CustomStorageCallbacksSize was empty",
 					"IndexProperty_GetCustomStorageCallbacksSize");
 	return 0;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetCustomStorageCallbacks( IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetCustomStorageCallbacks( IndexPropertyH hProp,
 														const void* value)
 {
-	VALIDATE_POINTER1(	hProp, 
-						"IndexProperty_SetCustomStorageCallbacks", 
-						RT_Failure);	
+	VALIDATE_POINTER1(	hProp,
+						"IndexProperty_SetCustomStorageCallbacks",
+						RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
     // check if the CustomStorageCallbacksSize is alright, so we can make a copy of the passed in structure
@@ -2521,10 +3291,10 @@ SIDX_C_DLL RTError IndexProperty_SetCustomStorageCallbacks( IndexPropertyH hProp
     {
         std::ostringstream ss;
         ss << "The supplied storage callbacks size is wrong, expected "
-            << sizeof(SpatialIndex::StorageManager::CustomStorageManagerCallbacks) 
+            << sizeof(SpatialIndex::StorageManager::CustomStorageManagerCallbacks)
            << ", got " << varSize.m_val.ulVal;
-		Error_PushError(RT_Failure, 
-						ss.str().c_str(), 
+		Error_PushError(RT_Failure,
+						ss.str().c_str(),
 						"IndexProperty_SetCustomStorageCallbacks");
 		return RT_Failure;
     }
@@ -2533,30 +3303,30 @@ SIDX_C_DLL RTError IndexProperty_SetCustomStorageCallbacks( IndexPropertyH hProp
 	{
 		Tools::Variant var;
 		var.m_varType = Tools::VT_PVOID;
-        var.m_val.pvVal = value ? 
-                            new SpatialIndex::StorageManager::CustomStorageManagerCallbacks( 
-                                    *static_cast<const SpatialIndex::StorageManager::CustomStorageManagerCallbacks*>(value) 
-                                    ) 
+        var.m_val.pvVal = value ?
+                            new SpatialIndex::StorageManager::CustomStorageManagerCallbacks(
+                                    *static_cast<const SpatialIndex::StorageManager::CustomStorageManagerCallbacks*>(value)
+                                    )
                             : 0;
 		prop->setProperty("CustomStorageCallbacks", var);
 
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetCustomStorageCallbacks");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetCustomStorageCallbacks");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetCustomStorageCallbacks");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -2572,26 +3342,26 @@ SIDX_C_DLL void* IndexProperty_GetCustomStorageCallbacks(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_PVOID) {
-			Error_PushError(RT_Failure, 
-							"Property CustomStorageCallbacks must be Tools::VT_PVOID", 
+			Error_PushError(RT_Failure,
+							"Property CustomStorageCallbacks must be Tools::VT_PVOID",
 							"IndexProperty_GetCustomStorageCallbacks");
 			return NULL;
 		}
-		
+
 		return var.m_val.pvVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property CustomStorageCallbacks was empty", 
+	Error_PushError(RT_Failure,
+					"Property CustomStorageCallbacks was empty",
 					"IndexProperty_GetCustomStorageCallbacks");
 	return NULL;
 }
 
-SIDX_C_DLL RTError IndexProperty_SetIndexID(IndexPropertyH hProp, 
+SIDX_C_DLL RTError IndexProperty_SetIndexID(IndexPropertyH hProp,
 											int64_t value)
 {
-	VALIDATE_POINTER1(hProp, "IndexProperty_SetIndexID", RT_Failure);	 
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetIndexID", RT_Failure);
 	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
 
 	try
@@ -2602,21 +3372,21 @@ SIDX_C_DLL RTError IndexProperty_SetIndexID(IndexPropertyH hProp,
 		prop->setProperty("IndexIdentifier", var);
 	} catch (Tools::Exception& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what().c_str(), 
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
 						"IndexProperty_SetIndexID");
 		return RT_Failure;
 	} catch (std::exception const& e)
 	{
-		Error_PushError(RT_Failure, 
-						e.what(), 
+		Error_PushError(RT_Failure,
+						e.what(),
 						"IndexProperty_SetIndexID");
 		return RT_Failure;
 	} catch (...) {
-		Error_PushError(RT_Failure, 
-						"Unknown Error", 
+		Error_PushError(RT_Failure,
+						"Unknown Error",
 						"IndexProperty_SetIndexID");
-		return RT_Failure;		  
+		return RT_Failure;
 	}
 	return RT_None;
 }
@@ -2632,18 +3402,18 @@ SIDX_C_DLL int64_t IndexProperty_GetIndexID(IndexPropertyH hProp)
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
 		if (var.m_varType != Tools::VT_LONGLONG) {
-			Error_PushError(RT_Failure, 
-							"Property IndexIdentifier must be Tools::VT_LONGLONG", 
+			Error_PushError(RT_Failure,
+							"Property IndexIdentifier must be Tools::VT_LONGLONG",
 							"IndexProperty_GetIndexID");
 			return 0;
 		}
-		
+
 		return var.m_val.llVal;
 	}
-	
+
 	// return nothing for an error
-	Error_PushError(RT_Failure, 
-					"Property IndexIdentifier was empty", 
+	Error_PushError(RT_Failure,
+					"Property IndexIdentifier was empty",
 					"IndexProperty_GetIndexID");
 	return 0;
 }
@@ -2652,7 +3422,68 @@ SIDX_C_DLL void* SIDX_NewBuffer(size_t length)
 {
     return new char[length];
 }
-    
+
+SIDX_DLL RTError IndexProperty_SetResultSetLimit(IndexPropertyH hProp, int64_t value)
+{
+	VALIDATE_POINTER1(hProp, "IndexProperty_SetResultSetLimit", RT_Failure);
+
+	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
+
+	try
+	{
+		Tools::Variant var;
+		var.m_varType = Tools::VT_LONGLONG;
+		var.m_val.llVal = value;
+		prop->setProperty("ResultSetLimit", var);
+	} catch (Tools::Exception& e)
+	{
+		Error_PushError(RT_Failure,
+						e.what().c_str(),
+						"IndexProperty_SetResultSetLimit");
+		return RT_Failure;
+	} catch (std::exception const& e)
+	{
+		Error_PushError(RT_Failure,
+						e.what(),
+						"IndexProperty_SetResultSetLimit");
+		return RT_Failure;
+	} catch (...) {
+		Error_PushError(RT_Failure,
+						"Unknown Error",
+						"IndexProperty_SetResultSetLimit");
+		return RT_Failure;
+	}
+	return RT_None;
+}
+
+SIDX_DLL int64_t IndexProperty_GetResultSetLimit(IndexPropertyH hProp)
+{
+	VALIDATE_POINTER1(hProp, "IndexProperty_GetResultSetLimit", 0);
+	Tools::PropertySet* prop = static_cast<Tools::PropertySet*>(hProp);
+
+	Tools::Variant var;
+	var = prop->getProperty("ResultSetLimit");
+
+	if (var.m_varType != Tools::VT_EMPTY)
+	{
+		if (var.m_varType != Tools::VT_LONGLONG) {
+			Error_PushError(RT_Failure,
+							"Property ResultSetLimit must be Tools::VT_LONGLONG",
+							"IndexProperty_GetResultSetLimit");
+			return 0;
+		}
+
+		return var.m_val.llVal;
+	}
+
+	// return nothing for an error
+	Error_PushError(RT_Failure,
+					"Property ResultSetLimit was empty",
+					"IndexProperty_GetResultSetLimit");
+	return 0;
+}
+
+
 SIDX_C_DLL void SIDX_DeleteBuffer(void* buffer)
 {
     delete [] static_cast<char*>(buffer);
@@ -2661,7 +3492,7 @@ SIDX_C_DLL void SIDX_DeleteBuffer(void* buffer)
 
 SIDX_C_DLL char* SIDX_Version()
 {
-	
+
 	std::ostringstream ot;
 
 #ifdef SIDX_RELEASE_NAME
@@ -2672,6 +3503,12 @@ SIDX_C_DLL char* SIDX_Version()
 
 	std::string out(ot.str());
 	return STRDUP(out.c_str());
-	
+
 }
 IDX_C_END
+
+#ifdef _WIN32
+#  pragma warning(pop)
+#endif
+
+	
diff --git a/src/libspatialindex.pc.in b/src/libspatialindex.pc.in
index a9563ed..d1a58e6 100644
--- a/src/libspatialindex.pc.in
+++ b/src/libspatialindex.pc.in
@@ -7,6 +7,6 @@ Name: libspatialindex
 Description: Generic C/C++ library for spatial indexing
 Requires: 
 Version: @PACKAGE_VERSION@
-Libs: -L at libdir@ @LDFLAGS@
+Libs: -L at libdir@
 Cflags: -I${includedir}/spatialindex @CFLAGS@ @CPPFLAGS@
 
diff --git a/src/mvrtree/Leaf.cc b/src/mvrtree/Leaf.cc
index ff4e6be..1a6ae27 100644
--- a/src/mvrtree/Leaf.cc
+++ b/src/mvrtree/Leaf.cc
@@ -42,14 +42,14 @@ Leaf::Leaf(SpatialIndex::MVRTree::MVRTree* pTree, id_type id): Node(pTree, id, 0
 {
 }
 
-NodePtr Leaf::chooseSubtree(const TimeRegion& mbr, uint32_t level, std::stack<id_type>& pathBuffer)
+NodePtr Leaf::chooseSubtree(const TimeRegion&, uint32_t, std::stack<id_type>&)
 {
 	// should make sure to relinquish other PoolPointer lists that might be pointing to the
 	// same leaf.
 	return NodePtr(this, &(m_pTree->m_leafPool));
 }
 
-NodePtr Leaf::findLeaf(const TimeRegion& mbr, id_type id, std::stack<id_type>& pathBuffer)
+NodePtr Leaf::findLeaf(const TimeRegion& mbr, id_type id, std::stack<id_type>&)
 {
 	for (uint32_t cChild = 0; cChild < m_children; ++cChild)
 	{
diff --git a/src/mvrtree/MVRTree.cc b/src/mvrtree/MVRTree.cc
index a8fde0b..966f79b 100644
--- a/src/mvrtree/MVRTree.cc
+++ b/src/mvrtree/MVRTree.cc
@@ -337,7 +337,7 @@ void SpatialIndex::MVRTree::MVRTree::pointLocationQuery(const Point& query, IVis
 	rangeQuery(IntersectionQuery, r, v);
 }
 
-void SpatialIndex::MVRTree::MVRTree::nearestNeighborQuery(uint32_t k, const IShape& query, IVisitor& v, INearestNeighborComparator& nnc)
+void SpatialIndex::MVRTree::MVRTree::nearestNeighborQuery(uint32_t, const IShape&, IVisitor&, INearestNeighborComparator&)
 {
 	throw Tools::IllegalStateException("nearestNeighborQuery: not impelmented yet.");
 }
@@ -349,7 +349,7 @@ void SpatialIndex::MVRTree::MVRTree::nearestNeighborQuery(uint32_t k, const ISha
 	nearestNeighborQuery(k, query, v, nnc);
 }
 
-void SpatialIndex::MVRTree::MVRTree::selfJoinQuery(const IShape& query, IVisitor& v)
+void SpatialIndex::MVRTree::MVRTree::selfJoinQuery(const IShape&, IVisitor&)
 {
 	throw Tools::IllegalStateException("selfJoinQuery: not impelmented yet.");
 }
diff --git a/src/mvrtree/Makefile.in b/src/mvrtree/Makefile.in
index 9687e62..ab79625 100644
--- a/src/mvrtree/Makefile.in
+++ b/src/mvrtree/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,23 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -315,6 +343,7 @@ clean-noinstLTLIBRARIES:
 	  echo rm -f $${locs}; \
 	  rm -f $${locs}; \
 	}
+
 libmvrtree.la: $(libmvrtree_la_OBJECTS) $(libmvrtree_la_DEPENDENCIES) $(EXTRA_libmvrtree_la_DEPENDENCIES) 
 	$(AM_V_CXXLD)$(CXXLINK)  $(libmvrtree_la_OBJECTS) $(libmvrtree_la_LIBADD) $(LIBS)
 
diff --git a/src/mvrtree/Node.cc b/src/mvrtree/Node.cc
index 3b1a6a2..e09f5df 100644
--- a/src/mvrtree/Node.cc
+++ b/src/mvrtree/Node.cc
@@ -309,7 +309,7 @@ Node::~Node()
 	if (m_pIdentifier != 0) delete[] m_pIdentifier;
 }
 
-Node& Node::operator=(const Node& n)
+Node& Node::operator=(const Node&)
 {
 	throw Tools::IllegalStateException("operator =: This should never be called.");
 }
diff --git a/src/rtree/Leaf.cc b/src/rtree/Leaf.cc
index 3dfb8af..68f83ff 100644
--- a/src/rtree/Leaf.cc
+++ b/src/rtree/Leaf.cc
@@ -45,14 +45,14 @@ Leaf::Leaf(SpatialIndex::RTree::RTree* pTree, id_type id): Node(pTree, id, 0, pT
 {
 }
 
-NodePtr Leaf::chooseSubtree(const Region& mbr, uint32_t level, std::stack<id_type>& pathBuffer)
+NodePtr Leaf::chooseSubtree(const Region&, uint32_t, std::stack<id_type>&)
 {
 	// should make sure to relinquish other PoolPointer lists that might be pointing to the
 	// same leaf.
 	return NodePtr(this, &(m_pTree->m_leafPool));
 }
 
-NodePtr Leaf::findLeaf(const Region& mbr, id_type id, std::stack<id_type>& pathBuffer)
+NodePtr Leaf::findLeaf(const Region& mbr, id_type id, std::stack<id_type>&)
 {
 	for (uint32_t cChild = 0; cChild < m_children; ++cChild)
 	{
diff --git a/src/rtree/Makefile.in b/src/rtree/Makefile.in
index 5eaa649..75301b1 100644
--- a/src/rtree/Makefile.in
+++ b/src/rtree/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,23 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -315,6 +343,7 @@ clean-noinstLTLIBRARIES:
 	  echo rm -f $${locs}; \
 	  rm -f $${locs}; \
 	}
+
 librtree.la: $(librtree_la_OBJECTS) $(librtree_la_DEPENDENCIES) $(EXTRA_librtree_la_DEPENDENCIES) 
 	$(AM_V_CXXLD)$(CXXLINK)  $(librtree_la_OBJECTS) $(librtree_la_LIBADD) $(LIBS)
 
diff --git a/src/rtree/Node.cc b/src/rtree/Node.cc
index 40505f8..e5eb84f 100644
--- a/src/rtree/Node.cc
+++ b/src/rtree/Node.cc
@@ -289,7 +289,7 @@ Node::~Node()
 	delete[] m_pIdentifier;
 }
 
-Node& Node::operator=(const Node& n)
+Node& Node::operator=(const Node&)
 {
 	throw Tools::IllegalStateException("operator =: This should never be called.");
 }
diff --git a/src/rtree/RTree.cc b/src/rtree/RTree.cc
index 50427ee..6ad1168 100644
--- a/src/rtree/RTree.cc
+++ b/src/rtree/RTree.cc
@@ -5,7 +5,7 @@
  * Copyright (c) 2002, Marios Hadjieleftheriou
  *
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
diff --git a/src/spatialindex/LineSegment.cc b/src/spatialindex/LineSegment.cc
index 53926ef..7d2e98c 100644
--- a/src/spatialindex/LineSegment.cc
+++ b/src/spatialindex/LineSegment.cc
@@ -174,12 +174,12 @@ bool LineSegment::intersectsShape(const IShape& s) const
 	);
 }
 
-bool LineSegment::containsShape(const IShape& s) const
+bool LineSegment::containsShape(const IShape&) const
 {
 	return false;
 }
 
-bool LineSegment::touchesShape(const IShape& s) const
+bool LineSegment::touchesShape(const IShape&) const
 {
 	throw Tools::IllegalStateException(
 		"LineSegment::touchesShape: Not implemented yet!"
diff --git a/src/spatialindex/Makefile.in b/src/spatialindex/Makefile.in
index 53f9d20..68773d6 100644
--- a/src/spatialindex/Makefile.in
+++ b/src/spatialindex/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,23 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -298,6 +326,7 @@ clean-noinstLTLIBRARIES:
 	  echo rm -f $${locs}; \
 	  rm -f $${locs}; \
 	}
+
 liblibrary.la: $(liblibrary_la_OBJECTS) $(liblibrary_la_DEPENDENCIES) $(EXTRA_liblibrary_la_DEPENDENCIES) 
 	$(AM_V_CXXLD)$(CXXLINK)  $(liblibrary_la_OBJECTS) $(liblibrary_la_LIBADD) $(LIBS)
 
diff --git a/src/spatialindex/MovingRegion.cc b/src/spatialindex/MovingRegion.cc
index 597120e..2131676 100644
--- a/src/spatialindex/MovingRegion.cc
+++ b/src/spatialindex/MovingRegion.cc
@@ -1159,7 +1159,7 @@ double MovingRegion::getIntersectingAreaInTime(const ITimeShape& r) const
 	return getIntersectingAreaInTime(r, r);
 }
 
-double MovingRegion::getIntersectingAreaInTime(const IInterval& ivI, const ITimeShape& in) const
+double MovingRegion::getIntersectingAreaInTime(const IInterval&, const ITimeShape& in) const
 {
 	const MovingRegion* pr = dynamic_cast<const MovingRegion*>(&in);
 	if (pr != 0) return getIntersectingAreaInTime(*pr);
diff --git a/src/spatialindex/Point.cc b/src/spatialindex/Point.cc
index 3c1cbc8..28fe6f9 100644
--- a/src/spatialindex/Point.cc
+++ b/src/spatialindex/Point.cc
@@ -144,7 +144,7 @@ bool Point::intersectsShape(const IShape& s) const
 	);
 }
 
-bool Point::containsShape(const IShape& s) const
+bool Point::containsShape(const IShape&) const
 {
 	return false;
 }
diff --git a/src/spatialindex/TimePoint.cc b/src/spatialindex/TimePoint.cc
index 9b0b0ec..921f54d 100644
--- a/src/spatialindex/TimePoint.cc
+++ b/src/spatialindex/TimePoint.cc
@@ -161,27 +161,27 @@ bool TimePoint::intersectsShapeInTime(const ITimeShape& in) const
 	throw Tools::IllegalStateException("intersectsShapeInTime: Not implemented yet!");
 }
 
-bool TimePoint::intersectsShapeInTime(const IInterval& ivI, const ITimeShape& in) const
+bool TimePoint::intersectsShapeInTime(const IInterval&, const ITimeShape&) const
 {
 	throw Tools::IllegalStateException("intersectsShapeInTime: Not implemented yet!");
 }
 
-bool TimePoint::containsShapeInTime(const ITimeShape& in) const
+bool TimePoint::containsShapeInTime(const ITimeShape&) const
 {
 	return false;
 }
 
-bool TimePoint::containsShapeInTime(const IInterval& ivI, const ITimeShape& in) const
+bool TimePoint::containsShapeInTime(const IInterval&, const ITimeShape&) const
 {
 	return false;
 }
 
-bool TimePoint::touchesShapeInTime(const ITimeShape& in) const
+bool TimePoint::touchesShapeInTime(const ITimeShape&) const
 {
 	throw Tools::IllegalStateException("touchesShapeInTime: Not implemented yet!");
 }
 
-bool TimePoint::touchesShapeInTime(const IInterval& ivI, const ITimeShape& in) const
+bool TimePoint::touchesShapeInTime(const IInterval&, const ITimeShape&) const
 {
 	throw Tools::IllegalStateException("touchesShapeInTime: Not implemented yet!");
 }
@@ -191,17 +191,17 @@ double TimePoint::getAreaInTime() const
 	return 0.0;
 }
 
-double TimePoint::getAreaInTime(const IInterval& ivI) const
+double TimePoint::getAreaInTime(const IInterval&) const
 {
 	return 0.0;
 }
 
-double TimePoint::getIntersectingAreaInTime(const ITimeShape& r) const
+double TimePoint::getIntersectingAreaInTime(const ITimeShape&) const
 {
 	return 0.0;
 }
 
-double TimePoint::getIntersectingAreaInTime(const IInterval& ivI, const ITimeShape& r) const
+double TimePoint::getIntersectingAreaInTime(const IInterval&, const ITimeShape&) const
 {
 	return 0.0;
 }
@@ -243,7 +243,7 @@ bool TimePoint::intersectsInterval(const IInterval& ti) const
 	return intersectsInterval(ti.getIntervalType(), ti.getLowerBound(), ti.getUpperBound());
 }
 
-bool TimePoint::intersectsInterval(Tools::IntervalType t, const double start, const double end) const
+bool TimePoint::intersectsInterval(Tools::IntervalType, const double start, const double end) const
 {
 	//if (m_startTime != start &&
 	//		(m_startTime >= end || m_endTime <= start)) return false;
diff --git a/src/spatialindex/TimeRegion.cc b/src/spatialindex/TimeRegion.cc
index 1d02d4d..f3d2ef7 100644
--- a/src/spatialindex/TimeRegion.cc
+++ b/src/spatialindex/TimeRegion.cc
@@ -262,7 +262,7 @@ bool TimeRegion::intersectsShapeInTime(const ITimeShape& in) const
 	throw Tools::IllegalStateException("intersectsShapeInTime: Not implemented yet!");
 }
 
-bool TimeRegion::intersectsShapeInTime(const IInterval& ivI, const ITimeShape& in) const
+bool TimeRegion::intersectsShapeInTime(const IInterval&, const ITimeShape&) const
 {
 	throw Tools::IllegalStateException("intersectsShapeInTime: Not implemented yet!");
 }
@@ -278,7 +278,7 @@ bool TimeRegion::containsShapeInTime(const ITimeShape& in) const
 	throw Tools::IllegalStateException("containsShapeInTime: Not implemented yet!");
 }
 
-bool TimeRegion::containsShapeInTime(const IInterval& ivI, const ITimeShape& in) const
+bool TimeRegion::containsShapeInTime(const IInterval&, const ITimeShape&) const
 {
 	throw Tools::IllegalStateException("containsShapeInTime: Not implemented yet!");
 }
@@ -291,7 +291,7 @@ bool TimeRegion::touchesShapeInTime(const ITimeShape& in) const
 	throw Tools::IllegalStateException("touchesShapeInTime: Not implemented yet!");
 }
 
-bool TimeRegion::touchesShapeInTime(const IInterval& ivI, const ITimeShape& in) const
+bool TimeRegion::touchesShapeInTime(const IInterval&, const ITimeShape&) const
 {
 	throw Tools::IllegalStateException("touchesShapeInTime: Not implemented yet!");
 }
@@ -301,17 +301,17 @@ double TimeRegion::getAreaInTime() const
 	throw Tools::IllegalStateException("getAreaInTime: Not implemented yet!");
 }
 
-double TimeRegion::getAreaInTime(const IInterval& ivI) const
+double TimeRegion::getAreaInTime(const IInterval&) const
 {
 	throw Tools::IllegalStateException("getAreaInTime: Not implemented yet!");
 }
 
-double TimeRegion::getIntersectingAreaInTime(const ITimeShape& r) const
+double TimeRegion::getIntersectingAreaInTime(const ITimeShape&) const
 {
 	throw Tools::IllegalStateException("getIntersectingAreaInTime: Not implemented yet!");
 }
 
-double TimeRegion::getIntersectingAreaInTime(const IInterval& ivI, const ITimeShape& r) const
+double TimeRegion::getIntersectingAreaInTime(const IInterval&, const ITimeShape&) const
 {
 	throw Tools::IllegalStateException("getIntersectingAreaInTime: Not implemented yet!");
 }
@@ -353,7 +353,7 @@ bool TimeRegion::intersectsInterval(const IInterval& ti) const
 	return intersectsInterval(ti.getIntervalType(), ti.getLowerBound(), ti.getUpperBound());
 }
 
-bool TimeRegion::intersectsInterval(Tools::IntervalType t, const double start, const double end) const
+bool TimeRegion::intersectsInterval(Tools::IntervalType, const double start, const double end) const
 {
 	//if (m_startTime != start &&
 	//		(m_startTime >= end || m_endTime <= start)) return false;
diff --git a/src/storagemanager/DiskStorageManager.cc b/src/storagemanager/DiskStorageManager.cc
index ca86431..817fec6 100644
--- a/src/storagemanager/DiskStorageManager.cc
+++ b/src/storagemanager/DiskStorageManager.cc
@@ -127,6 +127,9 @@ DiskStorageManager::DiskStorageManager(Tools::PropertySet& ps) : m_pageSize(0),
 
 	// Open/Create flag.
 	bool bOverwrite = false;
+	bool bFileExists = false;
+	std::streamoff length = 0;
+	
 	var = ps.getProperty("Overwrite");
 
 	if (var.m_varType != Tools::VT_EMPTY)
@@ -141,8 +144,9 @@ DiskStorageManager::DiskStorageManager(Tools::PropertySet& ps) : m_pageSize(0),
 
 	if (var.m_varType != Tools::VT_EMPTY)
 	{
-		if (var.m_varType != Tools::VT_PCHAR)
-			throw Tools::IllegalArgumentException("SpatialIndex::DiskStorageManager: Property FileName must be Tools::VT_PCHAR");
+		if (!(var.m_varType == Tools::VT_PCHAR ||
+            var.m_varType == Tools::VT_PWCHAR))
+			throw Tools::IllegalArgumentException("SpatialIndex::DiskStorageManager: Property FileName must be Tools::VT_PCHAR or Tools::VT_PWCHAR");
 
 		std::string idx("idx");
 		std::string dat("dat");
@@ -157,21 +161,23 @@ DiskStorageManager::DiskStorageManager(Tools::PropertySet& ps) : m_pageSize(0),
 		std::string sDataFile = std::string(var.m_val.pcVal) + "." + dat;
 
 		// check if file exists.
-		bool bFileExists = CheckFilesExists(ps);
+		bFileExists = CheckFilesExists(ps);
 
 		// check if file can be read/written.
 		if (bFileExists == true && bOverwrite == false)
 		{
-			m_indexFile.open(sIndexFile.c_str(), std::ios::in | std::ios::out | std::ios::binary);
-			m_dataFile.open(sDataFile.c_str(), std::ios::in | std::ios::out | std::ios::binary);
+            std::ios_base::openmode mode = std::ios::in | std::ios::out | std::ios::binary;
+			m_indexFile.open(sIndexFile.c_str(), mode);
+			m_dataFile.open(sDataFile.c_str(), mode);
 
 			if (m_indexFile.fail() || m_dataFile.fail())
 				throw Tools::IllegalArgumentException("SpatialIndex::DiskStorageManager: Index/Data file cannot be read/writen.");
 		}
 		else
 		{
-			m_indexFile.open(sIndexFile.c_str(), std::ios::in | std::ios::out | std::ios::binary | std::ios::trunc);
-			m_dataFile.open(sDataFile.c_str(), std::ios::in | std::ios::out | std::ios::binary | std::ios::trunc);
+            std::ios_base::openmode mode = std::ios::in | std::ios::out | std::ios::binary | std::ios::trunc;
+			m_indexFile.open(sIndexFile.c_str(), mode);
+			m_dataFile.open(sDataFile.c_str(), mode);
 
 			if (m_indexFile.fail() || m_dataFile.fail())
 				throw Tools::IllegalArgumentException("SpatialIndex::DiskStorageManager: Index/Data file cannot be created.");
@@ -183,8 +189,13 @@ DiskStorageManager::DiskStorageManager(Tools::PropertySet& ps) : m_pageSize(0),
 		throw Tools::IllegalArgumentException("SpatialIndex::DiskStorageManager: Property FileName was not specified.");
 	}
 
+	// get current length of file
+	m_indexFile.seekg (0, m_indexFile.end);
+	length = m_indexFile.tellg();
+	m_indexFile.seekg (0, m_indexFile.beg);
+
 	// find page size.
-	if (bOverwrite == true)
+	if ((bOverwrite == true) || (length == 0) || (bFileExists == false))
 	{
 		var = ps.getProperty("PageSize");
 
@@ -215,7 +226,7 @@ DiskStorageManager::DiskStorageManager(Tools::PropertySet& ps) : m_pageSize(0),
 	m_buffer = new byte[m_pageSize];
 	memset(m_buffer, 0, m_pageSize);
 
-	if (bOverwrite == false)
+	if ((bOverwrite == false) && (length > 0))
 	{
 		uint32_t count;
 		id_type page, id;
diff --git a/src/storagemanager/DiskStorageManager.h b/src/storagemanager/DiskStorageManager.h
index 75f4a70..f347174 100644
--- a/src/storagemanager/DiskStorageManager.h
+++ b/src/storagemanager/DiskStorageManager.h
@@ -50,6 +50,7 @@ namespace SpatialIndex
 				std::vector<id_type> m_pages;
 			};
 
+		protected:
 			std::fstream m_dataFile;
 			std::fstream m_indexFile;
 			uint32_t m_pageSize;
diff --git a/src/storagemanager/Makefile.in b/src/storagemanager/Makefile.in
index a3327ad..9e1d340 100644
--- a/src/storagemanager/Makefile.in
+++ b/src/storagemanager/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,23 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -315,6 +343,7 @@ clean-noinstLTLIBRARIES:
 	  echo rm -f $${locs}; \
 	  rm -f $${locs}; \
 	}
+
 libstoragemanager.la: $(libstoragemanager_la_OBJECTS) $(libstoragemanager_la_DEPENDENCIES) $(EXTRA_libstoragemanager_la_DEPENDENCIES) 
 	$(AM_V_CXXLD)$(CXXLINK)  $(libstoragemanager_la_OBJECTS) $(libstoragemanager_la_LIBADD) $(LIBS)
 
diff --git a/src/storagemanager/MemoryStorageManager.cc b/src/storagemanager/MemoryStorageManager.cc
index 55f85e5..e6a5ce9 100644
--- a/src/storagemanager/MemoryStorageManager.cc
+++ b/src/storagemanager/MemoryStorageManager.cc
@@ -46,7 +46,7 @@ SpatialIndex::IStorageManager* SpatialIndex::StorageManager::createNewMemoryStor
 	return returnMemoryStorageManager(ps);
 }
 
-MemoryStorageManager::MemoryStorageManager(Tools::PropertySet& ps)
+MemoryStorageManager::MemoryStorageManager(Tools::PropertySet&)
 {
 }
 
diff --git a/src/tools/Makefile.in b/src/tools/Makefile.in
index 154627b..7bfeb63 100644
--- a/src/tools/Makefile.in
+++ b/src/tools/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,23 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -299,6 +327,7 @@ clean-noinstLTLIBRARIES:
 	  echo rm -f $${locs}; \
 	  rm -f $${locs}; \
 	}
+
 libtools.la: $(libtools_la_OBJECTS) $(libtools_la_DEPENDENCIES) $(EXTRA_libtools_la_DEPENDENCIES) 
 	$(AM_V_CXXLD)$(CXXLINK)  $(libtools_la_OBJECTS) $(libtools_la_LIBADD) $(LIBS)
 
diff --git a/src/tools/Tools.cc b/src/tools/Tools.cc
index 6957e5e..315acc9 100644
--- a/src/tools/Tools.cc
+++ b/src/tools/Tools.cc
@@ -348,15 +348,15 @@ void Tools::PropertySet::storeToByteArray(byte** data, uint32_t& length)
 	assert(ptr == (*data) + length);
 }
 
-Tools::Variant Tools::PropertySet::getProperty(std::string property)
+Tools::Variant Tools::PropertySet::getProperty(std::string property) const
 {
-   	std::map<std::string, Variant>::iterator it = m_propertySet.find(property);
+   	std::map<std::string, Variant>::const_iterator it = m_propertySet.find(property);
 
    	if (it != m_propertySet.end()) return (*it).second;
    	else return Variant();
 }
 
-void Tools::PropertySet::setProperty(std::string property, Variant& v)
+void Tools::PropertySet::setProperty(std::string property, Variant const& v)
 {
 	std::pair<std::map<std::string, Variant>::iterator, bool> ret;
 	std::map<std::string, Variant>::iterator it;
diff --git a/src/tprtree/Leaf.cc b/src/tprtree/Leaf.cc
index abb7632..2c44296 100644
--- a/src/tprtree/Leaf.cc
+++ b/src/tprtree/Leaf.cc
@@ -46,14 +46,14 @@ Leaf::Leaf(SpatialIndex::TPRTree::TPRTree* pTree, id_type id)
 {
 }
 
-NodePtr Leaf::chooseSubtree(const MovingRegion& mbr, uint32_t level, std::stack<id_type>& pathBuffer)
+NodePtr Leaf::chooseSubtree(const MovingRegion&, uint32_t, std::stack<id_type>&)
 {
 	// should make sure to relinquish other PoolPointer lists that might be pointing to the
 	// same leaf.
 	return NodePtr(this, &(m_pTree->m_leafPool));
 }
 
-NodePtr Leaf::findLeaf(const MovingRegion& mbr, id_type id, std::stack<id_type>& pathBuffer)
+NodePtr Leaf::findLeaf(const MovingRegion&, id_type id, std::stack<id_type>&)
 {
 	for (uint32_t cChild = 0; cChild < m_children; ++cChild)
 	{
diff --git a/src/tprtree/Makefile.in b/src/tprtree/Makefile.in
index 2a761c4..8170e25 100644
--- a/src/tprtree/Makefile.in
+++ b/src/tprtree/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,23 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -315,6 +343,7 @@ clean-noinstLTLIBRARIES:
 	  echo rm -f $${locs}; \
 	  rm -f $${locs}; \
 	}
+
 libtprtree.la: $(libtprtree_la_OBJECTS) $(libtprtree_la_DEPENDENCIES) $(EXTRA_libtprtree_la_DEPENDENCIES) 
 	$(AM_V_CXXLD)$(CXXLINK)  $(libtprtree_la_OBJECTS) $(libtprtree_la_LIBADD) $(LIBS)
 
diff --git a/src/tprtree/Node.cc b/src/tprtree/Node.cc
index 8892f7e..56bbb9f 100644
--- a/src/tprtree/Node.cc
+++ b/src/tprtree/Node.cc
@@ -322,7 +322,7 @@ Node::~Node()
 	delete[] m_pIdentifier;
 }
 
-Node& Node::operator=(const Node& n)
+Node& Node::operator=(const Node&)
 {
 	throw Tools::IllegalStateException("Node::operator =: This should never be called.");
 }
diff --git a/src/tprtree/TPRTree.cc b/src/tprtree/TPRTree.cc
index 0de9b33..ba4cfef 100644
--- a/src/tprtree/TPRTree.cc
+++ b/src/tprtree/TPRTree.cc
@@ -355,7 +355,7 @@ void SpatialIndex::TPRTree::TPRTree::pointLocationQuery(const Point& query, IVis
 	rangeQuery(IntersectionQuery, r, v);
 }
 
-void SpatialIndex::TPRTree::TPRTree::nearestNeighborQuery(uint32_t k, const IShape& query, IVisitor& v, INearestNeighborComparator& nnc)
+void SpatialIndex::TPRTree::TPRTree::nearestNeighborQuery(uint32_t, const IShape&, IVisitor&, INearestNeighborComparator&)
 {
 	throw Tools::IllegalStateException("nearestNeighborQuery: not impelmented yet.");
 }
@@ -367,7 +367,7 @@ void SpatialIndex::TPRTree::TPRTree::nearestNeighborQuery(uint32_t k, const ISha
 	nearestNeighborQuery(k, query, v, nnc);
 }
 
-void SpatialIndex::TPRTree::TPRTree::selfJoinQuery(const IShape& query, IVisitor& v)
+void SpatialIndex::TPRTree::TPRTree::selfJoinQuery(const IShape&, IVisitor&)
 {
 	throw Tools::IllegalStateException("selfJoinQuery: not impelmented yet.");
 }
diff --git a/test/Makefile.in b/test/Makefile.in
index 90077e6..f98c599 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,23 +14,51 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -307,13 +335,12 @@ clean-libtool:
 #     (which will cause the Makefiles to be regenerated when you run 'make');
 # (2) otherwise, pass the desired values on the 'make' command line.
 $(am__recursive_targets):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
 	case "$@" in \
diff --git a/test/geometry/Makefile.in b/test/geometry/Makefile.in
index 5a5d6c1..0bd64df 100644
--- a/test/geometry/Makefile.in
+++ b/test/geometry/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,23 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -295,6 +323,7 @@ clean-noinstPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
+
 Intersection$(EXEEXT): $(Intersection_OBJECTS) $(Intersection_DEPENDENCIES) $(EXTRA_Intersection_DEPENDENCIES) 
 	@rm -f Intersection$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(Intersection_OBJECTS) $(Intersection_LDADD) $(LIBS)
diff --git a/test/mvrtree/Makefile.in b/test/mvrtree/Makefile.in
index 33cc63e..87f64a8 100644
--- a/test/mvrtree/Makefile.in
+++ b/test/mvrtree/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,23 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -313,15 +341,19 @@ clean-noinstPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
+
 Exhaustive$(EXEEXT): $(Exhaustive_OBJECTS) $(Exhaustive_DEPENDENCIES) $(EXTRA_Exhaustive_DEPENDENCIES) 
 	@rm -f Exhaustive$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(Exhaustive_OBJECTS) $(Exhaustive_LDADD) $(LIBS)
+
 Generator$(EXEEXT): $(Generator_OBJECTS) $(Generator_DEPENDENCIES) $(EXTRA_Generator_DEPENDENCIES) 
 	@rm -f Generator$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(Generator_OBJECTS) $(Generator_LDADD) $(LIBS)
+
 MVRTreeLoad$(EXEEXT): $(MVRTreeLoad_OBJECTS) $(MVRTreeLoad_DEPENDENCIES) $(EXTRA_MVRTreeLoad_DEPENDENCIES) 
 	@rm -f MVRTreeLoad$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(MVRTreeLoad_OBJECTS) $(MVRTreeLoad_LDADD) $(LIBS)
+
 MVRTreeQuery$(EXEEXT): $(MVRTreeQuery_OBJECTS) $(MVRTreeQuery_DEPENDENCIES) $(EXTRA_MVRTreeQuery_DEPENDENCIES) 
 	@rm -f MVRTreeQuery$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(MVRTreeQuery_OBJECTS) $(MVRTreeQuery_LDADD) $(LIBS)
diff --git a/test/rtree/Makefile.in b/test/rtree/Makefile.in
index f88cabe..cf76756 100644
--- a/test/rtree/Makefile.in
+++ b/test/rtree/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,23 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -320,18 +348,23 @@ clean-noinstPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
+
 Exhaustive$(EXEEXT): $(Exhaustive_OBJECTS) $(Exhaustive_DEPENDENCIES) $(EXTRA_Exhaustive_DEPENDENCIES) 
 	@rm -f Exhaustive$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(Exhaustive_OBJECTS) $(Exhaustive_LDADD) $(LIBS)
+
 Generator$(EXEEXT): $(Generator_OBJECTS) $(Generator_DEPENDENCIES) $(EXTRA_Generator_DEPENDENCIES) 
 	@rm -f Generator$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(Generator_OBJECTS) $(Generator_LDADD) $(LIBS)
+
 RTreeBulkLoad$(EXEEXT): $(RTreeBulkLoad_OBJECTS) $(RTreeBulkLoad_DEPENDENCIES) $(EXTRA_RTreeBulkLoad_DEPENDENCIES) 
 	@rm -f RTreeBulkLoad$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(RTreeBulkLoad_OBJECTS) $(RTreeBulkLoad_LDADD) $(LIBS)
+
 RTreeLoad$(EXEEXT): $(RTreeLoad_OBJECTS) $(RTreeLoad_DEPENDENCIES) $(EXTRA_RTreeLoad_DEPENDENCIES) 
 	@rm -f RTreeLoad$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(RTreeLoad_OBJECTS) $(RTreeLoad_LDADD) $(LIBS)
+
 RTreeQuery$(EXEEXT): $(RTreeQuery_OBJECTS) $(RTreeQuery_DEPENDENCIES) $(EXTRA_RTreeQuery_DEPENDENCIES) 
 	@rm -f RTreeQuery$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(RTreeQuery_OBJECTS) $(RTreeQuery_LDADD) $(LIBS)
diff --git a/test/tprtree/Makefile.in b/test/tprtree/Makefile.in
index ae5c6db..df22dfa 100644
--- a/test/tprtree/Makefile.in
+++ b/test/tprtree/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,23 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \	]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -331,15 +359,19 @@ clean-noinstPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
+
 Exhaustive$(EXEEXT): $(Exhaustive_OBJECTS) $(Exhaustive_DEPENDENCIES) $(EXTRA_Exhaustive_DEPENDENCIES) 
 	@rm -f Exhaustive$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(Exhaustive_OBJECTS) $(Exhaustive_LDADD) $(LIBS)
+
 Generator$(EXEEXT): $(Generator_OBJECTS) $(Generator_DEPENDENCIES) $(EXTRA_Generator_DEPENDENCIES) 
 	@rm -f Generator$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(Generator_OBJECTS) $(Generator_LDADD) $(LIBS)
+
 TPRTreeLoad$(EXEEXT): $(TPRTreeLoad_OBJECTS) $(TPRTreeLoad_DEPENDENCIES) $(EXTRA_TPRTreeLoad_DEPENDENCIES) 
 	@rm -f TPRTreeLoad$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(TPRTreeLoad_OBJECTS) $(TPRTreeLoad_LDADD) $(LIBS)
+
 TPRTreeQuery$(EXEEXT): $(TPRTreeQuery_OBJECTS) $(TPRTreeQuery_DEPENDENCIES) $(EXTRA_TPRTreeQuery_DEPENDENCIES) 
 	@rm -f TPRTreeQuery$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(TPRTreeQuery_OBJECTS) $(TPRTreeQuery_LDADD) $(LIBS)
diff --git a/test/tprtree/TPRTreeLoad.cc b/test/tprtree/TPRTreeLoad.cc
index 3ad8445..a35e640 100644
--- a/test/tprtree/TPRTreeLoad.cc
+++ b/test/tprtree/TPRTreeLoad.cc
@@ -46,7 +46,7 @@ using namespace std;
 class MyVisitor : public IVisitor
 {
 public:
-	void visitNode(const INode& n) {}
+	void visitNode(const INode& ) {}
 
 	void visitData(const IData& d)
 	{
@@ -54,7 +54,7 @@ public:
 			// the ID of this data entry is an answer to the query. I will just print it to stdout.
 	}
 
-	void visitData(std::vector<const IData*>& v) {}
+	void visitData(std::vector<const IData*>& ) {}
 };
 
 int main(int argc, char** argv)
diff --git a/test/tprtree/TPRTreeQuery.cc b/test/tprtree/TPRTreeQuery.cc
index f12750e..4b226ba 100644
--- a/test/tprtree/TPRTreeQuery.cc
+++ b/test/tprtree/TPRTreeQuery.cc
@@ -78,7 +78,7 @@ public:
 			// the ID of this data entry is an answer to the query. I will just print it to stdout.
 	}
 
-	void visitData(std::vector<const IData*>& v) {}
+	void visitData(std::vector<const IData*>& ) {}
 };
 
 // example of a Strategy pattern.
@@ -109,7 +109,7 @@ public:
 		// traverse only index nodes at levels 2 and higher.
 		if (n != 0 && n->getLevel() > 1)
 		{
-			for (size_t cChild = 0; cChild < n->getChildrenCount(); cChild++)
+			for (uint32_t cChild = 0; cChild < n->getChildrenCount(); cChild++)
 			{
 				ids.push(n->getChildIdentifier(cChild));
 			}
@@ -135,7 +135,7 @@ public:
 	Region m_indexedSpace;
 
 public:
-	void getNextEntry(const IEntry& entry, id_type& nextEntry, bool& hasNext)
+	void getNextEntry(const IEntry& entry, id_type&, bool& hasNext)
 	{
 		// the first time we are called, entry points to the root.
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/libspatialindex.git



More information about the Pkg-grass-devel mailing list