comparison cmd/octree2contour/store.go @ 726:5af9ab39e715

Renamed a few types to uppercase names to prepare the move to the octree package.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sat, 22 Sep 2018 21:34:12 +0200
parents c0bba602b60e
children 41c8dc61f38f
comparison
equal deleted inserted replaced
725:e0437ec46798 726:5af9ab39e715
3 import ( 3 import (
4 "bytes" 4 "bytes"
5 "database/sql" 5 "database/sql"
6 "encoding/binary" 6 "encoding/binary"
7 "math" 7 "math"
8 )
9
10 type (
11 lineStringZ []vertex
12 multiLineStringZ []lineStringZ
13 ) 8 )
14 9
15 const ( 10 const (
16 wkbNDR byte = 1 11 wkbNDR byte = 1
17 wkbPointZ uint32 = 1000 + 1 12 wkbPointZ uint32 = 1000 + 1
19 wkbMultiLineStringZ uint32 = 1000 + 5 14 wkbMultiLineStringZ uint32 = 1000 + 5
20 ) 15 )
21 16
22 type result struct { 17 type result struct {
23 h float64 18 h float64
24 lines multiLineStringZ 19 lines MultiLineStringZ
25 } 20 }
26 21
27 const insertSQL = ` 22 const insertSQL = `
28 INSERT INTO waterway.contour_lines (height, geom) 23 INSERT INTO waterway.contour_lines (height, geom)
29 VALUES ($1, ST_Transform( 24 VALUES ($1, ST_Transform(
53 48
54 return tx.Commit() 49 return tx.Commit()
55 }) 50 })
56 } 51 }
57 52
58 func (mls multiLineStringZ) asWKB() []byte { 53 func (mls MultiLineStringZ) asWKB() []byte {
59 54
60 var buf bytes.Buffer 55 var buf bytes.Buffer
61 56
62 binary.Write(&buf, binary.LittleEndian, wkbNDR) 57 binary.Write(&buf, binary.LittleEndian, wkbNDR)
63 binary.Write(&buf, binary.LittleEndian, wkbMultiLineStringZ) 58 binary.Write(&buf, binary.LittleEndian, wkbMultiLineStringZ)