Created
August 27, 2013 09:22
-
-
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
This file contains hidden or 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
# 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