Created
April 26, 2013 13:20
-
-
Save jnicho02/5467350 to your computer and use it in GitHub Desktop.
writes out ruby code that can be fed in to Trimble Sketchup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'OSM/API' | |
@api = OSM::API.new | |
db = @api.get_bbox(-5.2134537,50.040992,-5.0993322,50.2582661) | |
puts 'require \'sketchup.rb\'' | |
puts 'model = Sketchup.active_model' | |
db.ways.each { |way| | |
prev = nil | |
way[1].node_objects.each { |node| | |
if (prev) | |
puts 'model.entities.add_line( (model.latlong_to_point [' + prev.lon + ',' + prev.lat + ']), (model.latlong_to_point [' + node.lon + ',' + node.lat + ']) ) ' | |
end | |
prev = node | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment