Guest User

Untitled

a guest
Jul 23rd, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. require 'rubygems'
  2. require 'ruby-opengeodb'
  3.  
  4. # Verbindung zur Datenbank aufbauen
  5. Location.db_connect(adapter="mysql",
  6. host="localhost",
  7. username="root",
  8. password="xxxx",
  9. database="opengeodb",
  10. socket="/var/run/mysqld/mysqld.sock"
  11. )
  12.  
  13. locations = %w(13359 67059 90459 56068 69115)
  14. # = Berlin, Ludwigshafen, Nuernberg, Koblenz, Heidelberg
  15.  
  16. locations.each { |plz|
  17. location = Location.new(plz)
  18. puts "PLZ: #{plz} Ort: #{location.ort} Lat: #{location.lat} Lon: #{location.lon}
  19. "
  20. }
Add Comment
Please, Sign In to add comment