github.com/cellofellow/gopkg@v0.0.0-20140722061823-eec0544a62ad/shape/las/type.go (about)

     1  // Copyright 2014 <chaishushan{AT}gmail.com>. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package las
     6  
     7  /*
     8  Las Header
     9  
    10  	Change list:
    11  	+--------------------+-----------------------+-------------------------+
    12  	|       1.0          |       1.1             |          1.2            |
    13  	+--------------------+-----------------------+-------------------------+
    14  	|        ........    |        ........       |        ........         |
    15  	| uint32 reserved    | uint16 file_source_id | uint16 file_source_id   |
    16  	|        --------    |                       |                         |
    17  	|        --------    | uint16 reserved       | uint16 global_encoding  |
    18  	|        --------    |        --------       |                         |
    19  	|        ........    |        ........       |        ........         |
    20  	| uint16 julian_date | uint16 day_of_year    | uint16 day_of_year      |
    21  	|        ........    |        ........       |        ........         |
    22  	+--------------------+-----------------------+-------------------------+
    23  */
    24  type Header struct {
    25  	FileSignature                 [4]byte // LASF
    26  	FileSourceId                  uint16
    27  	GlobalEncoding                uint16
    28  	GuidData1                     uint32
    29  	GuidData2                     uint16
    30  	GuidData3                     uint16
    31  	GuidData4                     [8]uint8
    32  	MajorVersion                  int8
    33  	MinorVersion                  int8
    34  	SystemIdentifier              [32]byte
    35  	GeneratingSoftware            [32]byte
    36  	FileCreationDay               uint16
    37  	FileCreationYear              uint16
    38  	HeaderSize                    uint16
    39  	OffsetToPointData             uint32
    40  	NumberOfVariableLengthRecords uint32
    41  	PointDataFormatId             uint8
    42  	PointDataRecordLen            uint16
    43  	NumberOfPointRecords          uint32
    44  	NumberOfPointsByReturn        [5]uint32
    45  	XScaleFactor                  float64
    46  	YScaleFactor                  float64
    47  	ZScaleFactor                  float64
    48  	XOffset                       float64
    49  	YOffset                       float64
    50  	ZOffset                       float64
    51  	MaxX                          float64
    52  	MinX                          float64
    53  	MaxY                          float64
    54  	MinY                          float64
    55  	MaxZ                          float64
    56  	MinZ                          float64
    57  }
    58  
    59  // Las Header V14
    60  type HeaderV14 struct {
    61  	Header
    62  	OffsetWaveform uint64
    63  }
    64  
    65  type VLRRecordIdType uint16
    66  
    67  const (
    68  	VLRRecordId_ClassificationLookup VLRRecordIdType = 0
    69  	VLRRecordId_FlightLineLookup     VLRRecordIdType = 1
    70  	VLRRecordId_Histogram            VLRRecordIdType = 2
    71  	VLRRecordId_TextAreaDesc         VLRRecordIdType = 3
    72  	VLRRecordId_GeoKeyDirectory      VLRRecordIdType = 34735
    73  	VLRRecordId_GeoDoubleParam       VLRRecordIdType = 34735
    74  	VLRRecordId_GeoAsciiParam        VLRRecordIdType = 34737
    75  )
    76  
    77  type VLR struct {
    78  	Reserved                uint16
    79  	UserId                  [16]int8
    80  	RecordId                uint16
    81  	RecordLengthAfterHeader uint16
    82  	Description             [32]byte
    83  	Data                    []byte
    84  }
    85  
    86  type VLR_GeoKeysEntry struct {
    87  	KeyId           uint16
    88  	TiffTagLocation uint16
    89  	Count           uint16
    90  	ValueOffset     uint16
    91  }
    92  
    93  type Point struct {
    94  	X, Y, Z       float64
    95  	Intensity     uint16
    96  	BitFields     uint16
    97  	ScanAngleRank int8
    98  	UserData      uint8
    99  	PointSourceId uint16
   100  }