0.01
No commit activity in last 3 years
No release in over 3 years
Generates geographic coordinates randomly chosen near by the location and within the radius specified. It aims to provide a way to generate dummy data for geographical apps. NOTE that all results are approximate values since problems derived from the shape of the earth have not been taken into consideration.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
~> 2.14.1
 Project Readme

Random location

Description

Random location is simple tool to generate geographic coordinates randomly chosen near by the location and within the radius specified. It aims to provide a way to generate dummy data for geographical apps.

NOTE that all results are approximate values since problems derived from the shape of the earth have not been taken into consideration.

Installation

Add this line to your application's Gemfile:

gem 'random-location'

And then execute:

$ bundle

Or install it like any other Ruby gem:

gem install random-location

Usage

Once installed, require it:

require 'random-location'

Then, use its method specifying the coordinates of the reference point and the radius in meters

RandomLocation.near_by(41.38506, 2.17340, 10000)

It also comes with a CLI that can be used as follows:

$ random-location 41.38506 2.17340 10000
latitude = 41.41814, longitude = 2.24560

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request