[Liblas-commits] hg: 4 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Nov 15 17:25:12 EST 2010


changeset a0ecc216a208 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=a0ecc216a208
summary: Add more file definitions for testing and larger loop limit.

changeset eab21008af17 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=eab21008af17
summary: Bump Index revision. Add method to validate index version for use with filter iterator.

changeset 2846035161cf in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=2846035161cf
summary: Check index version to validate use with iterator.

changeset c2b2bfcd28c6 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=c2b2bfcd28c6
summary: Number of points in VLR needs to be reset when a VLR is written and more data waits in queue.

diffstat:

 apps/lasindex_test.cpp           |  28 ++++++++++++++++++++++++++--
 include/liblas/lasindex.hpp      |   6 +++++-
 src/detail/index/indexoutput.cpp |   1 +
 src/lasindex.cpp                 |   6 ++++++
 4 files changed, 38 insertions(+), 3 deletions(-)

diffs (109 lines):

diff -r a3ebc4007bb9 -r c2b2bfcd28c6 apps/lasindex_test.cpp
--- a/apps/lasindex_test.cpp	Mon Nov 15 12:15:52 2010 -0600
+++ b/apps/lasindex_test.cpp	Mon Nov 15 15:24:19 2010 -0700
@@ -312,7 +312,7 @@
 		 "-n", "K:\\FME\\billion_points_idx.ldx", "-r", "-it", "5000000"};
 	argc = 8;
 	*/
-	/*---------------------------billion_points-------------------------------*/
+	/*---------------------------400Pts---------------------------------------*/
 	/*-----------------build index in standalone file---------------------------
 	const char* arggv[] = {"foo", "-t", "C:\\LibLAS\\Samples\\400Pts.tmp",
 		 "-i", "C:\\LibLAS\\Samples\\400Pts.las", "-a", SAMPLE_AUTHOR, "-c", SAMPLE_COMMENT, "-d", SAMPLE_DATE,
@@ -324,6 +324,30 @@
 		 "-n", "C:\\LibLAS\\Samples\\400Pts_idx.ldx", "-r", "-it", "25"};
 	argc = 8;
 	*/
+	/*---------------------------355by355-------------------------------------*/
+	/*-----------------build index in standalone file---------------------------
+	const char* arggv[] = {"foo", "-t", "C:\\LibLAS\\Samples\\355by355.tmp",
+		 "-i", "C:\\LibLAS\\Samples\\355by355.las", "-a", SAMPLE_AUTHOR, "-c", SAMPLE_COMMENT, "-d", SAMPLE_DATE,
+		 "-o", "C:\\LibLAS\\Samples\\355by355_idx.ldx", "-s", "-it", "100"};
+	argc = 16;
+	*/
+	/*-------------------filter from standalone file using iterator-------------
+	const char* arggv[] = {"foo", "-i", "C:\\LibLAS\\Samples\\355by355.las",
+		 "-n", "C:\\LibLAS\\Samples\\355by355_idx.ldx", "-r", "-it", "25"};
+	argc = 8;
+	*/
+	/*---------------------------545by545-------------------------------------*/
+	/*-----------------build index in standalone file---------------------------
+	const char* arggv[] = {"foo", "-t", "C:\\LibLAS\\Samples\\545by545.tmp",
+		 "-i", "C:\\LibLAS\\Samples\\545by545.las", "-a", SAMPLE_AUTHOR, "-c", SAMPLE_COMMENT, "-d", SAMPLE_DATE,
+		 "-o", "C:\\LibLAS\\Samples\\545by545_idx.ldx", "-s", "-it", "100"};
+	argc = 16;
+	*/
+	/*-------------------filter from standalone file using iterator-------------
+	const char* arggv[] = {"foo", "-i", "C:\\LibLAS\\Samples\\545by545.las",
+		 "-n", "C:\\LibLAS\\Samples\\545by545_idx.ldx", "-r", "-it", "25"};
+	argc = 8;
+	*/
 	
 	for (int i = 1; i < argc; i++)
     {
@@ -501,7 +525,7 @@
 										IndexIterator *indexIt2 = index.Filter(ParamSrc2, chunkSize);
 										if (indexIt && indexIt2)
 										{
-											for (boost::uint32_t step = 0; step < 1000; ++step)
+											for (boost::uint32_t step = 0; step < 5000; ++step)
 											{
 												// use any of these to begin the vector with the next point that fits the filter criteria 
 												// that hasn't been scanned yet.
diff -r a3ebc4007bb9 -r c2b2bfcd28c6 include/liblas/lasindex.hpp
--- a/include/liblas/lasindex.hpp	Mon Nov 15 12:15:52 2010 -0600
+++ b/include/liblas/lasindex.hpp	Mon Nov 15 15:24:19 2010 -0700
@@ -61,7 +61,7 @@
 #define LIBLAS_INDEX_MAXMEMDEFAULT	10000000	// 10 megs default
 #define LIBLAS_INDEX_MINMEMDEFAULT	1000000	// 1 meg at least has to be allowed
 #define LIBLAS_INDEX_VERSIONMAJOR	1
-#define LIBLAS_INDEX_VERSIONMINOR	1	// minor version 1 begins 10/12/10
+#define LIBLAS_INDEX_VERSIONMINOR	2	// minor version 2 begins 11/15/10
 #define LIBLAS_INDEX_MAXSTRLEN	512
 #define LIBLAS_INDEX_MAXCELLS	250000
 #define LIBLAS_INDEX_OPTPTSPERCELL	100
@@ -488,6 +488,8 @@
 private:
  	void Copy(IndexIterator const& other);
 	void ResetPosition(void);
+	boost::uint8_t MinMajorVersion(void)	{return(1);};
+	boost::uint8_t MinMinorVersion(void)	{return(2);};
 
 public:
 	/// n=0 or n=1 gives next sequence with no gap, n>1 skips n-1 filter-compliant points, n<0 skips backwards
@@ -512,6 +514,8 @@
 	inline const std::vector<boost::uint32_t>& operator-(boost::int32_t n)	{return (advance(-n));}
     /// returns filter-compliant points beginning with the nth compliant point, 0 and 1 return first set of compliant points
 	inline const std::vector<boost::uint32_t>& operator[](boost::int32_t n)	{return ((*this)(n));}
+	/// tests viability of index for filtering with iterator
+	bool ValidateIndexVersion(boost::uint8_t VersionMajor, boost::uint8_t VersionMinor)	{return (VersionMajor > MinMajorVersion() || (VersionMajor == MinMajorVersion() && VersionMinor >= MinMinorVersion()));};
 };
 
 template <typename T, typename Q>
diff -r a3ebc4007bb9 -r c2b2bfcd28c6 src/detail/index/indexoutput.cpp
--- a/src/detail/index/indexoutput.cpp	Mon Nov 15 12:15:52 2010 -0600
+++ b/src/detail/index/indexoutput.cpp	Mon Nov 15 15:24:19 2010 -0700
@@ -265,6 +265,7 @@
 				// get set up for next VLR
 				if (! InitializeVLRData(x, y))
 					return false;
+				m_DataPointsThisVLR = NumPts;
 			} // if
 			// if size allows, add to VLR cell record data
 			if (m_TempWritePos + m_DataRecordSize <= numeric_limits<unsigned short>::max())
diff -r a3ebc4007bb9 -r c2b2bfcd28c6 src/lasindex.cpp
--- a/src/lasindex.cpp	Mon Nov 15 12:15:52 2010 -0600
+++ b/src/lasindex.cpp	Mon Nov 15 15:24:19 2010 -0700
@@ -291,6 +291,12 @@
 								fprintf(m_debugger, "Index bounds do not intersect filter bounds.\n");
 							break;
 						} // if
+						if (ParamSrc.m_iterator && ! ParamSrc.m_iterator->ValidateIndexVersion(GetVersionMajor(), GetVersionMinor()))
+						{
+							if (m_debugOutputLevel > 1)
+								fprintf(m_debugger, "Index version does not support iterator access. Regenerate Index.\n");
+							break;
+						} // if
 					} // if 42
 					else if (RecordID == m_DataVLR_ID)
 					{


More information about the Liblas-commits mailing list