[Liblas-commits] hg: 7 new changesets
liblas-commits at liblas.org
liblas-commits at liblas.org
Tue Apr 6 14:50:22 EDT 2010
changeset 27f15c83485c in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=27f15c83485c
summary: more docs for liblas.point
changeset 9b8ad6f04d5f in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=9b8ad6f04d5f
summary: __iter__ support for color, add tests
changeset 9dd446d51528 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=9dd446d51528
summary: more docs and tests for liblas.file
changeset 55852b8e0cb1 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=55852b8e0cb1
summary: keep account of old base size so we can expand/contract the size as needed when the user tweaks PointFormat parameters
changeset d68d5a1e69f4 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=d68d5a1e69f4
summary: more docs
changeset 534f1313f1b2 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=534f1313f1b2
summary: more docs
changeset f7723d9443e7 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=f7723d9443e7
summary: ensure libas::PointFormat properly expands and contracts as size() and other parameters about the format are set
diffstat:
doc/index.txt | 12 +-
doc/python/classes.txt | 67 ++++++++-
doc/python/index.txt | 4 +
doc/python/tutorial.txt | 3 +-
doc/utilities/lasinfo.txt | 4 -
doc/utilities/lasmerge.txt | 2 +-
include/liblas/lasformat.hpp | 8 +-
python/liblas/color.py | 76 +++++++++-
python/liblas/core.py | 23 ++-
python/liblas/file.py | 87 ++++++++--
python/liblas/format.py | 39 ++++-
python/liblas/header.py | 17 +-
python/liblas/point.py | 344 ++++++++++++++++++++++++++++++++++++------
python/tests/Color.txt | 26 +++
python/tests/File.txt | 2 +
python/tests/Format.txt | 22 ++
python/tests/Point.txt | 4 +-
src/las_c_api.cpp | 4 +-
src/lasformat.cpp | 73 ++++++++-
19 files changed, 701 insertions(+), 116 deletions(-)
diffs (truncated from 1288 to 300 lines):
diff -r db534a58c501 -r f7723d9443e7 doc/index.txt
--- a/doc/index.txt Mon Apr 05 10:46:57 2010 -0500
+++ b/doc/index.txt Tue Apr 06 13:44:15 2010 -0500
@@ -1,12 +1,5 @@
-.. libLAS documentation master file, created by
- sphinx-quickstart on Mon Mar 30 11:04:44 2009.
- You can adapt this file completely to your liking, but it should at least
- contain the root `toctree` directive.
-Welcome to libLAS's documentation!
-==================================
-
-Contents:
+Some text goes here
.. toctree::
:maxdepth: 1
@@ -15,9 +8,6 @@
python/index
-Indices and tables
-==================
-
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
diff -r db534a58c501 -r f7723d9443e7 doc/python/classes.txt
--- a/doc/python/classes.txt Mon Apr 05 10:46:57 2010 -0500
+++ b/doc/python/classes.txt Tue Apr 06 13:44:15 2010 -0500
@@ -1,14 +1,77 @@
+.. raw:: pdf
+
+ PageBreak
+
.. _class_documentation:
****************************************************************
Python Class Documentation
****************************************************************
+
+
+=============================================
+liblas.point.Point
+=============================================
+
.. autoclass:: liblas.point.Point
- :members: x, y, z, time, scan_angle, scan_direction, scan_flags, flightline_edge, number_of_returns, return_number
+ :members: __init__,
+ x,
+ y,
+ z,
+ time,
+ raw_time,
+ scan_angle,
+ scan_direction,
+ scan_flags,
+ flightline_edge,
+ number_of_returns,
+ return_number,
+ classification,
+ user_data,
+ point_source_id,
+ color,
+ data,
+ descale,
+ scale
+
+=============================================
+liblas.file.File
+=============================================
.. autoclass:: liblas.file.File
- :members: __init__, close, header, read, write, __iter__, __getitem__
+ :members: __init__,
+ close,
+ header,
+ read,
+ write,
+ output_srs,
+ input_srs,
+ __iter__,
+ __getitem__,
+ __len__
+
+=============================================
+liblas.color.Color
+=============================================
+
+.. autoclass:: liblas.color.Color
+ :members: __init__,
+ red,
+ green,
+ blue,
+ __iter__
+
+
+=============================================
+liblas.format.Format
+=============================================
+
+.. autoclass:: liblas.format.Format
+ :members: __init__
+
+.. _specification: http://liblas.org/raw-attachment/wiki/WikiStart/asprs_las_format_v13.pdf
+
# .. doxygenclass:: liblas::Color
# :project: class
diff -r db534a58c501 -r f7723d9443e7 doc/python/index.txt
--- a/doc/python/index.txt Mon Apr 05 10:46:57 2010 -0500
+++ b/doc/python/index.txt Tue Apr 06 13:44:15 2010 -0500
@@ -1,3 +1,7 @@
+.. raw:: pdf
+
+ PageBreak
+
.. _python:
****************************************************************
diff -r db534a58c501 -r f7723d9443e7 doc/python/tutorial.txt
--- a/doc/python/tutorial.txt Mon Apr 05 10:46:57 2010 -0500
+++ b/doc/python/tutorial.txt Tue Apr 06 13:44:15 2010 -0500
@@ -128,7 +128,8 @@
# only works if you have libgeotiff and/or GDAL linked in
>>> s = h.srs
>>> s.proj4
- +proj=tmerc +lat_0=0.000000000 +lon_0=-93.000000000 +k=0.999600 +x_0=500000.000 +y_0=0.000 +ellps=WGS84 +units=m
+ +proj=tmerc +lat_0=0.000000000 +lon_0=-93.000000000 +k=0.999600 \
+ +x_0=500000.000 +y_0=0.000 +ellps=WGS84 +units=m
=============================================
Point
diff -r db534a58c501 -r f7723d9443e7 doc/utilities/lasinfo.txt
--- a/doc/utilities/lasinfo.txt Mon Apr 05 10:46:57 2010 -0500
+++ b/doc/utilities/lasinfo.txt Tue Apr 06 13:44:15 2010 -0500
@@ -1,7 +1,3 @@
-.. raw:: pdf
-
- PageBreak
-
.. _lasinfo:
****************************************************************
diff -r db534a58c501 -r f7723d9443e7 doc/utilities/lasmerge.txt
--- a/doc/utilities/lasmerge.txt Mon Apr 05 10:46:57 2010 -0500
+++ b/doc/utilities/lasmerge.txt Tue Apr 06 13:44:15 2010 -0500
@@ -2,7 +2,7 @@
PageBreak
-_lasmerge:
+.. _lasmerge:
****************************************************************
lasmerge: merge multiple LAS files into a single file
diff -r db534a58c501 -r f7723d9443e7 include/liblas/lasformat.hpp
--- a/include/liblas/lasformat.hpp Mon Apr 05 10:46:57 2010 -0500
+++ b/include/liblas/lasformat.hpp Tue Apr 06 13:44:15 2010 -0500
@@ -96,10 +96,14 @@
liblas::uint8_t m_versionmajor;
bool m_hasColor;
- bool m_hasTime;
+ bool m_hasTime;
+
+ liblas::uint16_t m_base_size;
private:
void updatesize();
+ void updatesize(liblas::uint16_t new_size);
+ liblas::uint16_t calculate_base_size();
};
inline uint16_t PointFormat::GetByteSize() const
@@ -109,7 +113,7 @@
inline void PointFormat::SetByteSize(uint16_t const& value)
{
- m_size = value;
+ updatesize(value);
}
inline uint8_t PointFormat::GetVersionMajor() const
diff -r db534a58c501 -r f7723d9443e7 python/liblas/color.py
--- a/python/liblas/color.py Mon Apr 05 10:46:57 2010 -0500
+++ b/python/liblas/color.py Tue Apr 06 13:44:15 2010 -0500
@@ -45,10 +45,52 @@
class Color(object):
def __init__(self, red=0, green=0, blue=0, owned=True, handle=None):
+ """
+ :keyword red: Red value for the point
+ :type red: integer
+ :keyword green: Green value for the point
+ :type green: integer
+ :keyword blue: Blue value for the point
+ :type blue: integer
+ :keyword owned: flag to denote whether or not the instance owns its shadow
+ :type owned: boolean
+ :keyword handle: raw ctypes object
+
+ >>> from liblas import color
+ >>> c = color.Color()
+ >>> c.red
+ 0
+ >>> c.green
+ 0
+ >>> c.blue
+ 0
+
+ >>> c = color.Color(red = 123, blue = 125, green = 124)
+ >>> c.red
+ 123
+ >>> c.green
+ 124
+ >>> c.blue
+ 125
+
+ .. note::
+ RGB values should always be normalized to 16 bit values. For example,
+ when encoding an 8 bit per channel pixel, multiply each channel value
+ by 256 prior to storage in these fields. This normalization allows
+ color values from different camera bit depths to be accurately merged.
+ """
if handle:
self.handle = handle
else:
self.handle = core.las.LASColor_Create()
+
+ if red:
+ self.red = red
+ if green:
+ self.green = green
+ if blue:
+ self.blue = blue
+
self.owned = owned
def __del__(self):
if self.owned:
@@ -59,17 +101,45 @@
return core.las.LASColor_GetRed(self.handle)
def set_red(self, value):
return core.las.LASColor_SetRed(self.handle, value)
- red = property(get_red, set_red)
+ doc = "Red value of the color triple"
+ red = property(get_red, set_red, None, doc)
def get_green(self):
return core.las.LASColor_GetGreen(self.handle)
def set_green(self, value):
return core.las.LASColor_SetGreen(self.handle, value)
- green = property(get_green, set_green)
+ doc = "Green value of the color triple"
+ green = property(get_green, set_green, None, doc)
def get_blue(self):
return core.las.LASColor_GetBlue(self.handle)
def set_blue(self, value):
return core.las.LASColor_SetBlue(self.handle, value)
- blue = property(get_blue, set_blue)
+ doc = "Blue value of the color triple"
+ blue = property(get_blue, set_blue, None, doc)
+ def __iter__(self):
+ """Iterator support. Values are returned in [R,G,B] order
+
+ >>> for i in c:
+ ... print i
+ 123
+ 124
+ 125
+
+ >>> list(c)
+ [123, 124, 125]
+ """
+ r = False
+ g = False
+ b = False
+ if not r:
+ r = True
+ yield self.red
+ if not g:
+ g = True
+ yield self.green
+ if not b:
+ b = True
+ yield self.blue
+
\ No newline at end of file
diff -r db534a58c501 -r f7723d9443e7 python/liblas/core.py
--- a/python/liblas/core.py Mon Apr 05 10:46:57 2010 -0500
+++ b/python/liblas/core.py Tue Apr 06 13:44:15 2010 -0500
@@ -285,6 +285,14 @@
las.LASPoint_SetUserData.argtypes = [ctypes.c_void_p, ctypes.c_ubyte]
las.LASPoint_SetUserData.errcheck = check_return
+las.LASPoint_SetPointSourceId.restype = ctypes.c_short
+las.LASPoint_SetPointSourceId.argtypes = [ctypes.c_void_p]
More information about the Liblas-commits
mailing list