[Liblas-commits] hg: more docs

liblas-commits at liblas.org liblas-commits at liblas.org
Wed Apr 7 15:57:36 EDT 2010


changeset a6eb8704978d in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=a6eb8704978d
summary: more docs

diffstat:

 doc/python/classes.txt  |  152 +++++++++----
 python/liblas/core.py   |    5 +-
 python/liblas/header.py |  518 ++++++++++++++++++++++++++++++++++++-----------
 3 files changed, 504 insertions(+), 171 deletions(-)

diffs (truncated from 916 to 300 lines):

diff -r 1156369845c1 -r a6eb8704978d doc/python/classes.txt
--- a/doc/python/classes.txt	Tue Apr 06 14:26:32 2010 -0500
+++ b/doc/python/classes.txt	Wed Apr 07 14:51:29 2010 -0500
@@ -10,6 +10,86 @@
 
 
 
+
+
+=============================================
+liblas.color.Color
+=============================================
+
+.. autoclass:: liblas.color.Color
+    :members:   __init__, 
+                red,
+                green,
+                blue,
+                __iter__
+
+
+
+=============================================
+liblas.file.File
+=============================================
+
+.. autoclass:: liblas.file.File
+    :members:   __init__, 
+                close, 
+                header, 
+                read, 
+                write,
+                output_srs,
+                input_srs,
+                __iter__, 
+                __getitem__,
+                __len__
+                
+=============================================
+liblas.format.Format
+=============================================
+
+.. autoclass:: liblas.format.Format
+    :members:   __init__,
+                major,
+                minor,
+                color,
+                time,
+                size
+
+=============================================
+liblas.guid.GUID
+=============================================
+
+.. autoclass:: liblas.guid.GUID
+    :members:   __init__,
+                __str__,
+                __eq__
+
+=============================================
+liblas.header.Header
+=============================================
+
+.. autoclass:: liblas.header.Header
+    :members:   __init__,
+                major,
+                minor,
+                guid,
+                date,
+                project_id,
+                file_signature,
+                file_source_id,
+                encoding,
+                system_id,
+                software_id,
+                header_length,
+                data_offset,
+                num_vlrs,
+                format,
+                data_format_id,
+                count, __len__, set_count,
+                return_count,
+                scale,
+                offset,
+                max,
+                min
+
 =============================================
 liblas.point.Point
 =============================================
@@ -34,56 +114,7 @@
                 data,
                 descale,
                 scale
-
-=============================================
-liblas.file.File
-=============================================
-
-.. autoclass:: liblas.file.File
-    :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__,
-                major,
-                minor,
-                color,
-                time,
-                size
-
-=============================================
-liblas.guid.GUID
-=============================================
-
-.. autoclass:: liblas.guid.GUID
-    :members:   __init__,
-                __str__,
-                __eq__
-
+                
 =============================================
 liblas.vlr.VLR
 =============================================
@@ -96,7 +127,28 @@
                 recordid,
                 reserved,
                 data
+
+=============================================
+liblas.srs.SRS
+=============================================
+
+.. autoclass:: liblas.srs.SRS
+    :members:   __init__,
+                set_verticalcs,
+                wkt,
+                proj4,
+                get_wkt,
+                get_proj4,
+                set_wkt,
+                set_proj4,
+                get_wkt_compoundok,
+                set_userinput
+                
 .. _specification: http://liblas.org/raw-attachment/wiki/WikiStart/asprs_las_format_v13.pdf
+.. _GDAL: http://www.gdal.org
+.. _Proj.4: http://proj.osgeo.org
+.. _SetFromUserInput: http://www.gdal.org/ogr/ogr__srs__api_8h.html#7a043a4b3d477847dcc89efdff3a563a
+
 
 # .. doxygenclass:: liblas::Color
 #    :project: class
diff -r 1156369845c1 -r a6eb8704978d python/liblas/core.py
--- a/python/liblas/core.py	Tue Apr 06 14:26:32 2010 -0500
+++ b/python/liblas/core.py	Wed Apr 07 14:51:29 2010 -0500
@@ -495,6 +495,7 @@
 
 las.LASHeader_AddVLR.argtypes = [ctypes.c_void_p, ctypes.c_void_p]
 las.LASHeader_AddVLR.errcheck = check_return
+las.LASHeader_AddVLR.restype = None
 
 las.LASWriter_Create.restype = ctypes.c_void_p
 las.LASWriter_Create.argtypes = [ctypes.c_char_p, ctypes.c_void_p, ctypes.c_int]
@@ -700,11 +701,11 @@
 las.LASPointFormat_Create.errcheck = check_void
 las.LASPointFormat_Create.restype = ctypes.c_void_p
 
-las.LASPointFormat_GetByteSize.restype = ctypes.c_uint32
+las.LASPointFormat_GetByteSize.restype = ctypes.c_ushort
 las.LASPointFormat_GetByteSize.argtypes = [ctypes.c_void_p]
 las.LASPointFormat_GetByteSize.errcheck = check_value
 las.LASPointFormat_SetByteSize.restype = ctypes.c_int
-las.LASPointFormat_SetByteSize.argtypes = [ctypes.c_void_p, ctypes.c_uint32]
+las.LASPointFormat_SetByteSize.argtypes = [ctypes.c_void_p, ctypes.c_ushort]
 las.LASPointFormat_SetByteSize.errcheck = check_return
 
 las.LASPointFormat_HasColor.restype = ctypes.c_uint8
diff -r 1156369845c1 -r a6eb8704978d python/liblas/header.py
--- a/python/liblas/header.py	Tue Apr 06 14:26:32 2010 -0500
+++ b/python/liblas/header.py	Wed Apr 07 14:51:29 2010 -0500
@@ -76,37 +76,94 @@
     def get_filesignature(self):
         """Returns the file signature for the file.  It should always be LASF"""
         return core.las.LASHeader_GetFileSignature(self.handle)
-    file_signature = property(get_filesignature)
+    doc = """The file signature for the file.  It should always be 'LASF'
+    
+    From the specification_:
+        The file signature must contain the four characters "LASF", and it is
+        required by the LAS specification. These four characters can be
+        checked by user software as a quick look initial determination of file
+        type.
+    """
+    file_signature = property(get_filesignature, None, None, doc)
     
     def get_filesourceid(self):
         return core.las.LASHeader_GetFileSourceId(self.handle)
     
     def set_filesourceid(self, value):
         return core.las.LASHeader_SetFileSourceId(self.handle, value)
-    doc = """"""
+    doc = """File Source ID for the file.  
+    
+    From the specification_:
+        This field should be set to a value between 1 and 65,535, inclusive. A
+        value of zero (0) is interpreted to mean that an ID has not been
+        assigned. In this case, processing software is free to assign any
+        valid number. Note that this scheme allows a LIDAR project to contain
+        up to 65,535 unique sources. A source can be considered an original
+        flight line or it can be the result of merge and/or extract
+        operations.
+    """
     filesource_id = property(get_filesourceid, set_filesourceid, None, doc)
-
+    file_source_id = filesource_id
+    
     def get_global_encoding(self):
         return core.las.LASHeader_GetReserved(self.handle)
     
     def set_global_encoding(self, value):
         return core.las.LASHeader_SetReserved(self.handle, value)
-    doc = """"""
+    doc = """Global encoding for the file.
+    
+    From the specification_:
+    
+        This is a bit field used to indicate certain global properties about
+        the file. In LAS 1.2 (the version in which this field was introduced),
+        only the low bit is defined (this is the bit, that if set, would have
+        the unsigned integer yield a value of 1). This bit field is defined
+        as:
+
+        .. csv-table:: Global Encoding - Bit Field Encoding
+            :header: "Bits", "Field Name", "Description"
+            :widths: 10, 20, 60
+            
+            0, "GPS Time Type", "The meaning of GPS Time in the Point Records 0 (not set) -> GPS time in the point record fields is GPS Week Time (the same as previous versions of LAS) 1 (set) -> GPS Time is standard GPS Time (satellite GPS Time) minus 1 x 10^9 (Adjusted Standard GPS Time). The offset moves the time back to near zero to improve floating point resolution."
+            1, "Waveform Data Packets Internal", "If this bit is set, the waveform data packets are located within this file (note that this bit is mutually exclusive with bit 2)"
+            2, "Waveform Data Packets External", "If this bit is set, the waveform data packets are located external to this file in an auxiliary file with the same base name as this file and the extension \".wdp\".  (note that this bit is mutually exclusive with bit 1)"
+            3, "Return numbers have been synthetically generated", "If set, the point return numbers in the Point Data Records have been synthetically generated. This could be the case, for example, when a composite file is created by combining a First Return File and a Last Return File. In this case, first return data will be labeled \"1 of 2\" and second return data will be labeled \"2 of 2\""
+            4:15, "Reserved", "Must be set to zero"
+    
+    """
     global_encoding= property(get_global_encoding, set_global_encoding, None, doc)
+    encoding = global_encoding
     
     def get_projectid(self):
         """Returns the ProjectID/GUID for the file.  \
         libLAS does not currently support setting this value from Python"""
         return core.las.LASHeader_GetProjectId(self.handle)
-    project_id = property(get_projectid)
+    doc = """ProjectID for the file.  \
+        libLAS does not currently support setting this value from Python, as 
+        it is the same as :obj:`liblas.header.Header.guid`.  Use that to 
+        manipulate the ProjectID for the file.
+        
+        From the specification_:
+            The four fields that comprise a complete Globally Unique Identifier
+            (GUID) are now reserved for use as a Project Identifier (Project
+            ID). The field remains optional. The time of assignment of the
+            Project ID is at the discretion of processing software. The
+            Project ID should be the same for all files that are associated
+            with a unique project. By assigning a Project ID and using a File
+            Source ID (defined above) every file within a project and every
+            point within a file can be uniquely identified, globally.
+            
+        """
+    project_id = property(get_projectid, None, None, doc)
     
     def get_guid(self):
-        """Returns the GUID for the file as a liblas.guid.GUID"""
+        """Returns the GUID for the file as a :class:`liblas.guid.GUID` instance"""
         return guid.GUID(handle=core.las.LASHeader_GetGUID(self.handle))
     def set_guid(self, value):
-        """Sets the GUID for the file.  It must be a liblas.guid.GUID"""


More information about the Liblas-commits mailing list