{"id":3451,"date":"2020-02-07T11:38:04","date_gmt":"2020-02-07T02:38:04","guid":{"rendered":"https:\/\/now0930.pe.kr\/wordpress\/?p=3451"},"modified":"2020-02-15T08:25:12","modified_gmt":"2020-02-14T23:25:12","slug":"gps-%ed%83%9c%ea%b7%b8-%ec%95%a8%eb%b2%94-%ec%a0%9c%ec%9e%912","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%912\/","title":{"rendered":"gps \ud0dc\uadf8 \uc568\ubc94 \uc81c\uc791(2\/4)"},"content":{"rendered":"\n<p>\uba87 \ubc88 \ud574\ubcf4\ub2c8 gps \uc88c\ud45c\uac00 \uc5ec\ub7ec \ud615\uc2dd\uc774\ub2e4. \uc0bc\uc131 \uce74\uba54\ub77c\ub85c 3\uac1c \ud615\uc2dd\uc744 \uc5bb\uc744 \uc218 \uc788\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=\"\">Exif.GPSInfo.GPSLatitude                     Rational    3  37deg 34' 0.982\"\nExif.GPSInfo.GPSLatitude                     Rational    3  37deg 34' 23\"\nExif.GPSInfo.GPSLatitude                     Rational    3  35.4328992deg<\/pre>\n\n\n\n<p>\ubaa8\ub450 \ud574\ub2f9\ud558\ub294 \uacbd\uc6b0\ub97c \ud558\ub098 \ud30c\uc77c\ub85c \ub9cc\ub4e4\ub824 \ud588\uc73c\ub098, \ud2c0\uc744 \uae68\uc5b4 3\uac1c \ud30c\uc77c\ub85c \ub9cc\ub4e4\uc5c8\ub2e4. 1\ubc88 \ud30c\uc77c\uc774 2\ubc88 \ud30c\uc77c\uc744 \uc2e4\ud589\ud558\uace0, \uacb0\uacfc\ub97c \ud655\uc778\ud55c\ub2e4. \ub9cc\uc871\ud558\uc9c0 \ubabb\ud558\uba74 3\ubc88 \ud30c\uc77c\uc744 \uc2e4\ud589\ud55c\ub2e4. \uc815\uaddc \ud45c\ud604\uc2dd \uac80\uc99d\uc740 <a href=\"https:\/\/regex101.com\/\">\uc5ec\uae30<\/a>\uc5d0\uc11c \ud588\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#1\ubc88 \uc2a4\ud06c\ub9bd\ud2b8\n#echo \"hello\"\necho \"$1\ub85c \ud30c\uc77c path\ub97c \uc785\ub825\"\n#\uc5c5\ub370\uc774\ud2b8\ud560 \ud30c\uc77c \uc22b\uc790 \ud655\uc778\n#echo $1\niMaxNum=$(wc -l $1 | cut -d' '  -f1)\n#echo $iMaxNum\n\ncat $1 |\\\nwhile read tmpFILE;\ndo\n\ttmpID=$(echo $tmpFILE | cut -d' ' -f1)\n\ttmpPATH=$(echo $tmpFILE | cut -d' ' -f2)\n\t#echo $tmpID, $tmpPATH;\n\tgpsCoord=$(\/home\/now0930\/script\/\uc0ac\uc9c4\uc5d0\uc11c\uc815\ubcf4\ucd94\ucd9c\/gpsTextToFloat.sh $tmpPATH)\n\t#echo $gpsCoord;\n\t#echo $tmpPATH\n\t#echo \"\uccab\ubc88\uc9f8 \uc2e4\ud589\"\n\n\tif [ -z \"$gpsCoord\" ]\n\tthen\n\t\tgpsCoord=$(\/home\/now0930\/script\/\uc0ac\uc9c4\uc5d0\uc11c\uc815\ubcf4\ucd94\ucd9c\/gpsTextToFloatMore.sh $tmpPATH)\n\t\t#echo \"\ub450\ubc88\uc9f8 \uc2e4\ud589\"\n\t\t#echo $gpsCoord;\n\n\tfi\n\n\n\t#echo \"\uc5ec\uae30\ud655\uc778\"\n\t#echo $tmpID, $gpsCoord;\n\n\tgpsCoordLat=$(echo $gpsCoord | cut -d',' -f1)\n\tgpsCoordLong=$(echo $gpsCoord | cut -d',' -f2)\n\n\t#float \ud615\uc2dd\uc778\uc9c0 \ud655\uc778\ud558\uc5ec mysql update\n\n\t#echo $tmpID\n\t#echo $tmpID, $gpsCoordLat, $gpsCoordLong;\n\n\n\t\n\n\tif ! [ -z \"$gpsCoordLat\" ]\n\tthen\n\t\t#\ub370\uc774\ud130 \ubca0\uc774\uc2a4 \uc5c5\ub370\uc774\ud2b8\n\t\tmysql &lt;&lt; EOF\n\n\t\tuse myHome;\n\t\tselect id, \uacbd\ub85c from picture where id = $tmpID;\n\t\tupdate picture set gpsLatFloat=$gpsCoordLat, gpsLongFloat=$gpsCoordLong where id=$tmpID;\nEOF\n\n\t#echo $gpsCoordLat, $gpsCoordLong\n\n\tfi\ndone<\/pre>\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#2\ubc88 \uc2a4\ud06c\ub9bd\ud2b8.\n#file \uc720\ubb34 \ud655\uc778\nif [ ! -f $1 ];then\n\techo \"file is not there\";\n\texit\nfi\n\n\n#Trap\uc73c\ub85c metadata\ub97c \uac00\uc9c0\uace0 \uc788\ub294\uc9c0 \ud655\uc778.\n#trap \"exiv2 -pa  $1\" EXIT\n#echo $1\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#echo $GpsLat;\n#echo $GpsLong;\n#printf \"\\n\"\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#echo $GpsLatSec;\n#echo $GpsLatMin;\n\n\nGpsLongSec=$(echo $GpsLong | cut -d' ' -f3 | tr -d \"\\\"\")\nGpsLongMin=$(echo $GpsLong | cut -d' ' -f2 | tr -d \"\\'\")\n\n\nif [ -z \"$GpsLongSec\" ]\n\tthen\n\t\tGpsLongSec=0;\nfi\n\n#echo $GpsLatSec;\n#echo $GpsLatMin;\n\n#echo $GpsLongSec;\n#echo $GpsLongMin;\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\n#if [ -z \"$GpsLat\" ]\n#then\n#\techo \"0,0\"\n#\texit;\n#fi\n#echo $GpsLatSec, $GpsLongSec\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#echo $GpsLatFloat\n#echo $GpsLongFloat\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#echo $GpsLatInt\n#echo $GpsLongInt\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\necho $GpsLatFull,$GpsLongFull;\n<\/pre>\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\n#Trap\uc73c\ub85c metadata\ub97c \uac00\uc9c0\uace0 \uc788\ub294\uc9c0 \ud655\uc778.\n#trap \"exiv2 -pa  $1\" EXIT\n\n#echo $GpsLat\n#echo $GpsLong\n#echo \"\uad6c\ubd84\uc790\"\n#\uc5ec\uae30 \ud655\uc778..\n#GPS \ud615\uc2dd \ud655\uc778\n#xxx.xxxxdeg \ud615\uc2dd\uc77c \uacbd\uc6b0 \ucc98\ub9ac.\nrenumberdeg='^[0-9]{1,}\\.[0-9]{1,}deg'\nif [[ $GpsLat =~ $renumberdeg ]]\nthen\n\t#echo \"\uc5ec\uae30 \ub9e4\uce58\"\n\tGpsLatFull=$(echo $GpsLat| cut -d'd' -f1)\n\t#echo $GpsLatFull\nfi\n\nif [[ $GpsLong =~ $renumberdeg ]]\nthen\n\tGpsLongFull=$(echo $GpsLong | cut -d'd' -f1)\n\t#echo $GpsLongFull\nfi\necho $GpsLatFull,$GpsLongFull;\n<\/pre>\n\n\n\n<p>\uc774\ub807\uac8c \ud558\uba74 gps \ud0dc\uadf8 \ub2ec\ub9b0 \uc0ac\uc9c4\uc744 8\uac1c \ub0a8\uae30\uace0 \uc785\ub825\ud560 \uc218 \uc788\ub2e4. \ub098\uba38\uc9c0 8\uac1c\ub294 \ud3ec\uae30\ud55c\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uba87 \ubc88 \ud574\ubcf4\ub2c8 gps \uc88c\ud45c\uac00 \uc5ec\ub7ec \ud615\uc2dd\uc774\ub2e4. \uc0bc\uc131 \uce74\uba54\ub77c\ub85c 3\uac1c \ud615\uc2dd\uc744 \uc5bb\uc744 \uc218 \uc788\ub2e4. \ubaa8\ub450 \ud574\ub2f9\ud558\ub294 \uacbd\uc6b0\ub97c \ud558\ub098 \ud30c\uc77c\ub85c \ub9cc\ub4e4\ub824 [&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":""}},"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12],"tags":[126,730,728,729],"class_list":["post-3451","post","type-post","status-publish","format-standard","hentry","category-12","tag-gps","tag-perl","tag-728","tag-729"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/3451","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=3451"}],"version-history":[{"count":3,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/3451\/revisions"}],"predecessor-version":[{"id":3477,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/3451\/revisions\/3477"}],"wp:attachment":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/media?parent=3451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/categories?post=3451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/tags?post=3451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}