Distance unit modules and functionality for use in geo libraries
MIT License
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. Status update (Sept 21, 2011)
GeoUnits is currently undergoing a major refactoring effort in order to group functionality in a more granular fashion, to allow for greater flexibility. Also, the new GeoUnits will not specifically target use for geo calculations for Earth, but also other globes/worlds, such as in a fantasy setting, planets, suns etc. Please help in this effort :)
The master branch has now been updated in order to allow specification of the order:
Set the GeoUnit.default_coords_order
to fit your usage scenario.
GeoUnit.default_coords_order = :lng_lat
GeoUnit.default_coords_order = :lat_lng
All specs pass again and the dependencies have been updated :)
h2. GeoUnits API
h2. Core extensions API
h2. Dms Converter
module GeoUnits::DmsConverter
h2. Numeric conversions
module GeoUnits::NumericExt
This module is included on the Fixnum and Float classes
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
h2. Copyright
Copyright (c) 2011 Kristian Mandrup. See LICENSE.txt for further details.