예제 #1
0
func TestLidarRead(t *testing.T) {
	if testLidarRead {
		inFile := "/Users/johnlindsay/Documents/Data/Half Dome/points.las"
		input, err := lidar.CreateFromFile(inFile)
		if err != nil {
			println(err.Error())
		}
		defer input.Close()

		var buffer bytes.Buffer

		buffer.WriteString(fmt.Sprintf("File Name: %v\n", input.GetFileName()))
		day, month := convertYearday(int(input.Header.FileCreationDay), int(input.Header.FileCreationYear))
		buffer.WriteString(fmt.Sprintf("Creation Date: %v %v, %v\n", day, month, input.Header.FileCreationYear))
		buffer.WriteString(fmt.Sprintf("Generating software: %v\n", input.Header.GeneratingSoftware))
		buffer.WriteString(fmt.Sprintf("LAS version: %v.%v\n", input.Header.VersionMajor, input.Header.VersionMajor))
		buffer.WriteString(fmt.Sprintf("Number of Points: %v\n", input.Header.NumberPoints))
		buffer.WriteString(fmt.Sprintf("Point record length: %v\n", input.Header.PointRecordLength))
		buffer.WriteString(fmt.Sprintf("Point record format: %v\n", input.Header.PointFormatID))

		buffer.WriteString(fmt.Sprintf("Point record format: %v\n", input.Header.String()))

		println(buffer.String())

	} else {
		t.SkipNow()
	}
}
예제 #2
0
func (this *PrintLASInfo) Run() {

	input, err := lidar.CreateFromFile(this.inputFile)
	if err != nil {
		println(err.Error())
	}
	defer input.Close()

	var buffer bytes.Buffer

	buffer.WriteString(fmt.Sprintf("File Name: %v\n", input.GetFileName()))
	day, month := convertYearday(int(input.Header.FileCreationDay), int(input.Header.FileCreationYear))
	buffer.WriteString(fmt.Sprintf("Creation Date: %v %v, %v\n", day, month, input.Header.FileCreationYear))
	buffer.WriteString(fmt.Sprintf("Generating software: %v\n", input.Header.GeneratingSoftware))
	buffer.WriteString(fmt.Sprintf("LAS version: %v.%v\n", input.Header.VersionMajor, input.Header.VersionMajor))
	buffer.WriteString(fmt.Sprintf("Number of Points: %v\n", input.Header.NumberPoints))
	buffer.WriteString(fmt.Sprintf("Point record length: %v\n", input.Header.PointRecordLength))
	buffer.WriteString(fmt.Sprintf("Point record format: %v\n", input.Header.PointFormatID))

	buffer.WriteString(fmt.Sprintf("Point record format: %v\n", input.Header.String()))

	println(buffer.String())
}