LoginSignup
2
2

More than 5 years have passed since last update.

タイルの説明によく使う図(地理院タイル版)

Posted at

http://smellman.hatenablog.com/entry/2014/11/29/041003 で公表されている、「タイルの説明に使うあの図」をアレンジして地理院タイル版にしてみた。homebrew で導入しただけの imagemagick で動く。

for z in 0..2
  for x in 0...(2 ** z)
    for y in 0...(2 ** z)
      next if File.exist?("#{z}_#{x}_#{y}.png")
      `wget -O #{z}_#{x}_#{y}.png http://cyberjapandata.gsi.go.jp/xyz/std/#{z}/#{x}/#{y}.png`
    end
  end
end

for z in 0..2
  files = []
  for y in 0...(2 ** z)
    for x in 0...(2 ** z)
      `convert -font '/System/Library/Fonts/HelveticaNeue.dfont' -pointsize 48 -gravity center -annotate 0 "#{z}/#{x}/#{y}" #{z}_#{x}_#{y}.png with_txt_#{z}_#{x}_#{y}.png`
      files << "with_txt_#{z}_#{x}_#{y}.png"
    end
  end
  `montage #{files.join(' ')} -geometry +#{z+1}+#{z+1} conv_#{z}.png`
end
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2