-
Notifications
You must be signed in to change notification settings - Fork 36
/
gnss.go
97 lines (76 loc) · 1.83 KB
/
gnss.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package main
import (
"sort"
"github.com/GeoNet/delta/meta"
)
func (n *Network) Gnss(set *meta.Set, antenna, receiver string) error {
for _, mark := range set.Marks() {
net, ok := set.Network(mark.Network)
if !ok {
continue
}
monument, ok := set.Monument(mark.Code)
if !ok {
continue
}
var receivers []Sensor
for _, r := range set.DeployedReceivers() {
if r.Mark != mark.Code {
continue
}
receivers = append(receivers, Sensor{
Make: r.Make,
Model: r.Model,
Type: receiver,
StartDate: r.Start,
EndDate: r.End,
})
}
sort.Slice(receivers, func(i, j int) bool {
return receivers[i].Less(receivers[j])
})
var antennas []Sensor
for _, a := range set.InstalledAntennas() {
if a.Mark != mark.Code {
continue
}
antennas = append(antennas, Sensor{
Make: a.Make,
Model: a.Model,
Type: antenna,
Vertical: a.Vertical,
North: a.North,
East: a.East,
Azimuth: a.Azimuth,
StartDate: a.Start,
EndDate: a.End,
})
}
sort.Slice(antennas, func(i, j int) bool {
return antennas[i].Less(antennas[j])
})
n.Marks = append(n.Marks, Mark{
Code: mark.Code,
Network: net.External,
Name: mark.Name,
DomesNumber: monument.DomesNumber,
Description: net.Description,
Latitude: mark.Latitude,
Longitude: mark.Longitude,
Elevation: mark.Elevation,
Datum: mark.Datum,
GroundRelationship: monument.GroundRelationship,
MarkType: monument.MarkType,
MonumentType: monument.Type,
FoundationType: monument.FoundationType,
FoundationDepth: monument.FoundationDepth,
Bedrock: monument.Bedrock,
Geology: monument.Geology,
StartDate: mark.Start,
EndDate: mark.End,
Antennas: antennas,
Receivers: receivers,
})
}
return nil
}