h1. Geo Units Distance unit functionality (conversions etc.) for Geo libraries. See specs for details. This gem is used by the _geo_point_ and _geo_calc_ gems and perhaps by others. The aim is that it will contain most of the basic distance unit functionality required by typical Geo projects. h2. Usage in Gemfile: @gem 'geo_units'@ Then run the bundler! @$ bundle@ h2. GeoUnits API
GeoUnits.key(:foot) # will convert any kind of unit into one of (:feet, :meters, :kms, :miles, :radians) => :feet
GeoUnits.kms_to :meters, 5 # convert number of one distance unit to another unit => 5000h2. Core extensions API
2.radians_to(:kms) => 222.34
@2.miles_to(:kms) => 3.21h2. Dms Converter module _GeoUnits::DmsConverter_ * parse_dms(string) * to_dms(deg, format = :dms, dp = nil) h2. Numeric conversions module _GeoUnits::NumericExt_ This module is included on the _Fixnum_ and _Float_ classes * to_lat * to_lng * to_dms * to_lat_dms * to_lon_dms * to_rad * to_deg * normalize_lng * normalize_lat * normalize_deg(shift) h2. Using specific GeoUnits modules The main GeoUnits module consist of various sub-modules that can be used on a case basis. Including the _GeoUnits_ module will include and extend the base class with all these sub-modules. class MyGeoThingy include GeoUnits::Maps # various maps, mapping unit to some distance etc. extend GeoUnits::Constants # useful geo constants ... end h2. Contributing to geo_units * 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. h2. Copyright Copyright (c) 2011 Kristian Mandrup. See LICENSE.txt for further details.