{"id":3468,"date":"2020-02-14T09:08:55","date_gmt":"2020-02-14T00:08:55","guid":{"rendered":"https:\/\/now0930.pe.kr\/wordpress\/?p=3468"},"modified":"2020-02-15T11:13:31","modified_gmt":"2020-02-15T02:13:31","slug":"gps-%ed%83%9c%ea%b7%b8-%ec%95%a8%eb%b2%94-%ec%a0%9c%ec%9e%914","status":"publish","type":"post","link":"https:\/\/now0930.pe.kr\/wordpress\/gps-%ed%83%9c%ea%b7%b8-%ec%95%a8%eb%b2%94-%ec%a0%9c%ec%9e%914\/","title":{"rendered":"gps \ud0dc\uadf8 \uc568\ubc94 \uc81c\uc791(4\/4)"},"content":{"rendered":"\n<p>\uc81c\uae38. perl \uc81c\uc791\ud55c \ud504\ub85c\uadf8\ub7a8\uc5d0 \ubc84\uadf8\uac00 \uc788\ub2e4. mysql \uc811\uadfc \uad8c\ud55c\uc744 update\ub97c \uc8fc\uba74 perl\uc774 \uc811\uc18d\ud558\uba74\uc11c gps \uc815\ubcf4\ub97c \ucd08\uae30\ud654\ud55c\ub2e4. perl \uc870\ud68c \uacc4\uc815\uc744 \ud558\ub098 \ub9cc\ub4e4\uc5b4 select \uad8c\ud55c\ub9cc \uc8fc\uc5c8\ub2e4.<\/p>\n\n\n\n<p>\uadf8\ub9ac\uace0 GPS\uc5d0 N,S, E, W \ub124 \ubc29\ud5a5\uc774 \uc788\ub2e4. \uc644\uc804 \uc88c\uc808..<\/p>\n\n\n\n<p>\uc798\ubabb\ud55c update \uce7c\ub7fc\uc744 \ucc3e\uc544 \ub2e4\uc2dc \uc88c\ud45c\ub97c \ub123\uc5b4\uc918\uc57c \ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#!\/bin\/bash\n\n#file \uc720\ubb34 \ud655\uc778\nif [ ! -f $1 ];then\n\techo \"file is not there\";\n\texit\nfi\n\n#N, S, E, W \ubc29\ud5a5 \ud655\uc778.\n\nGpsRefNS=$(exiv2 -pa $1 2> \/dev\/null | grep -ae \"Exif\\.GPSInfo\\.GPSLatitudeRef.*Ascii\" | sed 's\/ \\{1,\\}\/ \/g'|cut -d' ' -f4-)\nGpsRefEW=$(exiv2 -pa $1 2> \/dev\/null | grep -ae \"Exif\\.GPSInfo\\.GPSLongitudeRef.*Ascii\" | sed 's\/ \\{1,\\}\/ \/g'|cut -d' ' -f4-)\n\nif [ -z \"$GpsRefNS\" ]\nthen\n\texit;\nfi;\n\nif [ -z \"$GpsRefEW\" ]\nthen\n\texit;\nfi;\n\nGpsLat=$(exiv2 -pa $1 2> \/dev\/null | grep -ae \"Exif\\.GPSInfo\\.GPSLatitude.*Rational\" | sed 's\/ \\{1,\\}\/ \/g' | cut -d' ' -f4-)\nGpsLong=$(exiv2 -pa $1 2> \/dev\/null | grep -ae \"Exif\\.GPSInfo\\.GPSLongitude.*Rational\" | sed 's\/ \\{1,\\}\/ \/g'| cut -d' ' -f4-)\n\n#GpsLat\ub9c8\uc9c0\ub9c9 \uc22b\uc790\nGpsLatSec=$(echo $GpsLat | cut -d' ' -f3 | tr -d \"\\\"\")\nGpsLatMin=$(echo $GpsLat | cut -d' ' -f2 | tr -d \"\\'\")\n\n#\ucd08\uac00 \uc5c6\ub294 \uacbd\uc6b0 0\uc744 \uc785\ub825.\nif [ -z \"$GpsLatSec\" ]\n\tthen\n\t\tGpsLatSec=0;\nfi\n\nGpsLongSec=$(echo $GpsLong | cut -d' ' -f3 | tr -d \"\\\"\")\nGpsLongMin=$(echo $GpsLong | cut -d' ' -f2 | tr -d \"\\'\")\n\nif [ -z \"$GpsLongSec\" ]\n\tthen\n\t\tGpsLongSec=0;\nfi\n\n#GPS\uc790\ud45c\uac00 \uc22b\uc790\uc778\uc9c0 \ud655\uc778\nre='^[0-9]{1,3}$'\n#\uac00\ub054 \uc18c\uc218\uc810\ub3c4 \uc788\uc74c..\nre='^[0-9]{1,3}(\\.[0-9]{1,5}$|$)'\n\nif ! [[ $GpsLatSec =~ $re ]]\nthen\n\texit 1;\nfi\n\nif ! [[ $GpsLatMin =~ $re ]]\nthen\n\texit 1;\nfi\n\nGpsLatFloat=$(bc &lt;&lt;&lt; \"scale=4;($GpsLatSec\/60+$GpsLatMin)\/60\")\nGpsLongFloat=$(bc &lt;&lt;&lt; \"scale=4;($GpsLongSec\/60+$GpsLongMin)\/60\")\n\n\n#$Gps \uc778\ud2f0\uc800\nGpsLatInt=$(echo $GpsLat | cut -d' ' -f1 | tr -d \"d-g\");\nGpsLongInt=$(echo $GpsLong | cut -d' ' -f1 | tr -d \"d-g\");\n\n#$\uc804\uccb4 \uc22b\uc790.\nGpsLatFull=$(bc &lt;&lt;&lt; \"scale=4;$GpsLatFloat+$GpsLatInt\");\nGpsLongFull=$(bc &lt;&lt;&lt; \"scale=4;$GpsLongFloat+$GpsLongInt\");\n\n#South, West\uba74 \ubc18\uc804\nif [ \"$GpsRefNS\" = \"South\" ]\nthen\n\tGpsLatFull=$(bc &lt;&lt;&lt; \"scale=4;$GpsLatFull*-1\");\nfi\n\nif [ \"$GpsRefEW\" = \"West\" ]\nthen\n\tGpsLongFull=$(bc &lt;&lt;&lt; \"scale=4;$GpsLongFull*-1\");\nfi\n\necho $GpsLatFull,$GpsLongFull;<\/pre>\n\n\n\n<p>\uc774\uc81c \uc0ac\uc9c4\uc5d0 \ud0dc\uadf8\uc640 perl\uc774 \ud45c\uc2dc\ud560 \uc218 \uc788\ub294 \ub0b4\uc6a9\uc744 \uc785\ub825\ud574\uc57c \ud55c\ub2e4. perl\uc5d0\uc11c \ucd94\uac00 \ubaa8\ub4c8\uc774 \ud55c\uae00\ub85c \ub41c \uce7c\ub7fc\uc740 \uc870\ud68c\ud560 \uc218 \uc5c6\ub2e4. \ub3d9\uc77c\ud55c \ub0b4\uc6a9\uc73c\ub85c \uc601\uc5b4\ub85c \ub9cc\ub4e4\uc5c8\ub2e4. \uc774\uac83\ub3c4 \uac1c\ub178\uac00\ub2e4.<\/p>\n\n\n\n<p>\uc804\uc5d0 \ub9cc\ub4e0 php\ub97c \ud65c\uc6a9\ud558\uc5ec \uc0ac\uc9c4\uc744 \uc5c5\ub370\uc774\ud2b8 \ud588\ub2e4.<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"GPSphoto\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/lWNFDDpYK1o?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\uc81c\uae38. perl \uc81c\uc791\ud55c \ud504\ub85c\uadf8\ub7a8\uc5d0 \ubc84\uadf8\uac00 \uc788\ub2e4. mysql \uc811\uadfc \uad8c\ud55c\uc744 update\ub97c \uc8fc\uba74 perl\uc774 \uc811\uc18d\ud558\uba74\uc11c gps \uc815\ubcf4\ub97c \ucd08\uae30\ud654\ud55c\ub2e4. perl \uc870\ud68c \uacc4\uc815\uc744 \ud558\ub098 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[12],"tags":[126,730,728,729],"class_list":["post-3468","post","type-post","status-publish","format-standard","hentry","category-12","tag-gps","tag-perl","tag-728","tag-729"],"_links":{"self":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/3468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/comments?post=3468"}],"version-history":[{"count":8,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/3468\/revisions"}],"predecessor-version":[{"id":3480,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/3468\/revisions\/3480"}],"wp:attachment":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/media?parent=3468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/categories?post=3468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/tags?post=3468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}