Documentation
¶
Index ¶
- Constants
- Variables
- type ClassificationBitField
- func (c *ClassificationBitField) Classification() byte
- func (c *ClassificationBitField) ClassificationString() string
- func (c *ClassificationBitField) Keypoint() bool
- func (c *ClassificationBitField) SetClassification(value uint8)
- func (c *ClassificationBitField) SetKeypoint(val bool)
- func (c *ClassificationBitField) SetSynthetic(val bool)
- func (c *ClassificationBitField) SetWithheld(val bool)
- func (c *ClassificationBitField) Synthetic() bool
- type CoordinateReferenceSystemMethod
- type FRSResultList
- type FRSResultNode
- type FixedRadiusSearchResult
- type GeoKeys
- type GeoTiffTag
- type GeotiffDataType
- type GlobalEncodingField
- func (gef GlobalEncodingField) CoordinateReferenceSystemMethod() CoordinateReferenceSystemMethod
- func (gef GlobalEncodingField) GpsTime() GpsTimeType
- func (gef GlobalEncodingField) ReturnDataSynthetic() bool
- func (gef GlobalEncodingField) String() string
- func (gef GlobalEncodingField) WaveformDataExternal() bool
- func (gef GlobalEncodingField) WaveformDataInternal() bool
- type GpsTimeType
- type IfdEntry
- func (ifd *IfdEntry) AddData(data []byte)
- func (ifd *IfdEntry) InterpretDataAsASCII() (u []string, err error)
- func (ifd *IfdEntry) InterpretDataAsFloat() (u []float64, err error)
- func (ifd *IfdEntry) InterpretDataAsInt() (u []uint, err error)
- func (ifd *IfdEntry) InterpretDataAsRational() (u []float64, err error)
- func (ifd IfdEntry) String() string
- type LasFile
- func (las *LasFile) AddHeader(header LasHeader) error
- func (las *LasFile) AddLasPoint(p LasPointer) error
- func (las *LasFile) AddLasPoints(points []LasPointer) error
- func (las *LasFile) AddVLR(vlr VLR) error
- func (las *LasFile) Close() error
- func (las *LasFile) FixedRadiusSearch2D(x, y float64) *FRSResultList
- func (las *LasFile) FixedRadiusSearch3D(x, y, z float64) *FRSResultList
- func (las *LasFile) GetXYZ(index int) (float64, float64, float64, error)
- func (las *LasFile) LasPoint(index int) (LasPointer, error)
- func (las *LasFile) PrintGeokeys() string
- func (las *LasFile) SetFixedRadiusSearchDistance(radius float64, threeDimensionalSearch bool) error
- type LasHeader
- type LasPointer
- type PointBitField
- type PointRecord0
- func (p *PointRecord0) Format() uint8
- func (p *PointRecord0) GpsTimeData() float64
- func (p *PointRecord0) IsFirstReturn() bool
- func (p *PointRecord0) IsIntermediateReturn() bool
- func (p *PointRecord0) IsLateReturn() bool
- func (p *PointRecord0) PointData() *PointRecord0
- func (p *PointRecord0) RgbData() *RgbData
- type PointRecord1
- type PointRecord2
- type PointRecord3
- type RgbData
- type VLR
Constants ¶
const ( DTByte = 1 DTASCII = 2 DTShort = 3 DTLong = 4 DTRational = 5 DTSbyte = 6 DTUndefined = 7 DTSshort = 8 DTSlong = 9 DTSrational = 10 DTFloat = 11 DTDouble = 12 )
Data types (p. 14-16 of the spec).
const ( PIWhiteIsZero = 0 PIBlackIsZero = 1 PIRGB = 2 PIPaletted = 3 PITransMask = 4 PICMYK = 5 PIYCbCr = 6 PICIELab = 8 )
Photometric interpretation values (see p. 37 of the spec).
const ( SFUnsignedInteger = 1 SFSignedInteger = 2 SFFloatingPoint = 3 SFUknown = 4 )
Sample formats (page 80 of the spec).
const ( // SatelliteGpsTime represents Satellite GPS time SatelliteGpsTime = iota + 1 // GpsWeekTime represents GPS week time GpsWeekTime )
const ( // WellKnownText coordinate system reference method WellKnownText = iota + 1 // GeoTiff coordinate system reference method GeoTiff )
Variables ¶
var NoData = math.Inf(-1)
NoData value used when indexing point outside of allowable range.
Functions ¶
This section is empty.
Types ¶
type ClassificationBitField ¶
type ClassificationBitField struct {
Value byte
}
ClassificationBitField is a point record classification bit field
func (*ClassificationBitField) Classification ¶
func (c *ClassificationBitField) Classification() byte
Classification of LAS point record
func (*ClassificationBitField) ClassificationString ¶
func (c *ClassificationBitField) ClassificationString() string
ClassificationString returns a string represenation of the classiciation type.
func (*ClassificationBitField) Keypoint ¶
func (c *ClassificationBitField) Keypoint() bool
Keypoint returns `true` if the point is a keypoint, `false` otherwise
func (*ClassificationBitField) SetClassification ¶
func (c *ClassificationBitField) SetClassification(value uint8)
SetClassification sets the class value for a LAS point record
func (*ClassificationBitField) SetKeypoint ¶
func (c *ClassificationBitField) SetKeypoint(val bool)
SetKeypoint sets the value of the keypoint field for this point
func (*ClassificationBitField) SetSynthetic ¶
func (c *ClassificationBitField) SetSynthetic(val bool)
SetSynthetic sets the value of synthetic for the point
func (*ClassificationBitField) SetWithheld ¶
func (c *ClassificationBitField) SetWithheld(val bool)
SetWithheld sets the value of the withheld field for this point
func (*ClassificationBitField) Synthetic ¶
func (c *ClassificationBitField) Synthetic() bool
Synthetic returns `true` if the point is synthetic, `false` otherwise
type CoordinateReferenceSystemMethod ¶
type CoordinateReferenceSystemMethod uint
CoordinateReferenceSystemMethod is the type of coordiante reference system used in the file, either Well-Known Text (WKT) or GeoTiff.
func (CoordinateReferenceSystemMethod) String ¶
func (crsm CoordinateReferenceSystemMethod) String() string
type FRSResultList ¶
type FRSResultList struct {
// contains filtered or unexported fields
}
FRSResultList list return from a fixed-radius search
func (*FRSResultList) First ¶
func (l *FRSResultList) First() *FRSResultNode
First returns the head of the list
func (*FRSResultList) Pop ¶
func (l *FRSResultList) Pop() (value FixedRadiusSearchResult, err error)
Pop last item from list
func (*FRSResultList) Push ¶
func (l *FRSResultList) Push(value FixedRadiusSearchResult) *FRSResultList
Push Create new node with value
type FRSResultNode ¶
type FRSResultNode struct { FixedRadiusSearchResult // Embedded struct // contains filtered or unexported fields }
FRSResultNode list node
func (*FRSResultNode) Next ¶
func (n *FRSResultNode) Next() *FRSResultNode
Next returns the next node to the current
func (*FRSResultNode) Prev ¶
func (n *FRSResultNode) Prev() *FRSResultNode
Prev returns the previous node to the current
type FixedRadiusSearchResult ¶
FixedRadiusSearchResult is used to store return values from searches
type GeoKeys ¶
type GeoKeys struct { GeoKeyDirectory []uint16 GeoDoubleParams []float64 GeoASCIIParams string Tags []GeoTiffTag }
GeoKeys structure
type GeoTiffTag ¶
GeoTiffTag data structure
func (GeoTiffTag) String ¶
func (g GeoTiffTag) String() string
type GeotiffDataType ¶
type GeotiffDataType int
GeotiffDataType geoTIFF data type
func (GeotiffDataType) GetBitLength ¶
func (g GeotiffDataType) GetBitLength() uint32
GetBitLength returns the bit length
func (GeotiffDataType) String ¶
func (g GeotiffDataType) String() string
String returns the English name of the DataType ("Byte", "ASCII", ...).
type GlobalEncodingField ¶
type GlobalEncodingField struct {
Value uint16
}
GlobalEncodingField contains the global encoding information in a LAS header
func (GlobalEncodingField) CoordinateReferenceSystemMethod ¶
func (gef GlobalEncodingField) CoordinateReferenceSystemMethod() CoordinateReferenceSystemMethod
CoordinateReferenceSystemMethod returns the co-ordinate reference system method used within the file.
func (GlobalEncodingField) GpsTime ¶
func (gef GlobalEncodingField) GpsTime() GpsTimeType
GpsTime returns the type of time format used in this file
func (GlobalEncodingField) ReturnDataSynthetic ¶
func (gef GlobalEncodingField) ReturnDataSynthetic() bool
ReturnDataSynthetic returns a boolean indicating whether the return numbers have been generated synthetically.
func (GlobalEncodingField) String ¶
func (gef GlobalEncodingField) String() string
func (GlobalEncodingField) WaveformDataExternal ¶
func (gef GlobalEncodingField) WaveformDataExternal() bool
WaveformDataExternal returns a boolean indicating whether waveform packet data is stored internally to the file.
func (GlobalEncodingField) WaveformDataInternal ¶
func (gef GlobalEncodingField) WaveformDataInternal() bool
WaveformDataInternal returns a boolean indicating whether waveform packet data is stored internally to the file.
type GpsTimeType ¶
type GpsTimeType uint
GpsTimeType is a uint describing the type of time format used in in the file to store point GPS time.
func (GpsTimeType) String ¶
func (gtt GpsTimeType) String() string
type IfdEntry ¶
type IfdEntry struct {
// contains filtered or unexported fields
}
IfdEntry IFD entry
func CreateIfdEntry ¶
func CreateIfdEntry(code int, dataType GeotiffDataType, count uint32, data interface{}, byteOrder binary.ByteOrder) IfdEntry
CreateIfdEntry returns a new IFD entry
func (*IfdEntry) InterpretDataAsASCII ¶
InterpretDataAsASCII decodes the IFD entry in p, which must be of the ASCII type, and returns the decoded uint values.
func (*IfdEntry) InterpretDataAsFloat ¶
InterpretDataAsFloat interprets the data as a float
func (*IfdEntry) InterpretDataAsInt ¶
InterpretDataAsInt interprets the data as an integer
func (*IfdEntry) InterpretDataAsRational ¶
InterpretDataAsRational interprets the data as a rational number
type LasFile ¶
type LasFile struct { Header LasHeader VlrData []VLR sync.RWMutex // contains filtered or unexported fields }
LasFile is a structure for manipulating LAS files.
func InitializeUsingFile ¶
InitializeUsingFile initializes a new LAS file based on another existing file. The function transfers values from the header and the VLRs to the new file.
func NewLasFile ¶
NewLasFile creates a new LasFile structure.
func (*LasFile) AddHeader ¶
AddHeader adds a header to a LasFile created in 'w' (write) mode. The method is thread-safe.
func (*LasFile) AddLasPoint ¶
func (las *LasFile) AddLasPoint(p LasPointer) error
AddLasPoint adds a point record to a Las file created in 'w' (write) mode. The method is thread-safe.
func (*LasFile) AddLasPoints ¶
func (las *LasFile) AddLasPoints(points []LasPointer) error
AddLasPoints adds a slice of point record to a Las file created in 'w' (write) mode. The method is thread-safe.
func (*LasFile) AddVLR ¶
AddVLR adds a variable length record (VLR) to a LAS file created in 'w' (write) mode. The method is thread-safe.
func (*LasFile) FixedRadiusSearch2D ¶
func (las *LasFile) FixedRadiusSearch2D(x, y float64) *FRSResultList
FixedRadiusSearch2D performs a 2D fixed radius search
func (*LasFile) FixedRadiusSearch3D ¶
func (las *LasFile) FixedRadiusSearch3D(x, y, z float64) *FRSResultList
FixedRadiusSearch3D performs a 3D fixed radius search
func (*LasFile) LasPoint ¶
func (las *LasFile) LasPoint(index int) (LasPointer, error)
LasPoint returns a LAS point.
func (*LasFile) PrintGeokeys ¶
PrintGeokeys interprets the Geokeys, if there are any.
type LasHeader ¶
type LasHeader struct { FileSignature string FileSourceID int GlobalEncoding GlobalEncodingField ProjectID1 int ProjectID2 int ProjectID3 int ProjectID4 [8]byte VersionMajor byte VersionMinor byte SystemID string // 32 characters GeneratingSoftware string // 32 characters FileCreationDay int FileCreationYear int HeaderSize int OffsetToPoints int NumberOfVLRs int PointFormatID byte PointRecordLength int NumberPoints int NumberPointsByReturn [5]int XScaleFactor float64 YScaleFactor float64 ZScaleFactor float64 XOffset float64 YOffset float64 ZOffset float64 MaxX float64 MinX float64 MaxY float64 MinY float64 MaxZ float64 MinZ float64 WaveformDataStart uint64 // contains filtered or unexported fields }
LasHeader is a LAS file header structure.
type LasPointer ¶
type LasPointer interface { Format() uint8 PointData() *PointRecord0 IsLateReturn() bool IsFirstReturn() bool IsIntermediateReturn() bool GpsTimeData() float64 RgbData() *RgbData }
LasPointer interface for all point record types
type PointBitField ¶
type PointBitField struct {
Value byte
}
PointBitField is a point record bit field
func (*PointBitField) EdgeOfFlightlineFlag ¶
func (p *PointBitField) EdgeOfFlightlineFlag() bool
EdgeOfFlightlineFlag Edge of flightline flag
func (*PointBitField) NumberOfReturns ¶
func (p *PointBitField) NumberOfReturns() byte
NumberOfReturns returns the number of returns of the point
func (*PointBitField) ReturnNumber ¶
func (p *PointBitField) ReturnNumber() byte
ReturnNumber returns the return number of the point
func (*PointBitField) ScanDirectionFlag ¶
func (p *PointBitField) ScanDirectionFlag() bool
ScanDirectionFlag scan direction flag, `true` if moving from the left side of the in-track direction to the right side and false the opposite.
type PointRecord0 ¶
type PointRecord0 struct { X float64 Y float64 Z float64 Intensity uint16 BitField PointBitField ClassBitField ClassificationBitField ScanAngle int8 UserData uint8 PointSourceID uint16 }
PointRecord0 is a LAS point record type 0.
func (*PointRecord0) Format ¶
func (p *PointRecord0) Format() uint8
Format returns the point format number.
func (*PointRecord0) GpsTimeData ¶
func (p *PointRecord0) GpsTimeData() float64
GpsTimeData returns the GPS time data for the LAS point.
func (*PointRecord0) IsFirstReturn ¶
func (p *PointRecord0) IsFirstReturn() bool
IsFirstReturn returns true if the point is a first return.
func (*PointRecord0) IsIntermediateReturn ¶
func (p *PointRecord0) IsIntermediateReturn() bool
IsIntermediateReturn returns true if the point is an intermediate return.
func (*PointRecord0) IsLateReturn ¶
func (p *PointRecord0) IsLateReturn() bool
IsLateReturn returns true if the point is a last return.
func (*PointRecord0) PointData ¶
func (p *PointRecord0) PointData() *PointRecord0
PointData returns the point data (PointRecord0) for the LAS point.
func (*PointRecord0) RgbData ¶
func (p *PointRecord0) RgbData() *RgbData
RgbData returns the RGB colour data for the LAS point.
type PointRecord1 ¶
type PointRecord1 struct { *PointRecord0 GPSTime float64 }
PointRecord1 is a LAS point record type 1
func (*PointRecord1) Format ¶
func (p *PointRecord1) Format() uint8
Format returns the point format number.
func (*PointRecord1) GpsTimeData ¶
func (p *PointRecord1) GpsTimeData() float64
GpsTimeData returns the point data (PointRecord0) for the LAS point.
func (*PointRecord1) RgbData ¶
func (p *PointRecord1) RgbData() *RgbData
RgbData returns the RGB colour data for the LAS point.
type PointRecord2 ¶
type PointRecord2 struct { *PointRecord0 RGB *RgbData }
PointRecord2 is a LAS point record type 2
func (*PointRecord2) Format ¶
func (p *PointRecord2) Format() uint8
Format returns the point format number.
func (*PointRecord2) GpsTimeData ¶
func (p *PointRecord2) GpsTimeData() float64
GpsTimeData returns the point data (PointRecord0) for the LAS point.
func (*PointRecord2) RgbData ¶
func (p *PointRecord2) RgbData() *RgbData
RgbData returns the RGB colour data for the LAS point.
type PointRecord3 ¶
type PointRecord3 struct { *PointRecord0 GPSTime float64 RGB *RgbData }
PointRecord3 is a LAS point record type 3
func (*PointRecord3) Format ¶
func (p *PointRecord3) Format() uint8
Format returns the point format number.
func (*PointRecord3) GpsTimeData ¶
func (p *PointRecord3) GpsTimeData() float64
GpsTimeData returns the point data (PointRecord0) for the LAS point.
func (*PointRecord3) RgbData ¶
func (p *PointRecord3) RgbData() *RgbData
RgbData returns the RGB colour data for the LAS point.