diff pkg/octree/builder.go @ 973:b6fec8f85599

Generate TINs and octrees in sounding result importer.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 18 Oct 2018 13:09:49 +0200
parents a4fe07a21ba7
children 7a89313f0ead
line wrap: on
line diff
--- a/pkg/octree/builder.go	Thu Oct 18 12:22:08 2018 +0200
+++ b/pkg/octree/builder.go	Thu Oct 18 13:09:49 2018 +0200
@@ -1,6 +1,7 @@
 package octree
 
 import (
+	"bytes"
 	"encoding/binary"
 	"io"
 	"log"
@@ -169,3 +170,11 @@
 	}
 	return out.Flush()
 }
+
+func (tb *Builder) Bytes() ([]byte, error) {
+	var buf bytes.Buffer
+	if err := tb.WriteTo(&buf); err != nil {
+		return nil, err
+	}
+	return buf.Bytes(), nil
+}