-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
line_stringms.go
41 lines (33 loc) · 999 Bytes
/
line_stringms.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"
)
// ErrNilLineStringMS is thrown when a LineStringS is nil but shouldn't be
var ErrNilLineStringMS = errors.New("geom: nil LineStringMS")
// ErrInvalidLineStringMS is thrown when a LineStringMS is malformed
var ErrInvalidLineStringMS = errors.New("geom: invalid LineStringMS")
// LineStringMS is a basic line type which is made up of two or more points that don't interacted.
type LineStringMS struct {
Srid uint32
Lsm LineStringM
}
// Vertices returns a slice of referenced XYM values
func (lsms LineStringMS) Vertices() struct {
Srid uint32
Lsm LineStringM
} {
return lsms
}
// SetVertices modifies the struct containing the SRID int and the array of 2D + 1 coordinates
func (lsms *LineStringMS) SetSRID(srid uint32, lsm LineStringM) (err error) {
if lsms == nil {
return ErrNilLineStringMS
}
lsms.Srid = srid
lsms.Lsm = lsm
return
}
// Get the simple 2D + 1 linestring
func (lsms LineStringMS) LineStringM() LineStringM {
return lsms.Lsm
}