Produktübersicht Basis-DLM を読む 5.5: データ価格の再計算
ドイツの地形図データ Basis-DLM についての調査(http://d.hatena.ne.jp/hfu/archive?word=%2a%5bATKIS%5d)を進めているところですが、
価格表は、鉄道などの料金の表のように、累積的に読む必要があると気がつきました。
http://d.hatena.ne.jp/hfu/20070918/1190175715
ということで、価格を再計算しました。
再計算の結果
再計算の結果は、以下の通りになりました。
州 | 面積 | 価格(ユーロ) | 価格(円, 1ユーロ160.0円換算) |
ブランデンブルク州 | 29476.67平方km | 92000ユーロ | 1472万円 |
ベルリン州 | 891.82平方km | 6700ユーロ | 107万円 |
バーデン=ヴュルテンベルク州(全土購入割引をしない場合) | 35751.64平方km | 98300ユーロ | 1572万円 |
バイエルン州 | 70549.32平方km | 122800ユーロ | 1964万円 |
以前のエントリで計算した結果よりも高くなります。ドイツ全土分の Basis-DLM データを購入すると、1億円は超えてしまいそうです。
再計算コード
再計算のコードは、下記の通りです。
yen_euro = 160.0 debug = false MAX = 357021 # any big enough number (area of Germany is currently used.) print "|州|面積|価格(ユーロ)|価格(円, 1ユーロ#{yen_euro}円換算)|\n" [{:name => 'ブランデンブルク州', :area => 29476.67, :price_list => [[5000, 7.5], [25000, 2.5], [50000, 1.0]]}, {:name => 'ベルリン州', :area => 891.82, :price_list => [[MAX, 7.5]]}, {:name => 'バーデン=ヴュルテンベルク州(全土購入割引をしない場合)', :area => 35751.64, :price_list => [[5000, 7.5], [25000, 2.5], [50000, 1]]}, {:name => 'バイエルン州', :area => 70549.32, :price_list => [[5000, 7.5], [25000, 2.5], [50000, 1], [MAX, 0.5]]} ].each do |info| print info[:name], "\n" if debug remaining_area = info[:area] acc_euro_paid = 0 acc_yen_paid = 0 info[:price_list].size.times do |i| consumable_area = info[:price_list][i][0] - ((i > 0) ? info[:price_list][i - 1][0] : 0) if remaining_area > consumable_area consumed_area = consumable_area remaining_area -= consumed_area else consumed_area = remaining_area remaining_area = 0 end euro_paid = consumed_area * info[:price_list][i][1] yen_paid = euro_paid * yen_euro acc_euro_paid += euro_paid acc_yen_paid += yen_paid print "#{consumed_area} consumed, #{remaining_area} remaining, #{euro_paid} euro (#{yen_paid} yen) paid.\n" if debug end print "---\n" if debug print "overall #{acc_euro_paid} euro (#{acc_yen_paid} yen)\n" if debug print "|#{info[:name]}|#{info[:area]}平方km|#{(acc_euro_paid / 100).round}00ユーロ|#{(acc_yen_paid / 10000).round}万円|\n" end