#!/usr/bin/env ruby
# coding: utf-8
require 'csv'

map = CSV.read("saiseipower.csv", headers:true)
map.each_with_index do |row, i|
  printf("%3d - %s\n", i, row["場所"])
end
puts "-"*50 + "\nどれにしますか:"
n = gets.to_i
lon, lat = map[n]["Longitude"], map[n]["Latitude"]
url = "https://umap.openstreetmap.fr/ja/map/map_1126268#12/#{lat}/#{lon}"
system "firefox #{url} &"
