Skip to content

Instantly share code, notes, and snippets.

@xnzac
Created August 27, 2013 09:22
Show Gist options
  • Save xnzac/6351464 to your computer and use it in GitHub Desktop.
Save xnzac/6351464 to your computer and use it in GitHub Desktop.
Add as_georss / as_kml methods as used by GeoRuby to RGeo::Cartesian::PointImpl
# add to config/initializers/
module GeoPointConversion
def as_georss
"<georss:point>#{y} #{x}</georss:point>\n"
end
def as_kml
"<Point>\n<coordinates>#{y},#{x}</coordinates>\n</Point>\n"
end
end
RGeo::Cartesian::PointImpl.send(:include, GeoPointConversion)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment