>>> from liblas import header >>> import liblas >>> h = header.Header() >>> h.dataformat_id 3 >>> h.scale [1.0, 1.0, 1.0] >>> h.min [0.0, 0.0, 0.0] >>> h.max [0.0, 0.0, 0.0] >>> h.offset [0.0, 0.0, 0.0] >>> h.major_version 1 >>> h.minor_version 2 >>> import datetime >>> td = datetime.timedelta(hours=5) # my timezone is GMT-5 >>> now = datetime.datetime.now() >>> today = datetime.datetime(now.year, now.month,now.day) >>> if now.hour > 19: ... x = h.date - td ... else: ... x = h.date >>> d = datetime.datetime(x.year, x.month, x.day) # >>> import pdb # >>> pdb.set_trace() >>> d == today True >>> t = datetime.datetime(2008,3,19) >>> h.date = t >>> h.date datetime.datetime(2008, 3, 19, 0, 0) >>> h.software_id 'libLAS 1.8.1' >>> h.software_id = 'hobu' >>> h.software_id 'hobu' >>> h.software_id = 'hobu'*9 >>> h.software_id 'hobuhobuhobuhobuhobuhobuhobuhob' >>> h.system_id 'libLAS' >>> h.system_id = 'Python' >>> h.system_id 'Python' >>> h.max = [33452344.2333, 523442.344, -90.993] >>> ["{:.2f}".format(x) for x in h.max] ['33452344.23', '523442.34', '-90.99'] >>> h.min = [33452344.2333, 523442.344, -90.993] >>> ["{:.2f}".format(x) for x in h.min] ['33452344.23', '523442.34', '-90.99'] >>> h.offset = [32, 32, 256] >>> h.offset [32.0, 32.0, 256.0] >>> h.scale = [0.5, 0.5, 0.001] >>> h.scale [0.5, 0.5, 0.001] >>> list(map(int, h.point_return_count)) [0, 0, 0, 0, 0, 0, 0, 0] >>> h.point_return_count = [1341235, 3412341222, 0, 0, 4321, 0, 0, 0] >>> list(map(int, h.point_return_count)) [1341235, 3412341222, 0, 0, 4321, 0, 0, 0] >>> int(h.point_records_count) 0 >>> h.point_records_count = 42 >>> int(h.point_records_count) 42 >>> int(h.records_count) 0 >>> h.header_size 227 >>> def test_srs(): ... s = h.srs ... return s.proj4 == '' >>> test_srs() True >>> int(h.data_offset) 227 >>> h.data_offset = 742 >>> int(h.data_offset) 742 >>> h.data_record_length 34 >>> h.dataformat_id = 0 >>> h.data_record_length 20 ## too fragile ## >>> h.xml ## '\nLASF00000000-0000-0000-0000-000000000000Pythonhobuhobuhobuhobuhobuhobuhobuhob1.200Geotiff_Information:\n Version: 1\n Key_Revision: 1.0\n Tagged_Information:\n End_Of_Tags.\n Keyed_Information:\n End_Of_Keys.\n End_Of_Geotiff.\n78/2008227742042020falseLASzip Version 2.0r0 c2 50000: POINT10 201341235134123412222030443210.50.50.001323225633452344.2333523442.344-90.9929999999999933452344.2333523442.344-90.99299999999999Xx coordinate as a long integer. You must use the scale and offset information of the header to determine the double value.0132111004Yy coordinate as a long integer. You must use the scale and offset information of the header to determine the double value.1132111404Zz coordinate as a long integer. You must use the scale and offset information of the header to determine the double value.2132111804IntensityThe intensity value is the integer representation of the pulse return magnitude. This value is optional and system specific. However, it should always be included if available.31161011202Return NumberReturn Number: The Return Number is the pulse return number for a given output pulse. A given output laser pulse can have many returns, and they must be marked in sequence of return. The first return will have a Return Number of one, the second a Return Number of two, and so on up to five returns.4131011431Number of ReturnsNumber of Returns (for this emitted pulse): The Number of Returns is the total number of returns for a given pulse. For example, a laser data point may be return two (Return Number) within a total number of five returns.5131011461Scan DirectionThe Scan Direction Flag denotes the direction at which the scanner mirror was traveling at the time of the output pulse. A bit value of 1 is a positive scan direction, and a bit value of 0 is a negative scan direction (where positive scan direction is a scan moving from the left side of the in-track direction to the right side and negative the opposite). 6111011471Flightline EdgeThe Edge of Flight Line data bit has a value of 1 only when the point is at the end of a scan. It is the last point on a given scan line before it changes direction.7111011481ClassificationClassification in LAS 1.0 was essentially user defined and optional. LAS 1.1 defines a standard set of ASPRS classifications. In addition, the field is now mandatory. If a point has never been classified, this byte must be set to zero. There are no user defined classes since both point format 0 and point format 1 supply 8 bits per point for user defined operations. Note that the format for classification is a bit encoded field with the lower five bits used for class and the three high bits used for flags.8180011501Scan Angle RankThe Scan Angle Rank is a signed one-byte number with a valid range from -90 to +90. The Scan Angle Rank is the angle (rounded to the nearest integer in the absolute value sense) at which the laser point was output from the laser system including the roll of the aircraft. The scan angle is within 1 degree of accuracy from +90 to -90 degrees. The scan angle is an angle based on 0 degrees being nadir, and -90 degrees to the left side of the aircraft in the direction of flight.9181111601User DataThis field may be used at the user's discretion10180011701Point Source IDThis value indicates the file from which this point originated. Valid values for this field are 1 to 65,535 inclusive with zero being used for a special case discussed below. The numerical value corresponds to the File Source ID from which this point originated. Zero is reserved as a convenience to system implementers. A Point Source ID of zero implies that this point originated in this file. This implies that processing software should set the Point Source ID equal to the File Source ID of the file containing this point at some time during processing. 1111610118021.01.7.0b10'