[Liblas-commits] hg: try rounding instead of int() cast

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Dec 31 14:07:34 EST 2009


changeset 604a2c6d925c in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=604a2c6d925c
summary: try rounding instead of int() cast

diffstat:

 python/tests/File.txt |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (28 lines):

diff -r 2b101e8352b8 -r 604a2c6d925c python/tests/File.txt
--- a/python/tests/File.txt	Thu Dec 31 13:00:11 2009 -0600
+++ b/python/tests/File.txt	Thu Dec 31 13:03:24 2009 -0600
@@ -139,15 +139,15 @@
   <liblas.point.Point object at ...>
 
   >>> for g in points:
-  ...   print int(g.x), int(g.y)
-  630262 4834500
-  630282 4834500
-  630300 4834500
-  630346 4834500
-  630327 4834500
-  630323 4834500
-  630320 4834500
-  630280 4834500
+  ...   print round(g.x, 6), round(g.y, 6)
+  630262.3 4834500.0
+  630282.45 4834500.0
+  630300.07 4834500.0
+  630346.82 4834500.0
+  630327.58 4834500.0
+  630323.57 4834500.0
+  630320.95 4834500.0
+  630280.89 4834500.0
 
 Now try writing a 1.2 version of the junk2.las file above to ensure that
 the data_offset *doesn't* change at all


More information about the Liblas-commits mailing list