geo.go

 1package fake
 2
 3// Latitude generates latitude (from -90.0 to 90.0)
 4func Latitude() float32 {
 5	return r.Float32()*180 - 90
 6}
 7
 8// LatitudeDegrees generates latitude degrees (from -90 to 90)
 9func LatitudeDegrees() int {
10	return r.Intn(180) - 90
11}
12
13// LatitudeMinutes generates latitude minutes (from 0 to 60)
14func LatitudeMinutes() int {
15	return r.Intn(60)
16}
17
18// LatitudeSeconds generates latitude seconds (from 0 to 60)
19func LatitudeSeconds() int {
20	return r.Intn(60)
21}
22
23// LatitudeDirection generates latitude direction (N(orth) o S(outh))
24func LatitudeDirection() string {
25	if r.Intn(2) == 0 {
26		return "N"
27	}
28	return "S"
29}
30
31// Longitude generates longitude (from -180 to 180)
32func Longitude() float32 {
33	return r.Float32()*360 - 180
34}
35
36// LongitudeDegrees generates longitude degrees (from -180 to 180)
37func LongitudeDegrees() int {
38	return r.Intn(360) - 180
39}
40
41// LongitudeMinutes generates (from 0 to 60)
42func LongitudeMinutes() int {
43	return r.Intn(60)
44}
45
46// LongitudeSeconds generates (from 0 to 60)
47func LongitudeSeconds() int {
48	return r.Intn(60)
49}
50
51// LongitudeDirection generates (W(est) or E(ast))
52func LongitudeDirection() string {
53	if r.Intn(2) == 0 {
54		return "W"
55	}
56	return "E"
57}