-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.txt
100 lines (79 loc) · 2.4 KB
/
notes.txt
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
98
99
https://github.com/oneclick/rubyinstaller/wiki/development-kit
get DevKit-tdm-32-4.5.1-20101202-1039-sfx.exe
gem install ruby-debug
gem install cheat
http://cheat.errtheblog.com/s/rdebug/
Just to make the definition complete, in the Cartesian coordinate system:
* the x-axis goes through long,lat (0,0), so longitude 0 meets the equator;
* the y-axis goes through (0,90);
* and the z-axis goes through the poles.
The conversion is:
x = R * cos(lat) * cos(lon)
y = R * cos(lat) * sin(lon)
z = R *sin(lat)
The formula for back conversion:
lat = asin(z / R)
lon = atan2(y, x)
http://rails.nomad-labs.com/?p=15
"#{p[0]},#{p[1]}"
@ps.each{ |p|
"HELLO"
}
Widget.import columns, values, :on_duplicate_key_update => [:price]
http://www.slideshare.net/sabman/rails-gis-hacks-presentation-170907
for p in @ps
xml.Point {
xml.coordinates("#{@p[0]}, #{@p[1]}");
}
}
xml.Point {
xml.coordinates("#{@centre[0]}, #{@centre[1]}");
text = "
Centre Lng: #{@centre[0]}
Centre Lat: #{@centre[1]}
X Min: #{@bbox[0]}
Y Min: #{@bbox[1]}
X Max: #{@bbox[2]}
Y Max: #{@bbox[3]}
"
xml.instruct! :xml
xml.kml(:xmlns => "http://earth.google.com/kml/2.2") do
xml.Document {
xml.Placemark {
xml.Snippet(:maxLines => "9") {
xml.cdata!(text)
}
xml.name("cross-hair")
xml.Style {
xml.LabelStyle {
xml.scale(0)
}
xml.IconStyle {
xml.color("ffefebde")
xml.Icon {
xml.href("root://icons/palette-3.png")
xml.x(128)
xml.y(32)
xml.w(32)
xml.h(32)
}
}
}
@ps.each do |p|
xml.Point
xml.coordinates("#{p[0]},#{p[1]},0")
end
}
}
end
xml.text! "1,2,3\n"
xml.coordinates(
@ps.each{ |p|
"#{p.inspect}"
}
)
}
"#{p[:lat]},#{p[:lon]},#{p[:alt]}\n"
# xml.href("#{server}/route/#{igcf.filename}")
When a call is made from the client (Google Earth) to the server, the server must (1) return a response code of HTTP 200 and (2) set the response's content type to text/plain or application/vnd.google-earth.kml+xml.
xml.text! "#{(o[:rlat]/RAD_PER_DEG).to_s},#{(o[:rlon]/RAD_PER_DEG).to_s},#{(o[:baro_alt]/RAD_PER_DEG).to_s} "