forked from go-spatial/geom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmulti_line_stringms.go
36 lines (29 loc) · 912 Bytes
/
multi_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
package geom
import "errors"
// ErrNilMultiLineStringMS is thrown when MultiLineStringMS is nil but shouldn't be
var ErrNilMultiLineStringMS = errors.New("geom: nil MultiLineStringMS")
// MultiLineStringMS is a geometry with multiple LineStringSs.
type MultiLineStringMS struct {
Srid uint32
Mlsm MultiLineStringM
}
// LineStrings returns the coordinates for the linestrings
func (mlsms MultiLineStringMS) MultiLineStringMs() struct {
Srid uint32
Mlsm MultiLineStringM
} {
return mlsms
}
// SetSRID modifies the struct containing the SRID int and the array of 2D+1 coordinates
func (mlsms *MultiLineStringMS) SetSRID(srid uint32, mlsm MultiLineStringM) (err error) {
if mlsms == nil {
return ErrNilMultiLineStringMS
}
mlsms.Srid = srid
mlsms.Mlsm = mlsm
return
}
// Get the simple 2D+1 multiline string
func (mlsms MultiLineStringMS) MultiLineStringM() MultiLineStringM {
return mlsms.Mlsm
}