-
Notifications
You must be signed in to change notification settings - Fork 22
/
map_node.go
56 lines (48 loc) · 1.49 KB
/
map_node.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
package gedcom
// MapNode pertains to a representation of measurements usually presented in a
// graphical form.
//
// New in Gedcom 5.5.1.
type MapNode struct {
*SimpleNode
}
// NewMapNode creates a new MAP node.
func NewMapNode(value string, children ...Node) *MapNode {
return &MapNode{
newSimpleNode(TagMap, value, "", children...),
}
}
// Latitude is the value specifying the latitudinal coordinate of the place
// name.
//
// The latitude coordinate is the direction North or South from the equator in
// degrees and fraction of degrees carried out to give the desired accuracy.
//
// For example: 18 degrees, 9 minutes, and 3.4 seconds North would be formatted
// as N18.150944.
//
// Minutes and seconds are converted by dividing the minutes value by 60 and the
// seconds value by 3600 and adding the results together. This sum becomes the
// fractional part of the degree’s value.
func (node *MapNode) Latitude() *LatitudeNode {
n := First(NodesWithTag(node, TagLatitude))
if IsNil(n) {
return nil
}
return n.(*LatitudeNode)
}
// Longitude is the value specifying the longitudinal coordinate of the place
// name.
//
// The longitude coordinate is degrees and fraction of degrees east or west of
// the zero or base meridian coordinate.
//
// For example: 168 degrees, 9 minutes, and 3.4 seconds East would be formatted
// as E168.150944.
func (node *MapNode) Longitude() *LongitudeNode {
n := First(NodesWithTag(node, TagLongitude))
if IsNil(n) {
return nil
}
return n.(*LongitudeNode)
}