{"id":129,"date":"2007-12-21T18:29:28","date_gmt":"2007-12-21T09:29:28","guid":{"rendered":"http:\/\/ke-tai.org\/blog\/2007\/12\/21\/wgs\/"},"modified":"2008-03-16T19:09:33","modified_gmt":"2008-03-16T10:09:33","slug":"wgs","status":"publish","type":"post","link":"http:\/\/ke-tai.org\/blog\/2007\/12\/21\/wgs\/","title":{"rendered":"\u30b1\u30fc\u30bf\u30a4\u3067\u53d6\u5f97\u3057\u305f\u4f4d\u7f6e\u60c5\u5831\u3092GoogleMap\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\u30b5\u30f3\u30d7\u30eb"},"content":{"rendered":"<p>\u30b1\u30fc\u30bf\u30a4\u3067\u4f4d\u7f6e\u60c5\u5831\uff08\u7def\u5ea6\u30fb\u7d4c\u5ea6\uff09\u3092\u53d6\u5f97\u3059\u308b\u3068\u3001\u5ea6\u5206\u79d2\u8868\u8a18\uff08xx\u6642xx\u5206xx\u79d2\u5f62\u5f0f\uff09\u3067\u5ea7\u6a19\u304c\u8fd4\u3063\u3066\u304f\u308b\u30b1\u30fc\u30b9\u304c\u307b\u3068\u3093\u3069\u3067\u3059\u3002<br \/>\n\u3057\u304b\u3057\u3001GoogleMap\u306a\u3069\u306e\u5730\u56f3\u30b5\u30fc\u30d3\u30b9\u306f\u30df\u30ea\u79d2\u8868\u8a18\uff08xxx.xxxxxx\u5f62\u5f0f\uff09\u3092\u4f7f\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u591a\u3044\u306e\u3067\u3001\u5909\u63db\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u5ea7\u6a19\u3092GoogleMap\u3067\u4f7f\u3048\u308b\u3053\u3068\u3092\u76ee\u7684\u3068\u3057\u3066\u3001\u5ea6\u5206\u79d2\u5f62\u5f0f\u304b\u3089\u30df\u30ea\u79d2\u5f62\u5f0f\u3078\u5909\u63db\u3059\u308bPHP\u306e\u30b5\u30f3\u30d7\u30eb\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p class=\"spacer-small\">&nbsp;<\/p>\n<p><em><strong>\u30b1\u30fc\u30bf\u30a4\uff08\u5ea6\u5206\u79d2\u5f62\u5f0f\uff09\u2192GoogleMap\uff08\u30df\u30ea\u79d2\u5f62\u5f0f\uff09\u3078\u306e\u5909\u63db\u30b5\u30f3\u30d7\u30eb<\/strong><\/em><\/p>\n<pre class=\"super-pre-small\"><code>\/\/ GPS\u3067\u53d6\u5f97\u3057\u305f\u5ea7\u6a19\u306e\u4f8b\r\n$ido = '+43.3.14.112';\r\n$keido = '+141.22.35.364';\r\n\r\n\/\/ \u5ea6\u5206\u79d2\u5f62\u5f0f\u304b\u3089GoogleMap\u306b\u5bfe\u5fdc\u3057\u305f\u30df\u30ea\u79d2\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\r\nlist($g_ido, $g_keido) = convertLocationForGMap($ido, $keido);\r\n\r\necho '\u7def\u5ea6=' . $g_ido . '&lt;br&gt;';\r\necho '\u7d4c\u5ea6=' . $g_keido . '&lt;br&gt;';\r\n\r\n\/**\r\n * \u7def\u5ea6\u30fb\u7d4c\u5ea6\u5909\u63db\u30e1\u30bd\u30c3\u30c9\r\n * \u7def\u5ea6\u30fb\u7d4c\u5ea6\u3092\u5ea6\u5206\u79d2\u5f62\u5f0f\u304b\u3089\u30df\u30ea\u79d2\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\r\n * @param\tstring\t$ido\t\u7def\u5ea6\uff08\u5ea6\u5206\u79d2\u5f62\u5f0f\uff09\r\n * @param\tstring\t$keido\t\u7d4c\u5ea6\uff08\u5ea6\u5206\u79d2\u5f62\u5f0f\uff09\r\n * @return\tarray\t\tarray([\u5909\u63db\u5f8c\u306e\u7def\u5ea6], [\u5909\u63db\u5f8c\u306e\u7d4c\u5ea6])\r\n *\/\r\nfunction convertLocationForGMap($ido, $keido) {\r\n\t\/\/ \u5ea6\u5206\u79d2\u5f62\u5f0f\u304b\u3089GoogleMap\u306b\u5bfe\u5fdc\u3057\u305f\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\r\n\t$keido_arr = explode('.', $keido);\r\n\t$ido_arr = explode('.', $ido);\r\n\t$g_keido = trim($keido_arr[0]) + trim($keido_arr[1]) \/ 60\r\n\t + (trim($keido_arr[2]) + trim($keido_arr[3]) \/ 1000) \/ 3600;\r\n\t$g_ido = trim($ido_arr[0]) + trim($ido_arr[1]) \/ 60\r\n\t + (trim($ido_arr[2]) + trim($ido_arr[3]) \/ 1000) \/ 3600;\r\n\r\n\treturn array($g_ido, $g_keido);\r\n}\r\n<\/code><\/pre>\n<p>trim\u3092\u304b\u3051\u3066\u3044\u308b\u306e\u306f\u3001\u7aef\u672b\u3084\u30b5\u30fc\u30d3\u30b9\u306e\u9055\u3044\u306b\u3088\u3063\u3066\u306f\u3001\u5ea7\u6a19\u306e\u9593\u306b\u30b9\u30da\u30fc\u30b9\u304c\u5165\u308b\u3053\u3068\u304c\u3042\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u5229\u7528\u3059\u308b\u30ad\u30e3\u30ea\u30a2\u3084\u30b5\u30fc\u30d3\u30b9\u306b\u3088\u3063\u3066\u306f\u3001\u53d6\u5f97\u3059\u308b\u5ea7\u6a19\u304c\u65e5\u672c\u6e2c\u5730\u7cfb\u3067\u53d6\u308c\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>GoogleMap\u306f\u4e16\u754c\u6e2c\u5730\u7cfb\u3067\u3059\u306e\u3067\u3001\u5ea7\u6a19\u30c7\u30fc\u30bf\u304c\u65e5\u672c\u6e2c\u5730\u7cfb\u306e\u5834\u5408\u306f\u5909\u63db\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3053\u306e\u3042\u305f\u308a\u306e\u8aac\u660e\u3068\u5909\u63db\u30b5\u30f3\u30d7\u30eb\u306f\u3001\u307e\u305f\u5f8c\u65e5\u3054\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><strong>\u203b\u8ffd\u8a18<\/strong><br \/>\n\u65e5\u672c\u6e2c\u5730\u7cfb\u2192\u4e16\u754c\u6e2c\u5730\u7cfb\u306e\u8a18\u4e8b\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002<a href=\"http:\/\/ke-tai.org\/blog\/2007\/12\/25\/wgs84\/\">\u3053\u3061\u3089<\/a>\u3067\u3059\u3002<\/p>\n<p class=\"spacer\">&nbsp;<\/p>\n<p><strong><em>\u95a2\u9023\uff1a<\/em><\/strong><\/p>\n<ul>\n<li><em><a href=\"http:\/\/ke-tai.org\/blog\/2007\/12\/25\/wgs84\/\">\u30b1\u30fc\u30bf\u30a4\u3067\u53d6\u5f97\u3057\u305f\u4f4d\u7f6e\u60c5\u5831\u3092\u4e16\u754c\u6e2c\u5730\u7cfb\u306b\u5909\u63db\u3059\u308b\u30b5\u30f3\u30d7\u30eb<\/a><\/em><\/li>\n<li><em><a href=\"http:\/\/ke-tai.org\/blog\/2007\/12\/18\/iarea\/\">FOMA\u30aa\u30fc\u30d7\u30f3i\u30a8\u30ea\u30a2\u306e\u4f4d\u7f6e\u60c5\u5831\u53d6\u5f97\u6a5f\u80fd\u3092\u8a66\u3057\u3066\u307f\u307e\u3057\u305f<\/a><\/em><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u30b1\u30fc\u30bf\u30a4\u3067\u4f4d\u7f6e\u60c5\u5831\uff08\u7def\u5ea6\u30fb\u7d4c\u5ea6\uff09\u3092\u53d6\u5f97\u3059\u308b\u3068\u3001\u5ea6\u5206\u79d2\u8868\u8a18\uff08xx\u6642xx\u5206xx\u79d2\u5f62\u5f0f\uff09\u3067\u5ea7\u6a19\u304c\u8fd4\u3063\u3066\u304f\u308b\u30b1\u30fc\u30b9\u304c\u307b\u3068\u3093\u3069\u3067\u3059\u3002 \u3057\u304b\u3057\u3001GoogleMap\u306a\u3069\u306e\u5730\u56f3\u30b5\u30fc\u30d3\u30b9\u306f\u30df\u30ea\u79d2\u8868\u8a18\uff08xxx.xxxxxx\u5f62\u5f0f\uff09\u3092\u4f7f\u3063\u3066\u3044\u308b [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/posts\/129"}],"collection":[{"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/comments?post=129"}],"version-history":[{"count":0,"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/posts\/129\/revisions"}],"wp:attachment":[{"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/media?parent=129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/categories?post=129"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/tags?post=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}