-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
line_stringzs.go
41 lines (33 loc) · 991 Bytes
/
line_stringzs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package geom
import (
"errors"
)
// ErrNilLineStringZS is thrown when a LineStringS is nil but shouldn't be
var ErrNilLineStringZS = errors.New("geom: nil LineStringZS")
// ErrInvalidLineStringZS is thrown when a LineStringZS is malformed
var ErrInvalidLineStringZS = errors.New("geom: invalid LineStringZS")
// LineStringZS is a basic line type which is made up of two or more points that don't interacted.
type LineStringZS struct {
Srid uint32
Lsz LineStringZ
}
// Vertices returns a slice of referenced XYM values
func (lszs LineStringZS) Vertices() struct {
Srid uint32
Lsz LineStringZ
} {
return lszs
}
// SetVertices modifies the struct containing the SRID int and the array of 3D coordinates
func (lszs *LineStringZS) SetSRID(srid uint32, lsz LineStringZ) (err error) {
if lszs == nil {
return ErrNilLineStringZS
}
lszs.Srid = srid
lszs.Lsz = lsz
return
}
// Get the simple 3D linestring
func (lszs LineStringZS) LineStringZ() LineStringZ {
return lszs.Lsz
}