[Liblas-commits] hg: 5 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Oct 5 14:01:07 EDT 2010


changeset 8378b58d01c8 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=8378b58d01c8
summary: only write raw data

changeset daf632a51770 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=daf632a51770
summary: Extra data no longer has any meaning.  This was never released so I am removing it

changeset 87960b0cb0f2 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=87960b0cb0f2
summary: remove the concept of ExtraData, as this has no meaning with respect to the concept of schemas.

changeset db2aba54148e in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=db2aba54148e
summary: Get/SetTime uses raw data now, remove ExtraData concept

changeset ea9e540044c0 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=ea9e540044c0
summary: update reader to deal in raw, uninterpreted data

diffstat:

 include/liblas/capi/liblas.h           |   23 --
 include/liblas/detail/reader/point.hpp |    4 +-
 include/liblas/detail/writer/point.hpp |    5 +-
 include/liblas/laspoint.hpp            |  123 +------------
 python/liblas/core.py                  |   22 +-
 python/liblas/point.py                 |   76 +++---
 src/detail/reader/point.cpp            |  107 +----------
 src/detail/writer/point.cpp            |  133 ++++---------
 src/las_c_api.cpp                      |   43 ----
 src/laspoint.cpp                       |  319 +++-----------------------------
 test/unit/laspoint_test.cpp            |   54 ++--
 11 files changed, 162 insertions(+), 747 deletions(-)

diffs (truncated from 1183 to 300 lines):

diff -r e1a089b478c3 -r ea9e540044c0 include/liblas/capi/liblas.h
--- a/include/liblas/capi/liblas.h	Tue Oct 05 10:55:55 2010 -0500
+++ b/include/liblas/capi/liblas.h	Tue Oct 05 13:00:53 2010 -0500
@@ -1121,29 +1121,6 @@
 */
 LAS_DLL LASError LASPoint_SetColor(LASPointH hPoint, const LASColorH hColor);
 
-/** Gets the extra data stream for the LASPointH as an array of bytes.  The length of this 
- *  array should be the difference between the LASSchema_GetByteSize() and the 
- *  a LASHeader_GetDataRecordLength().  Points with data larger than this (fixed) size 
- *  will be clipped upong being written into the file. You must allocate it on 
- *  the heap and you are responsible for its destruction.
- *  @param hPoint the LASPointH instance
- *  @param data a pointer to your array where you want the data copied
- *  @return LASErrorEnum
-*/
-LAS_DLL LASError LASPoint_GetExtraData(const LASPointH hPoint, unsigned char** data, unsigned short* length);
-
-/** Sets the extra data stream for the LASPointH as an array of bytes.  The length of this 
- *  array should be the difference between the LASSchema_GetByteSize() and the 
- *  a LASHeader_GetDataRecordLength().  Points with data larger than this (fixed) size 
- *  will be clipped upong being written into the file. 
- *  the VLR structure.
- *  @param hPoint the LASPointH instance
- *  @param data a pointer to your array.  
- *  @param length a pointer to an integer defining the size of the data array 
- *  @return LASErrorEnum
-*/
-LAS_DLL LASError LASPoint_SetExtraData(const LASPointH hPoint, unsigned char* data, unsigned short length);
-
 
 /****************************************************************************/
 /* SRS Operations                                                           */
diff -r e1a089b478c3 -r ea9e540044c0 include/liblas/detail/reader/point.hpp
--- a/include/liblas/detail/reader/point.hpp	Tue Oct 05 10:55:55 2010 -0500
+++ b/include/liblas/detail/reader/point.hpp	Tue Oct 05 13:00:53 2010 -0500
@@ -81,11 +81,9 @@
     HeaderPtr m_header;
     liblas::Point m_point;
     std::vector<boost::uint8_t> m_raw_data;
-    bool bColor;
-    bool bTime;
     
     void setup();
-    void fill(PointRecord& record);
+
 };
 
 
diff -r e1a089b478c3 -r ea9e540044c0 include/liblas/detail/writer/point.hpp
--- a/include/liblas/detail/writer/point.hpp	Tue Oct 05 10:55:55 2010 -0500
+++ b/include/liblas/detail/writer/point.hpp	Tue Oct 05 13:00:53 2010 -0500
@@ -66,7 +66,7 @@
     Point(std::ostream& ofs, boost::uint32_t& count, HeaderPtr header);
     virtual ~Point();
 
-    const liblas::Point& GetPoint() const { return m_point; }
+    // const liblas::Point& GetPoint() const { return m_point; }
     void write( const liblas::Point& );
     
 protected:
@@ -82,7 +82,6 @@
     
     std::ostream& m_ofs;
     HeaderPtr m_header;
-    liblas::Point m_point;
         
     PointRecord m_record;
     
@@ -94,7 +93,7 @@
     bool bColor;
         
     void setup();
-    void fill();
+    // void fill();
 };
 
 }}} // namespace liblas::detail::writer
diff -r e1a089b478c3 -r ea9e540044c0 include/liblas/laspoint.hpp
--- a/include/liblas/laspoint.hpp	Tue Oct 05 10:55:55 2010 -0500
+++ b/include/liblas/laspoint.hpp	Tue Oct 05 13:00:53 2010 -0500
@@ -63,22 +63,6 @@
 
 namespace liblas {
 
-class PointFactory
-{
-public:
-    PointFactory();
-    
-    static const PointFactory* getInstance();
-    
-    PointPtr createPoint() const;
-    PointPtr createPoint(HeaderPtr hdr) const;
-    
-    /// Destructor
-    virtual ~PointFactory();
-
-private:
-    HeaderPtr m_header;    
-};
 
 /// Point data record composed with X, Y, Z coordinates and attributes.
 class Point
@@ -210,9 +194,7 @@
 
     bool Validate() const;
     bool IsValid() const;
-    
-    std::vector<boost::uint8_t> const& GetExtraData() const { return m_extra_data; }
-    void SetExtraData(std::vector<boost::uint8_t> const& v) { m_extra_data = v;}
+
 
     std::vector<boost::uint8_t> const& GetData() const {return m_format_data; }
     void SetData(std::vector<boost::uint8_t> const& v) { m_format_data = v;}
@@ -227,26 +209,10 @@
 private:
 
     detail::PointRecord m_record;
-    std::vector<boost::uint8_t> m_extra_data;
     std::vector<boost::uint8_t> m_format_data;
-
-    // If we don't have a header, we have no way to scale the data.
-    // We're going to cache the value until the user sets the header for the point
-    // This means that the raw data is *out of sync* with the real data
-    // until there is a header attached to the point and the writer 
-    // must account for this.    
-    boost::array<double, 3> m_double_coords_cache;
     
     std::vector<boost::uint8_t>::size_type GetDimensionPosition(std::string const& name) const;
-    
-    Color m_color;
-    double m_gps_time;
-    boost::uint16_t m_intensity;
-    boost::uint16_t m_source_id;
-    boost::uint8_t m_flags;
-    boost::uint8_t m_user_data;
-    boost::int8_t m_angle_rank;
-    Classification m_class;
+
     HeaderPtr m_header;
     Header const& m_default_header;
 
@@ -265,91 +231,6 @@
     return (!(lhs == rhs));
 }
 
-// inline boost::uint16_t Point::GetIntensity() const
-// {
-//     return m_intensity;
-// }
-// 
-// inline void Point::SetIntensity(boost::uint16_t const& intensity)
-// {
-//     m_intensity = intensity;
-// }
-
-// inline boost::uint16_t Point::GetReturnNumber() const
-// {
-//     // Read bits 1,2,3 (first 3 bits)
-//     return (m_flags & 0x07);
-// }
-
-// inline boost::uint16_t Point::GetNumberOfReturns() const
-// {
-//     // Read bits 4,5,6
-//     return ((m_flags >> 3) & 0x07);
-// }
-
-// inline boost::uint16_t Point::GetScanDirection() const
-// {
-//     // Read 7th bit
-//     return ((m_flags >> 6) & 0x01);
-// }
-// 
-// inline boost::uint16_t Point::GetFlightLineEdge() const
-// {
-//     // Read 8th bit
-//     return ((m_flags >> 7) & 0x01);
-// }
-
-// inline boost::uint8_t Point::GetScanFlags() const
-// {
-//     return m_flags;
-// }
-
-// inline void Point::SetScanFlags(boost::uint8_t const& flags)
-// {
-//     m_flags = flags;
-// }
-
-// inline boost::int8_t Point::GetScanAngleRank() const
-// {
-//     return m_angle_rank;
-// }
-
-// inline boost::uint8_t Point::GetUserData() const
-// {
-//     return m_user_data;
-// }
-
-// inline boost::uint16_t Point::GetPointSourceID() const
-// {
-//     return m_source_id;
-// }
-// 
-// inline void Point::SetPointSourceID(boost::uint16_t const& id)
-// {
-//     m_source_id = id;
-// }
-
-inline double Point::GetTime() const
-{
-    return m_gps_time;
-}
-
-inline void Point::SetTime(double const& time)
-{
-    // assert(time >= 0); // TODO: throw? --mloskot  // negative times are legit, I think -- hobu
-    m_gps_time = time;
-}
-
-// > inline Color const& Point::GetColor() const
-// > {
-// >     return m_color;
-// > }
-
-// inline void Point::SetColor(Color const& value)
-// {
-//     m_color = value;
-// }
-
 inline double Point::operator[](std::size_t const& index) const
 {
     
diff -r e1a089b478c3 -r ea9e540044c0 python/liblas/core.py
--- a/python/liblas/core.py	Tue Oct 05 10:55:55 2010 -0500
+++ b/python/liblas/core.py	Tue Oct 05 13:00:53 2010 -0500
@@ -308,17 +308,17 @@
 las.LASPoint_GetPointSourceId.argtypes = [ctypes.c_void_p]
 las.LASPoint_GetPointSourceId.errcheck = check_value
 
-las.LASPoint_GetExtraData.argtypes = [ctypes.c_void_p,
-                            ctypes.POINTER(ctypes.POINTER(ctypes.c_ubyte)),
-                            ctypes.POINTER(ctypes.c_int)]
-las.LASPoint_GetExtraData.errcheck = check_value
-las.LASPoint_GetExtraData.restype = ctypes.c_int
-
-las.LASPoint_SetExtraData.argtypes = [ctypes.c_void_p,
-                                        ctypes.POINTER(ctypes.c_ubyte),
-                                        ctypes.c_int]
-las.LASPoint_SetExtraData.errcheck = check_value
-las.LASPoint_SetExtraData.restype = ctypes.c_int
+# las.LASPoint_GetExtraData.argtypes = [ctypes.c_void_p,
+#                             ctypes.POINTER(ctypes.POINTER(ctypes.c_ubyte)),
+#                             ctypes.POINTER(ctypes.c_int)]
+# las.LASPoint_GetExtraData.errcheck = check_value
+# las.LASPoint_GetExtraData.restype = ctypes.c_int
+# 
+# las.LASPoint_SetExtraData.argtypes = [ctypes.c_void_p,
+#                                         ctypes.POINTER(ctypes.c_ubyte),
+#                                         ctypes.c_int]
+# las.LASPoint_SetExtraData.errcheck = check_value
+# las.LASPoint_SetExtraData.restype = ctypes.c_int
 
 las.LASPoint_Create.restype = ctypes.c_void_p
 las.LASPoint_Create.errcheck = check_void
diff -r e1a089b478c3 -r ea9e540044c0 python/liblas/point.py
--- a/python/liblas/point.py	Tue Oct 05 10:55:55 2010 -0500
+++ b/python/liblas/point.py	Tue Oct 05 13:00:53 2010 -0500
@@ -486,41 +486,41 @@
     #     self.y = (self.y * header.scale[1]) + header.offset[1]
     #     self.z = (self.z * header.scale[2]) + header.offset[2]
 
-    def get_data(self):
-        l = ctypes.pointer(ctypes.c_int())
-        d = ctypes.pointer(ctypes.c_ubyte())
-        core.las.LASPoint_GetExtraData(self.handle, ctypes.byref(d), l)
-
-        d2 = ctypes.cast(d, ctypes.POINTER(ctypes.c_ubyte * l.contents.value))
-        s = (ctypes.c_ubyte * l.contents.value)()
-        for i in range(l.contents.value):
-            s[i] = d2.contents[i]
-        p_d = ctypes.cast(d, ctypes.POINTER(ctypes.c_char_p))
-        core.las.LASString_Free(p_d)
-
-        return s
-
-    def set_data(self, data):
-        d = ctypes.cast(data, ctypes.POINTER(ctypes.c_ubyte))
-
-        core.las.LASPoint_SetExtraData(self.handle, d, len(data))
-
-    doc = """Extra byte data for the point. You can attach a variable amount
-    of extra data to each individual point by setting the
-    :obj:`liblas.header.Header.dataformat_id` to a valid value, and then
-    setting the :obj:`liblas.header.Header.data_record_length` to a value that
-    is larger than the nominal length for that format as noted in the
-    specification_.
-


More information about the Liblas-commits mailing list