é¦é½åã®ééé§ ã®ç·¯åº¦çµåº¦ãä¸ç測å°ç³»ã«å¤æ
é¦é½åã®ééé§ ã«ã¤ãã¦ãGoogle Maps ã§ä½¿ç¨å¯è½ãªä¸ç測å°ç³»ã®ç·¯åº¦çµåº¦ãåå¾ãããã¨ãç®æ¨ã¨ããã
1. ééé§ ã®ç·¯åº¦çµåº¦ãåå¾
鉄道網の分析: 研究概要: 篠田 孝祐 ãã 駅情報データ ãåå¾ãç¯ ç°ããããããã¨ãï¼
2. ä¸ç測å°ç³»ã«å¤æ
ä¸ã®ãã¼ã¿ã¯æ¥æ¬æ¸¬å°ç³»ã§ããããã®ããä¸ç測å°ç³»ã¸å¤æããªããã°ãªããªãã幸ããå½åå°çé¢ãå¤æããã°ã©ã TKY2JGDãå ¬éãã¦ããã¦ããããã¦ã³ãã¼ããã¦ä½¿ãã1. ã®ãã¼ã¿ã®ãã©ã¼ãããã¯ãé§ åã»ç·¯åº¦ã»çµåº¦ãã®é ã«ãã¼ã¿ã並ãã§ãããããã®ã½ããã¯ã緯度ã»çµåº¦ã»é§ åãã®é ã«ãããã¼ã¿ãåãä»ããªãã®ã§ãå¤æãã£ã«ã¿ã Ruby ã§æ¸ããã
STDIN.each do |line| next if line =~ /^#/ items = line.split(/\s+/) print items[2].gsub('.', ''), ' ', items[3].gsub('.', ''), ' ', items[1], "\n" end
3. 10é²æ°è¡¨è¨ã«å¤æ
ãã¦ãããã¦ä¸ç測å°ç³»ã«å¤æã¯ã§ããããåé¡ãããããã®ãã¼ã¿ã¯ãã度ãåãç§ãã¨ããå½¢å¼ã®ãã¼ã¿ã§ãGoogle Maps ã«é£ãããã«ã¯ã10é²æ°ã«å¤æããªããã°ãªããªããåºæ¬çã«ã¯ãæéã¨èãæ¹ã¯åãããã¨ãã°ã1æé25å33ç§ãã¯ä½æéãï¼ã¨ããåé¡ãèãã¦ã¿ãã°ããããã®å ´å 1 + 25/60 + 33/3600 = 1.42583333333333 æéã¨ãããã¨ã«ãªããããã§ä½ã£ãã®ã次ã®ã¹ã¯ãªããã
def d60_to_d10(num_str) a, b = num_str.split('.') r = a[0, a.size - 4].to_f + a[-4, 2].to_f / 60.0 + "#{a[-2, 2]}.#{b}".to_f / 3600.0 end STDIN.each do |line| items = line.split(/\s+/) print items[3], "\t", d60_to_d10(items[1]), "\t", d60_to_d10(items[2]), "\n" end
ããã§å®äºããã§ãããã§ããã