diff cmd/tin2octree/tin.go @ 664:a3d722e1f593 octree

octree: Load point cloud data projected in a suited UTM zone.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 18 Sep 2018 13:41:04 +0200
parents af1d4d44a88a
children b0bd242ff821
line wrap: on
line diff
--- a/cmd/tin2octree/tin.go	Tue Sep 18 00:13:51 2018 +0200
+++ b/cmd/tin2octree/tin.go	Tue Sep 18 13:41:04 2018 +0200
@@ -22,7 +22,10 @@
 	wkbTriangleZ uint32 = 1000 + 17
 )
 
+const wgs84 = 4326
+
 type tin struct {
+	epsg      uint32
 	vertices  []vertex
 	triangles [][]int32
 
@@ -155,7 +158,11 @@
 		triangles = append(triangles, triangle)
 	}
 
+	log.Printf("bbox: [[%f, %f], [%f, %f]]\n",
+		min.x, min.y, max.x, max.y)
+
 	*t = tin{
+		epsg:      wgs84,
 		vertices:  vertices,
 		triangles: triangles,
 		min:       min,
@@ -186,6 +193,10 @@
 
 func (t *tin) Serialize(w io.Writer) error {
 
+	if err := binary.Write(w, binary.LittleEndian, t.epsg); err != nil {
+		return err
+	}
+
 	if err := t.min.write(w); err != nil {
 		return err
 	}