Skip to content

Instantly share code, notes, and snippets.

Created December 11, 2012 23:13
Show Gist options
  • Save anonymous/4263226 to your computer and use it in GitHub Desktop.
Save anonymous/4263226 to your computer and use it in GitHub Desktop.
Use RGeo to get the centre-point of a bounding box
require 'rgeo'
g = RGeo::Geographic.simple_mercator_factory
n, e, s, w = 50, 40, 10, 20
box = RGeo::Geographic::ProjectedWindow.bounding_points([g.point(w,s), g.point(e,n)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment