Mercurial > gemma
comparison pkg/mesh/loader.go @ 5490:5f47eeea988d logging
Use own logging package.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 20 Sep 2021 17:45:39 +0200 |
parents | f4abfd0ee8ad |
children | 1222b777f51f |
comparison
equal
deleted
inserted
replaced
5488:a726a92ea5c9 | 5490:5f47eeea988d |
---|---|
16 import ( | 16 import ( |
17 "bufio" | 17 "bufio" |
18 "bytes" | 18 "bytes" |
19 "compress/gzip" | 19 "compress/gzip" |
20 "encoding/binary" | 20 "encoding/binary" |
21 "log" | 21 |
22 "gemma.intevation.de/gemma/pkg/log" | |
22 ) | 23 ) |
23 | 24 |
24 func (s *STRTree) deserializeIndex(r *bufio.Reader) error { | 25 func (s *STRTree) deserializeIndex(r *bufio.Reader) error { |
25 var numIndex int32 | 26 var numIndex int32 |
26 if err := binary.Read(r, binary.LittleEndian, &numIndex); err != nil { | 27 if err := binary.Read(r, binary.LittleEndian, &numIndex); err != nil { |
102 | 103 |
103 if err := binary.Read(r, binary.LittleEndian, &t.EPSG); err != nil { | 104 if err := binary.Read(r, binary.LittleEndian, &t.EPSG); err != nil { |
104 return err | 105 return err |
105 } | 106 } |
106 | 107 |
107 log.Printf("info: EPSG: %d\n", t.EPSG) | 108 log.Infof("EPSG: %d\n", t.EPSG) |
108 | 109 |
109 if err := t.Min.Read(r); err != nil { | 110 if err := t.Min.Read(r); err != nil { |
110 return err | 111 return err |
111 } | 112 } |
112 | 113 |
113 if err := t.Max.Read(r); err != nil { | 114 if err := t.Max.Read(r); err != nil { |
114 return err | 115 return err |
115 } | 116 } |
116 | 117 |
117 log.Printf("info: BBOX: [[%f, %f, %f], [%f, %f, %f]]\n", | 118 log.Infof("BBOX: [[%f, %f, %f], [%f, %f, %f]]\n", |
118 t.Min.X, t.Min.Y, t.Min.Z, | 119 t.Min.X, t.Min.Y, t.Min.Z, |
119 t.Max.X, t.Max.Y, t.Max.Z) | 120 t.Max.X, t.Max.Y, t.Max.Z) |
120 | 121 |
121 var numVertices uint32 | 122 var numVertices uint32 |
122 if err := binary.Read(r, binary.LittleEndian, &numVertices); err != nil { | 123 if err := binary.Read(r, binary.LittleEndian, &numVertices); err != nil { |
123 return err | 124 return err |
124 } | 125 } |
125 | 126 |
126 log.Printf("info: vertices: %d\n", numVertices) | 127 log.Infof("vertices: %d\n", numVertices) |
127 | 128 |
128 vertices := make([]Vertex, numVertices) | 129 vertices := make([]Vertex, numVertices) |
129 t.Vertices = vertices | 130 t.Vertices = vertices |
130 | 131 |
131 for i := range vertices { | 132 for i := range vertices { |
137 var numTriangles uint32 | 138 var numTriangles uint32 |
138 if err := binary.Read(r, binary.LittleEndian, &numTriangles); err != nil { | 139 if err := binary.Read(r, binary.LittleEndian, &numTriangles); err != nil { |
139 return err | 140 return err |
140 } | 141 } |
141 | 142 |
142 log.Printf("info: triangles: %d\n", numTriangles) | 143 log.Infof("triangles: %d\n", numTriangles) |
143 | 144 |
144 indices := make([]int32, 3*numTriangles) | 145 indices := make([]int32, 3*numTriangles) |
145 triangles := make([][]int32, numTriangles) | 146 triangles := make([][]int32, numTriangles) |
146 t.Triangles = triangles | 147 t.Triangles = triangles |
147 | 148 |