Skip to content

Instantly share code, notes, and snippets.

@handygeospatial
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save handygeospatial/36191d4a4091e07c62c0 to your computer and use it in GitHub Desktop.
Save handygeospatial/36191d4a4091e07c62c0 to your computer and use it in GitHub Desktop.
elevation_of を使って 3D GeoJSON を作成するスクリプト ref: http://qiita.com/handygeospatial/items/aa9175bd3014acc84209
require 'json'
require './elevation_of.rb'
data = JSON.parse(File.open('kyogatake.geojson').read)
a = data['features'][0]['geometry']['coordinates']
a.each_index {|i|
a[i] << elevation_of(a[i][0], a[i][1])
}
File.open('kyogatake3d.geojson', 'w') {|w|
w.print JSON.dump(data)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment