[Liblas-commits] hg: apply Gary's latest

liblas-commits at liblas.org liblas-commits at liblas.org
Wed Sep 22 23:34:10 EDT 2010


changeset 220ac7e4553a in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=220ac7e4553a
summary: apply Gary's latest

diffstat:

 apps/lasindex_test.cpp |   4 ++--
 src/lasindex.cpp       |  12 +++++-------
 2 files changed, 7 insertions(+), 9 deletions(-)

diffs (65 lines):

diff -r 24869d8813a8 -r 220ac7e4553a apps/lasindex_test.cpp
--- a/apps/lasindex_test.cpp	Wed Sep 22 14:12:23 2010 -0500
+++ b/apps/lasindex_test.cpp	Wed Sep 22 22:34:00 2010 -0500
@@ -380,8 +380,8 @@
 				std::istream* idxstrm = NULL;
 				if (idxinfilenme)
 				{
-                    // FIXME: Is this assignment intentional or it should read '==' ? --mloskot
-					if (idxstrm = OpenInput(std::string(idxinfilenme)))
+					idxstrm = OpenInput(std::string(idxinfilenme));
+					if (idxstrm)
 					{
 						idxreader = new Reader(*idxstrm);
 					} // if
diff -r 24869d8813a8 -r 220ac7e4553a src/lasindex.cpp
--- a/src/lasindex.cpp	Wed Sep 22 14:12:23 2010 -0500
+++ b/src/lasindex.cpp	Wed Sep 22 22:34:00 2010 -0500
@@ -732,7 +732,7 @@
 		{
 			// seek and read
 			assert(static_cast<boost::uint32_t>(PointID) < m_pointRecordsCount);
-			PtRead = m_reader->ReadPointAt(PointID);
+			PtRead = (m_reader->seek(PointID) && m_reader->ReadNextPoint());
 		} // if
 		if (PtRead)
 		{
@@ -775,7 +775,7 @@
 				{
 					// seek and read
 					assert(static_cast<boost::uint32_t>(PointID) < m_pointRecordsCount);
-					PtRead = m_reader->ReadPointAt(PointID);
+					PtRead = (m_reader->seek(PointID) && m_reader->ReadNextPoint());
 				} // if
 				if (PtRead)
 				{
@@ -819,7 +819,7 @@
 				{
 					// seek and read
 					assert(static_cast<boost::uint32_t>(PointID) < m_pointRecordsCount);
-					PtRead = m_reader->ReadPointAt(PointID);
+					PtRead = (m_reader->seek(PointID) && m_reader->ReadNextPoint());
 				} // if
 				if (PtRead)
 				{
@@ -1009,7 +1009,7 @@
 							{
 								// get the actual point from the las file
 								assert(MapIt->first < m_pointRecordsCount);
-								if (m_reader->ReadPointAt(MapIt->first))
+								if (m_reader->seek(MapIt->first) && m_reader->ReadNextPoint())
 								{
 									boost::uint32_t FirstPt = 0, LastCellZ = static_cast<boost::uint32_t>(~0);
 									boost::uint32_t LastSubCell = static_cast<boost::uint32_t>(~0);
@@ -1236,10 +1236,8 @@
 						return (FileError("Index::PurgePointsToTempFile"));
 					CellBlock[x][y].SetFileOffset(m_tempFileWrittenBytes);
 
+					// seek to end of file where next block of data will be written
 					fseek(m_tempFile, 0, SEEK_END);
-					boost::uint32_t FilePos = ftell(m_tempFile);
-					if (FilePos < 19600)
-						printf("file position error");
 					// write a blank space for later placement of next file block for this cell
 					if (fwrite(&EmptyOffset, sizeof(boost::uint32_t), 1, m_tempFile) < 1)
 						return (FileError("Index::PurgePointsToTempFile"));


More information about the Liblas-commits mailing list