[Liblas-commits] hg: Fix #240,
unprintable UserData and ScanAngleRank
liblas-commits at liblas.org
liblas-commits at liblas.org
Fri Jul 1 11:11:53 EDT 2011
details: http://hg.liblas.orghg/rev/08f64fd1e2a1
changeset: 3061:08f64fd1e2a1
user: Howard Butler <hobu.inc at gmail.com>
date: Fri Jul 01 10:11:48 2011 -0500
description:
Fix #240, unprintable UserData and ScanAngleRank
diffstat:
apps/las2txt.cpp | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diffs (72 lines):
diff -r c3bc50b1db80 -r 08f64fd1e2a1 apps/las2txt.cpp
--- a/apps/las2txt.cpp Fri Jul 01 09:40:32 2011 -0500
+++ b/apps/las2txt.cpp Fri Jul 01 10:11:48 2011 -0500
@@ -150,10 +150,6 @@
{
std::ostringstream output;
-
-
- output.setf(std::ios_base::fixed, std::ios_base::floatfield);
-
boost::uint32_t i = 0;
liblas::Color const& c = p.GetColor();
@@ -167,19 +163,24 @@
output.setf(std::ios_base::fixed, std::ios_base::floatfield);
output.precision(precisions[0]); //x precision
output << p.GetX();
- // lidardouble2string(printstring, LASPoint_GetX(p)); fprintf(file_out, "%s", printstring);
+ output.unsetf(std::ios_base::fixed);
+ output.unsetf(std::ios_base::floatfield);
break;
/* // the y coordinate */
case 'y':
output.setf(std::ios_base::fixed, std::ios_base::floatfield);
output.precision(precisions[1]); //y precision
output << p.GetY();
+ output.unsetf(std::ios_base::fixed);
+ output.unsetf(std::ios_base::floatfield);
break;
/* // the z coordinate */
case 'z':
output.setf(std::ios_base::fixed, std::ios_base::floatfield);
output.precision(precisions[2]); //z precision
output << p.GetZ();
+ output.unsetf(std::ios_base::fixed);
+ output.unsetf(std::ios_base::floatfield);
break;
/* // the raw x coordinate */
case 'X':
@@ -198,6 +199,8 @@
output.setf(std::ios_base::fixed, std::ios_base::floatfield);
output.precision(precisions[3]); //t precision
output << p.GetTime();
+ output.unsetf(std::ios_base::fixed);
+ output.unsetf(std::ios_base::floatfield);
break;
/* // the intensity */
case 'i':
@@ -205,7 +208,7 @@
break;
/* the scan angle */
case 'a':
- output << p.GetScanAngleRank();
+ output << (int)p.GetScanAngleRank();
break;
/* the number of the return */
case 'r':
@@ -221,7 +224,12 @@
break;
/* the user data */
case 'u':
- output << p.GetUserData();
+ // output.setf( std::ios_base::hex, std::ios_base::basefield );
+ // output.setf( std::ios::showbase);
+ output << (int)p.GetUserData();
+ // output.unsetf(std::ios_base::hex);
+ // output.unsetf(std::ios_base::basefield);
+ // output.unsetf( std::ios::showbase);
break;
/* the number of returns of given pulse */
case 'n':
More information about the Liblas-commits
mailing list