lidarpal

package
v0.0.0-...-dcaaf6b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoxOverlap

func BoxOverlap(b1, b2 Box) bool

BoxOverlap check box b1 overlaps b2

func CalcLeastSquareCircleFit

func CalcLeastSquareCircleFit(x []float64, y []float64) (float64, float64, float64)

CalcLeastSquareCircleFit computes a least square fit circle for a list of 2d-coordinates. It takes the x and y coordinates as arguments. Obviously the two argument arrays must have the same length. The function returns three values: The x,y location of the circle center and the radius of the circle.

func Combine

func Combine(inputLas *lidario.LasFile, outputLas *Writer, ReaderCount int)

Combine a las to output lasFile

func Crop

func Crop(lasPath []string, radius float64, intensityThreshold uint16, minPoint int, signs []Point, outputRootPath string)

Crop point cloud

func FindPoleCenter

func FindPoleCenter(input string, voxelCellSize float64, minpoint int, queryDist float64) (gx, gy, gz float64, err error)

FindPoleCenter filter out ground, noise to find pole and calculate center point

func GetHeader

func GetHeader(fileName string) (lidario.LasHeader, error)

GetHeader return the header of las file

func GetNumOfPoint

func GetNumOfPoint(fileName string) (int, error)

GetNumOfPoint return the number of point in las

func OpenLasFile

func OpenLasFile(fileName string) (*lidario.LasFile, error)

OpenLasFile open las as read mode

func OpenLasHeader

func OpenLasHeader(fileName string) (*lidario.LasFile, error)

OpenLasHeader open las as read header mode

func PointBuffer

func PointBuffer(p, shift Point, r float64) (Point, Point)

PointBuffer create a square buffer around Point

func PointInBox

func PointInBox(pt lidario.LasPointer, b Box) bool

PointInBox check point in box

func RemoveGround

func RemoveGround(input, outputPath string, voxelCellSize float64, columethreshold int) (err error)

RemoveGround remove ground by using Voxelize method

func SplitbySourceID

func SplitbySourceID(laspath, outputPath string, ReaderCount int)

SplitbySourceID point cloud by sourceID

Types

type Box

type Box struct {
	Max, Min Point
}

Box struct for 3d bounding box

type Point

type Point struct {
	*lidario.PointRecord3

	M float64
	// contains filtered or unexported fields
}

Point struct for 3d point

func NewPoint

func NewPoint(x, y, z float64) *Point

NewPoint create point with xyz

func NewPointWithData

func NewPointWithData(x, y, z, m float64) *Point

NewPointWithData create point with xyz and m

func (*Point) Format

func (p *Point) Format() uint8

Format returns the point format number.

type PointWorker

type PointWorker struct {
	Input   chan lidario.LasPointer
	Process process
	Wg      *sync.WaitGroup
}

PointWorker process Point from input

func NewPointWorker

func NewPointWorker(input chan lidario.LasPointer, process process, Wg *sync.WaitGroup) *PointWorker

NewPointWorker create a new Processor

func (*PointWorker) Run

func (p *PointWorker) Run()

Run start worker

func (*PointWorker) Serve

func (p *PointWorker) Serve()

Serve worker in go routine

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader read Pointcloud

func NewReader

func NewReader(las *lidario.LasFile) *Reader

NewReader Create a new Reader

func (*Reader) CalculatePartSize

func (read *Reader) CalculatePartSize(PartCount int) int

CalculatePartSize return the size of each part for concurent running

func (*Reader) Read

func (read *Reader) Read(input chan<- lidario.LasPointer, from, to int)

Read point into channel

func (*Reader) Serve

func (read *Reader) Serve(input chan<- lidario.LasPointer, from, to int)

Serve read concerrently

type Splitter

type Splitter struct {
	Input  chan lidario.LasPointer
	Output []chan lidario.LasPointer
}

Splitter copy one input point into several output channel

func NewSplitter

func NewSplitter(input chan lidario.LasPointer, numOfOutput int) *Splitter

NewSplitter create splitter with output channel

func (*Splitter) Serve

func (spl *Splitter) Serve()

Serve start Splitter in goroutine stop when input channel is close

type VoxelGrid

type VoxelGrid struct {
	XSize, YSize, ZSize int
	CellSize            float64
	MinX, MinY, MinZ    float64
	Index               [][][][]int // [x][y][z][len]
}

VoxelGrid store point index in Grid

func CreateVoxelGrid

func CreateVoxelGrid(XSize, YSize, ZSize int, MinX, MinY, MinZ float64, CellSize float64) *VoxelGrid

CreateVoxelGrid of x y z

func GenerateVoxel

func GenerateVoxel(las *lidario.LasFile, size float64) *VoxelGrid

GenerateVoxel from Lasfile

func (*VoxelGrid) Filter

func (grid *VoxelGrid) Filter(minPoint int, queryDistance float64)

Filter out outside Point layer by layer using dbscan to find cluster if more than 1 cluster, cluster closest to center in picked if same distance, cluster with more point is pick

func (*VoxelGrid) FindCenterPoint

func (grid *VoxelGrid) FindCenterPoint() (xa, ya, za []float64)

FindCenterPoint return each layer center point

func (*VoxelGrid) IndexToGlobal

func (grid *VoxelGrid) IndexToGlobal(x, y, z float64) (gx, gy, gz float64)

IndexToGlobal calculate global coordinate form index

func (*VoxelGrid) RemoveBottomZVoxel

func (grid *VoxelGrid) RemoveBottomZVoxel()

RemoveBottomZVoxel check for lowest voxel in each xy and remove it

func (*VoxelGrid) RemoveColumeByCount

func (grid *VoxelGrid) RemoveColumeByCount(threshold int)

RemoveColumeByCount check for each xy colume and remove if total point is lower than threshold

func (*VoxelGrid) SaveLas

func (grid *VoxelGrid) SaveLas(path string, oriLas *lidario.LasFile) error

SaveLas save index to las file at path

type Writer

type Writer struct {
	Busy bool
	// contains filtered or unexported fields
}

Writer structer to write point cloud

func NewWriter

func NewWriter(input chan lidario.LasPointer) *Writer

NewWriter Create a writer with channel to write

func (*Writer) Close

func (writer *Writer) Close()

Close writer

func (*Writer) Serve

func (writer *Writer) Serve(las *lidario.LasFile)

Serve writer in background

func (*Writer) Write

func (writer *Writer) Write(p lidario.LasPointer)

Write Point p into buffer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL