jpmobile 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. data/README +41 -4
  2. data/Rakefile +11 -9
  3. data/lib/jpmobile.rb +0 -6
  4. data/lib/jpmobile/emoticon.rb +105 -0
  5. data/lib/jpmobile/emoticon/au.rb +644 -0
  6. data/lib/jpmobile/emoticon/conversion_table.rb +3908 -0
  7. data/lib/jpmobile/emoticon/docomo.rb +255 -0
  8. data/lib/jpmobile/emoticon/softbank.rb +477 -0
  9. data/lib/jpmobile/emoticon/z_combine.rb +20 -0
  10. data/lib/jpmobile/filter.rb +73 -51
  11. data/lib/jpmobile/helpers.rb +4 -4
  12. data/lib/jpmobile/hook_abstract_request.rb +6 -2
  13. data/lib/jpmobile/hook_action_controller.rb +10 -0
  14. data/lib/jpmobile/hook_action_view.rb +7 -0
  15. data/lib/jpmobile/mobile/abstract_mobile.rb +5 -1
  16. data/lib/jpmobile/mobile/au.rb +1 -1
  17. data/lib/jpmobile/mobile/docomo.rb +2 -5
  18. data/lib/jpmobile/mobile/softbank.rb +9 -1
  19. data/lib/jpmobile/mobile/z_display_info_docomo.rb +32 -10
  20. data/lib/jpmobile/mobile/z_ip_addresses.rb +6 -6
  21. data/lib/jpmobile/mobile/z_ip_addresses_au.rb +2 -1
  22. data/lib/jpmobile/mobile/z_ip_addresses_willcom.rb +6 -1
  23. data/lib/jpmobile/trans_sid.rb +5 -2
  24. data/lib/jpmobile/version.rb +1 -1
  25. data/test/au_test.rb +1 -0
  26. data/test/docomo_test.rb +8 -0
  27. data/test/emoticon_functional_test.rb +166 -0
  28. data/test/emoticon_test.rb +58 -0
  29. data/test/filter_functional_test.rb +146 -0
  30. data/test/filter_test.rb +8 -8
  31. data/test/softbank_test.rb +18 -0
  32. data/tools/generate_au_emoticon_table.rb +25 -0
  33. data/tools/{update_emoji_docomo.rb → generate_docomo_emoticon_table.rb} +4 -8
  34. data/tools/generate_emoticon_conversion_table.rb +107 -0
  35. data/tools/generate_softbank_emoticon_table.rb +32 -0
  36. data/tools/update_display_info_docomo.rb +3 -5
  37. metadata +18 -75
  38. data/NOTES +0 -21
  39. data/TODO +0 -16
  40. data/doc/classes/ActionController.html +0 -107
  41. data/doc/classes/ActionController/AbstractRequest.html +0 -216
  42. data/doc/classes/ActionView.html +0 -101
  43. data/doc/classes/DatumConv.html +0 -324
  44. data/doc/classes/Jpmobile/Display.html +0 -333
  45. data/doc/classes/Jpmobile/Filter.html +0 -119
  46. data/doc/classes/Jpmobile/Filter/Base.html +0 -269
  47. data/doc/classes/Jpmobile/Filter/Emoji.html +0 -130
  48. data/doc/classes/Jpmobile/Filter/Emoji/Inner.html +0 -183
  49. data/doc/classes/Jpmobile/Filter/Emoji/Outer.html +0 -187
  50. data/doc/classes/Jpmobile/Filter/FilterTable.html +0 -178
  51. data/doc/classes/Jpmobile/Filter/HankakuKana.html +0 -170
  52. data/doc/classes/Jpmobile/Filter/Sjis.html +0 -244
  53. data/doc/classes/Jpmobile/Helpers.html +0 -558
  54. data/doc/classes/Jpmobile/Mobile.html +0 -141
  55. data/doc/classes/Jpmobile/Mobile/AbstractMobile.html +0 -324
  56. data/doc/classes/Jpmobile/Mobile/Au.html +0 -415
  57. data/doc/classes/Jpmobile/Mobile/Ddipocket.html +0 -138
  58. data/doc/classes/Jpmobile/Mobile/Docomo.html +0 -366
  59. data/doc/classes/Jpmobile/Mobile/Jphone.html +0 -212
  60. data/doc/classes/Jpmobile/Mobile/Softbank.html +0 -300
  61. data/doc/classes/Jpmobile/Mobile/Vodafone.html +0 -176
  62. data/doc/classes/Jpmobile/Mobile/Willcom.html +0 -210
  63. data/doc/classes/Jpmobile/Position.html +0 -384
  64. data/doc/created.rid +0 -1
  65. data/doc/files/CHANGELOG.html +0 -110
  66. data/doc/files/NOTES.html +0 -163
  67. data/doc/files/README.html +0 -345
  68. data/doc/files/TODO.html +0 -138
  69. data/doc/files/lib/jpmobile/datum_conv_rb.html +0 -110
  70. data/doc/files/lib/jpmobile/filter_rb.html +0 -115
  71. data/doc/files/lib/jpmobile/helpers_rb.html +0 -105
  72. data/doc/files/lib/jpmobile/hook_abstract_request_rb.html +0 -109
  73. data/doc/files/lib/jpmobile/hook_action_view_rb.html +0 -119
  74. data/doc/files/lib/jpmobile/mobile/abstract_mobile_rb.html +0 -108
  75. data/doc/files/lib/jpmobile/mobile/au_rb.html +0 -112
  76. data/doc/files/lib/jpmobile/mobile/display_rb.html +0 -111
  77. data/doc/files/lib/jpmobile/mobile/docomo_rb.html +0 -105
  78. data/doc/files/lib/jpmobile/mobile/softbank_rb.html +0 -115
  79. data/doc/files/lib/jpmobile/mobile/willcom_rb.html +0 -108
  80. data/doc/files/lib/jpmobile/mobile/z_display_info_docomo_rb.html +0 -114
  81. data/doc/files/lib/jpmobile/mobile/z_emoji_docomo_rb.html +0 -119
  82. data/doc/files/lib/jpmobile/mobile/z_ip_addresses_au_rb.html +0 -114
  83. data/doc/files/lib/jpmobile/mobile/z_ip_addresses_rb.html +0 -117
  84. data/doc/files/lib/jpmobile/mobile/z_ip_addresses_willcom_rb.html +0 -114
  85. data/doc/files/lib/jpmobile/position_rb.html +0 -105
  86. data/doc/files/lib/jpmobile/trans_sid_rb.html +0 -114
  87. data/doc/files/lib/jpmobile/version_rb.html +0 -101
  88. data/doc/files/lib/jpmobile_rb.html +0 -101
  89. data/doc/fr_class_index.html +0 -50
  90. data/doc/fr_file_index.html +0 -50
  91. data/doc/fr_method_index.html +0 -113
  92. data/doc/index.html +0 -24
  93. data/doc/rdoc-style.css +0 -208
  94. data/lib/jpmobile/mobile/z_emoji_docomo.rb +0 -508
  95. data/test/firefox_test.rb +0 -8
  96. data/test/transitsid_test.rb +0 -86
data/TODO DELETED
@@ -1,16 +0,0 @@
1
- = TODO
2
-
3
- == 設計
4
- * 位置情報のparseに失敗したとき例外を上げていいのか
5
- * A キャリア判別のショートカット的なメソッドは必要かも
6
- * A 使い勝手を向上させるための検討
7
-
8
- == 全般
9
- * A Position#optionsをテストするコード
10
- * B View振分けのテストコード(書けるかな)
11
- * B get_position_link_toのテストが汚い
12
-
13
- == 位置情報取得未実装
14
- * C Vodafone3Gのwgs84以外(仕様書によるとitrf,tokyoが返りうるらしい)
15
-
16
- == ドキュメントの整備
@@ -1,107 +0,0 @@
1
- <?xml version="1.0" encoding=" UTF-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Module: ActionController</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset= UTF-8" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Module</strong></td>
53
- <td class="class-name-in-header">ActionController</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- </td>
59
- </tr>
60
-
61
- </table>
62
- </div>
63
- <!-- banner header -->
64
-
65
- <div id="bodyContent">
66
-
67
-
68
-
69
- <div id="contextContent">
70
-
71
-
72
-
73
- </div>
74
-
75
-
76
- </div>
77
-
78
-
79
- <!-- if includes -->
80
-
81
- <div id="section">
82
-
83
- <div id="class-list">
84
- <h3 class="section-bar">Classes and Modules</h3>
85
-
86
- Class <a href="ActionController/AbstractRequest.html" class="link">ActionController::AbstractRequest</a><br />
87
-
88
- </div>
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
- <!-- if method_list -->
97
-
98
-
99
- </div>
100
-
101
-
102
- <div id="validator-badges">
103
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
104
- </div>
105
-
106
- </body>
107
- </html>
@@ -1,216 +0,0 @@
1
- <?xml version="1.0" encoding=" UTF-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Class: ActionController::AbstractRequest</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset= UTF-8" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">ActionController::AbstractRequest</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/jpmobile/hook_abstract_request_rb.html">
59
- lib/jpmobile/hook_abstract_request.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- Object
69
- </td>
70
- </tr>
71
- </table>
72
- </div>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
-
77
-
78
-
79
- <div id="contextContent">
80
-
81
- <div id="description">
82
- <p>
83
- <a href="AbstractRequest.html">ActionController::AbstractRequest</a>
84
- を拡張して jpmobile の各機能を提供する。
85
- </p>
86
-
87
- </div>
88
-
89
-
90
- </div>
91
-
92
- <div id="method-list">
93
- <h3 class="section-bar">Methods</h3>
94
-
95
- <div class="name-list">
96
- <a href="#M000003">mobile</a>&nbsp;&nbsp;
97
- <a href="#M000002">mobile?</a>&nbsp;&nbsp;
98
- <a href="#M000001">user_agent</a>&nbsp;&nbsp;
99
- </div>
100
- </div>
101
-
102
- </div>
103
-
104
-
105
- <!-- if includes -->
106
-
107
- <div id="section">
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
- <!-- if method_list -->
117
- <div id="methods">
118
- <h3 class="section-bar">Public Instance methods</h3>
119
-
120
- <div id="method-M000003" class="method-detail">
121
- <a name="M000003"></a>
122
-
123
- <div class="method-heading">
124
- <a href="#M000003" class="method-signature">
125
- <span class="method-name">mobile</span><span class="method-args">()</span>
126
- </a>
127
- </div>
128
-
129
- <div class="method-description">
130
- <p>
131
- 携帯電話の機種に応じて Mobile::xxx を返す。
132
- 携帯電話でない場合はnilを返す。
133
- </p>
134
- <p><a class="source-toggle" href="#"
135
- onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
136
- <div class="method-source-code" id="M000003-source">
137
- <pre>
138
- <span class="ruby-comment cmt"># File lib/jpmobile/hook_abstract_request.rb, line 15</span>
139
- 15: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mobile</span>
140
- 16: <span class="ruby-constant">Jpmobile</span><span class="ruby-operator">::</span><span class="ruby-constant">Mobile</span>.<span class="ruby-identifier">constants</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">const</span><span class="ruby-operator">|</span>
141
- 17: <span class="ruby-identifier">c</span> = <span class="ruby-constant">Jpmobile</span><span class="ruby-operator">::</span><span class="ruby-constant">Mobile</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">const</span>)
142
- 18: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">c</span><span class="ruby-operator">::</span><span class="ruby-constant">USER_AGENT_REGEXP</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">user_agent</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">c</span><span class="ruby-operator">::</span><span class="ruby-constant">USER_AGENT_REGEXP</span>
143
- 19: <span class="ruby-keyword kw">end</span>
144
- 20: <span class="ruby-keyword kw">nil</span>
145
- 21: <span class="ruby-keyword kw">end</span>
146
- </pre>
147
- </div>
148
- </div>
149
- </div>
150
-
151
- <div id="method-M000002" class="method-detail">
152
- <a name="M000002"></a>
153
-
154
- <div class="method-heading">
155
- <a href="#M000002" class="method-signature">
156
- <span class="method-name">mobile?</span><span class="method-args">()</span>
157
- </a>
158
- </div>
159
-
160
- <div class="method-description">
161
- <p>
162
- 携帯電話からであれば <tt>true</tt>を、そうでなければ
163
- <tt>false</tt> を返す。
164
- </p>
165
- <p><a class="source-toggle" href="#"
166
- onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
167
- <div class="method-source-code" id="M000002-source">
168
- <pre>
169
- <span class="ruby-comment cmt"># File lib/jpmobile/hook_abstract_request.rb, line 9</span>
170
- 9: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mobile?</span>
171
- 10: <span class="ruby-identifier">mobile</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
172
- 11: <span class="ruby-keyword kw">end</span>
173
- </pre>
174
- </div>
175
- </div>
176
- </div>
177
-
178
- <div id="method-M000001" class="method-detail">
179
- <a name="M000001"></a>
180
-
181
- <div class="method-heading">
182
- <a href="#M000001" class="method-signature">
183
- <span class="method-name">user_agent</span><span class="method-args">()</span>
184
- </a>
185
- </div>
186
-
187
- <div class="method-description">
188
- <p>
189
- 環境変数 HTTP_USER_AGENT を返す。
190
- </p>
191
- <p><a class="source-toggle" href="#"
192
- onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
193
- <div class="method-source-code" id="M000001-source">
194
- <pre>
195
- <span class="ruby-comment cmt"># File lib/jpmobile/hook_abstract_request.rb, line 4</span>
196
- 4: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">user_agent</span>
197
- 5: <span class="ruby-identifier">env</span>[<span class="ruby-value str">'HTTP_USER_AGENT'</span>]
198
- 6: <span class="ruby-keyword kw">end</span>
199
- </pre>
200
- </div>
201
- </div>
202
- </div>
203
-
204
-
205
- </div>
206
-
207
-
208
- </div>
209
-
210
-
211
- <div id="validator-badges">
212
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
213
- </div>
214
-
215
- </body>
216
- </html>
@@ -1,101 +0,0 @@
1
- <?xml version="1.0" encoding=" UTF-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Module: ActionView</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset= UTF-8" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Module</strong></td>
53
- <td class="class-name-in-header">ActionView</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- </td>
59
- </tr>
60
-
61
- </table>
62
- </div>
63
- <!-- banner header -->
64
-
65
- <div id="bodyContent">
66
-
67
-
68
-
69
- <div id="contextContent">
70
-
71
-
72
-
73
- </div>
74
-
75
-
76
- </div>
77
-
78
-
79
- <!-- if includes -->
80
-
81
- <div id="section">
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
- <!-- if method_list -->
91
-
92
-
93
- </div>
94
-
95
-
96
- <div id="validator-badges">
97
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
98
- </div>
99
-
100
- </body>
101
- </html>
@@ -1,324 +0,0 @@
1
- <?xml version="1.0" encoding=" UTF-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Module: DatumConv</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset= UTF-8" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Module</strong></td>
53
- <td class="class-name-in-header">DatumConv</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../files/lib/jpmobile/datum_conv_rb.html">
59
- lib/jpmobile/datum_conv.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- </table>
66
- </div>
67
- <!-- banner header -->
68
-
69
- <div id="bodyContent">
70
-
71
-
72
-
73
- <div id="contextContent">
74
-
75
- <div id="description">
76
- <h1>測地系変換モジュール</h1>
77
- <p>
78
- 参考文献: 飛田幹男,
79
- 世界測地系と座標変換&#8212;21世紀の測量士・位置情報ユーザ・プログラマーのために,
80
- 日本測量協会, 2002.
81
- </p>
82
-
83
- </div>
84
-
85
-
86
- </div>
87
-
88
- <div id="method-list">
89
- <h3 class="section-bar">Methods</h3>
90
-
91
- <div class="name-list">
92
- <a href="#M000083">blh2xyz</a>&nbsp;&nbsp;
93
- <a href="#M000087">jgd2tky</a>&nbsp;&nbsp;
94
- <a href="#M000086">tky2jgd</a>&nbsp;&nbsp;
95
- <a href="#M000084">xyz2blh</a>&nbsp;&nbsp;
96
- <a href="#M000085">xyz2xyz</a>&nbsp;&nbsp;
97
- </div>
98
- </div>
99
-
100
- </div>
101
-
102
-
103
- <!-- if includes -->
104
-
105
- <div id="section">
106
-
107
-
108
- <div id="constants-list">
109
- <h3 class="section-bar">Constants</h3>
110
-
111
- <div class="name-list">
112
- <table summary="Constants">
113
- <tr class="top-aligned-row context-row">
114
- <td class="context-item-name">GRS80</td>
115
- <td>=</td>
116
- <td class="context-item-value">[ 6378137, 298.257222101]</td>
117
- </tr>
118
- <tr class="top-aligned-row context-row">
119
- <td class="context-item-name">Bessel</td>
120
- <td>=</td>
121
- <td class="context-item-value">[6377397.155, 299.152813]</td>
122
- </tr>
123
- <tr class="top-aligned-row context-row">
124
- <td class="context-item-name">Tokyo97toITRF94</td>
125
- <td>=</td>
126
- <td class="context-item-value">[-146.414, 507.337, 680.507]</td>
127
- </tr>
128
- <tr class="top-aligned-row context-row">
129
- <td class="context-item-name">ITRF94toTokyo97</td>
130
- <td>=</td>
131
- <td class="context-item-value">[ 146.414,-507.337,-680.507]</td>
132
- </tr>
133
- <tr class="top-aligned-row context-row">
134
- <td class="context-item-name">Deg2Rad</td>
135
- <td>=</td>
136
- <td class="context-item-value">Math::PI/180</td>
137
- </tr>
138
- </table>
139
- </div>
140
- </div>
141
-
142
-
143
-
144
-
145
-
146
-
147
- <!-- if method_list -->
148
- <div id="methods">
149
- <h3 class="section-bar">Public Class methods</h3>
150
-
151
- <div id="method-M000083" class="method-detail">
152
- <a name="M000083"></a>
153
-
154
- <div class="method-heading">
155
- <a href="#M000083" class="method-signature">
156
- <span class="method-name">blh2xyz</span><span class="method-args">(b_deg,l_deg,he,datum)</span>
157
- </a>
158
- </div>
159
-
160
- <div class="method-description">
161
- <p>
162
- 緯度(度),経度(度),高度(m)を三次元直交座標(m)に変換する。
163
- </p>
164
- <p><a class="source-toggle" href="#"
165
- onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
166
- <div class="method-source-code" id="M000083-source">
167
- <pre>
168
- <span class="ruby-comment cmt"># File lib/jpmobile/datum_conv.rb, line 15</span>
169
- 15: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">blh2xyz</span>(<span class="ruby-identifier">b_deg</span>,<span class="ruby-identifier">l_deg</span>,<span class="ruby-identifier">he</span>,<span class="ruby-identifier">datum</span>)
170
- 16: <span class="ruby-identifier">a</span> = <span class="ruby-identifier">datum</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_f</span>
171
- 17: <span class="ruby-identifier">f</span> = <span class="ruby-value">1.0</span><span class="ruby-operator">/</span><span class="ruby-identifier">datum</span>[<span class="ruby-value">1</span>]
172
- 18: <span class="ruby-identifier">b</span> = <span class="ruby-identifier">b_deg</span> <span class="ruby-operator">*</span> <span class="ruby-constant">Deg2Rad</span>
173
- 19: <span class="ruby-identifier">l</span> = <span class="ruby-identifier">l_deg</span> <span class="ruby-operator">*</span> <span class="ruby-constant">Deg2Rad</span>
174
- 20:
175
- 21: <span class="ruby-identifier">e2</span> = <span class="ruby-identifier">f</span> <span class="ruby-operator">*</span> (<span class="ruby-value">2</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">f</span>)
176
- 22: <span class="ruby-identifier">n</span> = <span class="ruby-identifier">a</span> <span class="ruby-operator">/</span> <span class="ruby-constant">Math</span>.<span class="ruby-identifier">sqrt</span>(<span class="ruby-value">1</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">e2</span> <span class="ruby-operator">*</span> <span class="ruby-constant">Math</span>.<span class="ruby-identifier">sin</span>(<span class="ruby-identifier">b</span>)<span class="ruby-operator">**</span><span class="ruby-value">2</span> )
177
- 23:
178
- 24: <span class="ruby-identifier">x</span> = (<span class="ruby-identifier">n</span><span class="ruby-operator">+</span><span class="ruby-identifier">he</span>)<span class="ruby-operator">*</span><span class="ruby-constant">Math</span>.<span class="ruby-identifier">cos</span>(<span class="ruby-identifier">b</span>)<span class="ruby-operator">*</span><span class="ruby-constant">Math</span>.<span class="ruby-identifier">cos</span>(<span class="ruby-identifier">l</span>)
179
- 25: <span class="ruby-identifier">y</span> = (<span class="ruby-identifier">n</span><span class="ruby-operator">+</span><span class="ruby-identifier">he</span>)<span class="ruby-operator">*</span><span class="ruby-constant">Math</span>.<span class="ruby-identifier">cos</span>(<span class="ruby-identifier">b</span>)<span class="ruby-operator">*</span><span class="ruby-constant">Math</span>.<span class="ruby-identifier">sin</span>(<span class="ruby-identifier">l</span>)
180
- 26: <span class="ruby-identifier">z</span> = (<span class="ruby-identifier">n</span><span class="ruby-operator">*</span>(<span class="ruby-value">1</span><span class="ruby-operator">-</span><span class="ruby-identifier">e2</span>)<span class="ruby-operator">+</span><span class="ruby-identifier">he</span>)<span class="ruby-operator">*</span><span class="ruby-constant">Math</span>.<span class="ruby-identifier">sin</span>(<span class="ruby-identifier">b</span>)
181
- 27: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span>,<span class="ruby-identifier">z</span>
182
- 28: <span class="ruby-keyword kw">end</span>
183
- </pre>
184
- </div>
185
- </div>
186
- </div>
187
-
188
- <div id="method-M000087" class="method-detail">
189
- <a name="M000087"></a>
190
-
191
- <div class="method-heading">
192
- <a href="#M000087" class="method-signature">
193
- <span class="method-name">jgd2tky</span><span class="method-args">(b,l,he=0)</span>
194
- </a>
195
- </div>
196
-
197
- <div class="method-description">
198
- <p>
199
- 世界測地系から日本測地系に変換する。
200
- </p>
201
- <p><a class="source-toggle" href="#"
202
- onclick="toggleCode('M000087-source');return false;">[Source]</a></p>
203
- <div class="method-source-code" id="M000087-source">
204
- <pre>
205
- <span class="ruby-comment cmt"># File lib/jpmobile/datum_conv.rb, line 63</span>
206
- 63: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">jgd2tky</span>(<span class="ruby-identifier">b</span>,<span class="ruby-identifier">l</span>,<span class="ruby-identifier">he</span>=<span class="ruby-value">0</span>)
207
- 64: <span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span>,<span class="ruby-identifier">z</span> = <span class="ruby-identifier">blh2xyz</span>(<span class="ruby-identifier">b</span>,<span class="ruby-identifier">l</span>,<span class="ruby-identifier">he</span>,<span class="ruby-constant">GRS80</span>)
208
- 65: <span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span>,<span class="ruby-identifier">z</span> = <span class="ruby-identifier">xyz2xyz</span>(<span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span>,<span class="ruby-identifier">z</span>,<span class="ruby-constant">ITRF94toTokyo97</span>)
209
- 66: <span class="ruby-identifier">b</span>,<span class="ruby-identifier">l</span>,<span class="ruby-identifier">he</span> = <span class="ruby-identifier">xyz2blh</span>(<span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span>,<span class="ruby-identifier">z</span>,<span class="ruby-constant">Bessel</span>)
210
- 67: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">b</span>,<span class="ruby-identifier">l</span>,<span class="ruby-identifier">he</span>
211
- 68: <span class="ruby-keyword kw">end</span>
212
- </pre>
213
- </div>
214
- </div>
215
- </div>
216
-
217
- <div id="method-M000086" class="method-detail">
218
- <a name="M000086"></a>
219
-
220
- <div class="method-heading">
221
- <a href="#M000086" class="method-signature">
222
- <span class="method-name">tky2jgd</span><span class="method-args">(b,l,he=0)</span>
223
- </a>
224
- </div>
225
-
226
- <div class="method-description">
227
- <p>
228
- 日本測地系から世界測地系に変換する。
229
- </p>
230
- <p><a class="source-toggle" href="#"
231
- onclick="toggleCode('M000086-source');return false;">[Source]</a></p>
232
- <div class="method-source-code" id="M000086-source">
233
- <pre>
234
- <span class="ruby-comment cmt"># File lib/jpmobile/datum_conv.rb, line 55</span>
235
- 55: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">tky2jgd</span>(<span class="ruby-identifier">b</span>,<span class="ruby-identifier">l</span>,<span class="ruby-identifier">he</span>=<span class="ruby-value">0</span>)
236
- 56: <span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span>,<span class="ruby-identifier">z</span> = <span class="ruby-identifier">blh2xyz</span>(<span class="ruby-identifier">b</span>,<span class="ruby-identifier">l</span>,<span class="ruby-identifier">he</span>,<span class="ruby-constant">Bessel</span>)
237
- 57: <span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span>,<span class="ruby-identifier">z</span> = <span class="ruby-identifier">xyz2xyz</span>(<span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span>,<span class="ruby-identifier">z</span>,<span class="ruby-constant">Tokyo97toITRF94</span>)
238
- 58: <span class="ruby-identifier">b</span>,<span class="ruby-identifier">l</span>,<span class="ruby-identifier">he</span> = <span class="ruby-identifier">xyz2blh</span>(<span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span>,<span class="ruby-identifier">z</span>,<span class="ruby-constant">GRS80</span>)
239
- 59: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">b</span>,<span class="ruby-identifier">l</span>,<span class="ruby-identifier">he</span>
240
- 60: <span class="ruby-keyword kw">end</span>
241
- </pre>
242
- </div>
243
- </div>
244
- </div>
245
-
246
- <div id="method-M000084" class="method-detail">
247
- <a name="M000084"></a>
248
-
249
- <div class="method-heading">
250
- <a href="#M000084" class="method-signature">
251
- <span class="method-name">xyz2blh</span><span class="method-args">(x,y,z,datum)</span>
252
- </a>
253
- </div>
254
-
255
- <div class="method-description">
256
- <p>
257
- 三次元直交座標(m)を緯度(度),経度(度),高度(m)に変換する。
258
- </p>
259
- <p><a class="source-toggle" href="#"
260
- onclick="toggleCode('M000084-source');return false;">[Source]</a></p>
261
- <div class="method-source-code" id="M000084-source">
262
- <pre>
263
- <span class="ruby-comment cmt"># File lib/jpmobile/datum_conv.rb, line 31</span>
264
- 31: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">xyz2blh</span>(<span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span>,<span class="ruby-identifier">z</span>,<span class="ruby-identifier">datum</span>)
265
- 32: <span class="ruby-identifier">a</span> = <span class="ruby-identifier">datum</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_f</span>
266
- 33: <span class="ruby-identifier">f</span> = <span class="ruby-value">1.0</span><span class="ruby-operator">/</span><span class="ruby-identifier">datum</span>[<span class="ruby-value">1</span>]
267
- 34: <span class="ruby-identifier">e2</span> = <span class="ruby-identifier">f</span> <span class="ruby-operator">*</span> (<span class="ruby-value">2</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">f</span>)
268
- 35: <span class="ruby-identifier">l</span> = <span class="ruby-constant">Math</span>.<span class="ruby-identifier">atan2</span>(<span class="ruby-identifier">y</span>,<span class="ruby-identifier">x</span>)
269
- 36:
270
- 37: <span class="ruby-identifier">p</span> = <span class="ruby-constant">Math</span>.<span class="ruby-identifier">sqrt</span>(<span class="ruby-identifier">x</span><span class="ruby-operator">**</span><span class="ruby-value">2</span><span class="ruby-operator">+</span><span class="ruby-identifier">y</span><span class="ruby-operator">**</span><span class="ruby-value">2</span>)
271
- 38: <span class="ruby-identifier">r</span> = <span class="ruby-constant">Math</span>.<span class="ruby-identifier">sqrt</span>(<span class="ruby-identifier">p</span><span class="ruby-operator">**</span><span class="ruby-value">2</span><span class="ruby-operator">+</span><span class="ruby-identifier">z</span><span class="ruby-operator">**</span><span class="ruby-value">2</span>)
272
- 39: <span class="ruby-identifier">u</span> = <span class="ruby-constant">Math</span>.<span class="ruby-identifier">atan2</span>(<span class="ruby-identifier">z</span><span class="ruby-operator">*</span>((<span class="ruby-value">1</span><span class="ruby-operator">-</span><span class="ruby-identifier">f</span>)<span class="ruby-operator">+</span><span class="ruby-identifier">e2</span><span class="ruby-operator">*</span><span class="ruby-identifier">a</span><span class="ruby-operator">/</span><span class="ruby-identifier">r</span>),<span class="ruby-identifier">p</span>)
273
- 40: <span class="ruby-identifier">b</span> = <span class="ruby-constant">Math</span>.<span class="ruby-identifier">atan2</span>(<span class="ruby-identifier">z</span><span class="ruby-operator">*</span>(<span class="ruby-value">1</span><span class="ruby-operator">-</span><span class="ruby-identifier">f</span>)<span class="ruby-operator">+</span><span class="ruby-identifier">e2</span><span class="ruby-operator">*</span><span class="ruby-identifier">a</span><span class="ruby-operator">*</span><span class="ruby-constant">Math</span>.<span class="ruby-identifier">sin</span>(<span class="ruby-identifier">u</span>)<span class="ruby-operator">**</span><span class="ruby-value">3</span>,(<span class="ruby-value">1</span><span class="ruby-operator">-</span><span class="ruby-identifier">f</span>)<span class="ruby-operator">*</span>(<span class="ruby-identifier">p</span><span class="ruby-operator">-</span><span class="ruby-identifier">e2</span><span class="ruby-operator">*</span><span class="ruby-identifier">a</span><span class="ruby-operator">*</span><span class="ruby-constant">Math</span>.<span class="ruby-identifier">cos</span>(<span class="ruby-identifier">u</span>)<span class="ruby-operator">**</span><span class="ruby-value">3</span>))
274
- 41:
275
- 42: <span class="ruby-identifier">he</span> = <span class="ruby-identifier">p</span><span class="ruby-operator">*</span><span class="ruby-constant">Math</span>.<span class="ruby-identifier">cos</span>(<span class="ruby-identifier">b</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">z</span><span class="ruby-operator">*</span><span class="ruby-constant">Math</span>.<span class="ruby-identifier">sin</span>(<span class="ruby-identifier">b</span>) <span class="ruby-operator">-</span> <span class="ruby-identifier">a</span><span class="ruby-operator">*</span><span class="ruby-constant">Math</span>.<span class="ruby-identifier">sqrt</span>(<span class="ruby-value">1</span><span class="ruby-operator">-</span><span class="ruby-identifier">e2</span><span class="ruby-operator">*</span><span class="ruby-constant">Math</span>.<span class="ruby-identifier">sin</span>(<span class="ruby-identifier">b</span>)<span class="ruby-operator">**</span><span class="ruby-value">2</span>)
276
- 43:
277
- 44: <span class="ruby-identifier">b_deg</span> = <span class="ruby-identifier">b</span> <span class="ruby-operator">/</span> <span class="ruby-constant">Deg2Rad</span>
278
- 45: <span class="ruby-identifier">l_deg</span> = <span class="ruby-identifier">l</span> <span class="ruby-operator">/</span> <span class="ruby-constant">Deg2Rad</span>
279
- 46: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">b_deg</span>,<span class="ruby-identifier">l_deg</span>,<span class="ruby-identifier">he</span>
280
- 47: <span class="ruby-keyword kw">end</span>
281
- </pre>
282
- </div>
283
- </div>
284
- </div>
285
-
286
- <div id="method-M000085" class="method-detail">
287
- <a name="M000085"></a>
288
-
289
- <div class="method-heading">
290
- <a href="#M000085" class="method-signature">
291
- <span class="method-name">xyz2xyz</span><span class="method-args">(x,y,z,d)</span>
292
- </a>
293
- </div>
294
-
295
- <div class="method-description">
296
- <p>
297
- 三次元直交座標でシフトする。
298
- </p>
299
- <p><a class="source-toggle" href="#"
300
- onclick="toggleCode('M000085-source');return false;">[Source]</a></p>
301
- <div class="method-source-code" id="M000085-source">
302
- <pre>
303
- <span class="ruby-comment cmt"># File lib/jpmobile/datum_conv.rb, line 50</span>
304
- 50: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">xyz2xyz</span>(<span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span>,<span class="ruby-identifier">z</span>,<span class="ruby-identifier">d</span>)
305
- 51: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">x</span><span class="ruby-operator">+</span><span class="ruby-identifier">d</span>[<span class="ruby-value">0</span>],<span class="ruby-identifier">y</span><span class="ruby-operator">+</span><span class="ruby-identifier">d</span>[<span class="ruby-value">1</span>],<span class="ruby-identifier">z</span><span class="ruby-operator">+</span><span class="ruby-identifier">d</span>[<span class="ruby-value">2</span>]
306
- 52: <span class="ruby-keyword kw">end</span>
307
- </pre>
308
- </div>
309
- </div>
310
- </div>
311
-
312
-
313
- </div>
314
-
315
-
316
- </div>
317
-
318
-
319
- <div id="validator-badges">
320
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
321
- </div>
322
-
323
- </body>
324
- </html>