Skip to content

Instantly share code, notes, and snippets.

module KmlParser
def self.parse(xml)
doc = Nokogiri::XML(xml)
output = {}
output[:polylines] = []
output[:markers] = []
doc.xpath('//xmlns:Placemark').each do |kmlplacemark|
if kmlplacemark.xpath('xmlns:LineString').empty?
point = kmlplacemark.xpath('xmlns:Point/xmlns:coordinates').text.split(',').map{|x| x.to_f}
icon = doc.css(kmlplacemark.xpath('xmlns:styleUrl').text).xpath('xmlns:IconStyle/xmlns:Icon/xmlns:href').text
@jesserundle
jesserundle / gist:4693541
Last active May 5, 2024 10:28
Installing Ruby, Rails, and mysql gem on Windows
Install Ruby using rubyinstaller:
http://rubyinstaller.org/downloads/
install to the C drive to a folder without spaces, eg c:/Ruby193
Install RubyGems:
http://rubyforge.org/frs/?group_id=126
on command line do:
'gem install rails'