Geometrical shapes that can be used for various geo calculation purposes.
Work in progress…
Trying to refactor it to leverage geo- gems such as: geo_point, geo_vectors etc.
circle = Geo::Circle.new [10, 12], 5.km circle = Geo::Circle.new :center => [10, 12], :radius => 5.km rect = Geo::Rect.new [10, 12], [17, 18] rect = Geo::Rect.new [10, 12], [4, -3].vector rect = Geo::Square.new [10, 12], 2.km rect = Geo::Square.new :center => [10, 12], :radius => 2.km rect.overlaps? point rect.overlaps_any? *points rect.overlaps_all? *points # add vector to upper left point rect.upper_left + [2, -1].vector circle.random_points circle.random_points(5) => [5 points] rect.random_points(2)
Now also includes Radius functionality extracted from GeoMagic.
Contributing to geo_shapes
- Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet
- Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it
- Fork the project
- Start a feature/bugfix branch
- Commit and push until you are happy with your contribution
- Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.
- Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Copyright © 2011 Kristian Mandrup. See LICENSE.txt for