Skip to content
Snippets Groups Projects
Commit 79f5be36 authored by Eliot Sykes's avatar Eliot Sykes
Browse files

Add notes on accuracy and data types to README (issue #477)

https://github.com/alexreisner/geocoder/issues/477
parent 47725614
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@ Object Geocoding
Your model must have two attributes (database columns) for storing latitude and longitude coordinates. By default they should be called `latitude` and `longitude` but this can be changed (see "Model Configuration" below):
# Numeric data types other than float are supported, see 'Data Types and Accuracy' section
rails generate migration AddLatitudeAndLongitudeToModel latitude:float longitude:float
rake db:migrate
......@@ -604,6 +605,13 @@ When you install the Geocoder gem it adds a `geocode` command to your shell. You
There are also a number of options for setting the geocoding API, key, and language, viewing the raw JSON reponse, and more. Please run `geocode -h` for details.
Data Types and Accuracy
-----------------------
Geocoder works with any numeric column type (e.g. float, double, decimal) on which trig (and other mathematical) functions can be performed.
A summary on the relationship between location accuracy and the number of decimal places in latitude and longitude degree values is available at http://en.wikipedia.org/wiki/Decimal_degrees#Accuracy (as an example, at the equator, degree values with 4 decimal places give about 11 metres accuracy, whereas 5 decimal places gives roughly 1 metre accuracy).
Notes on MongoDB
----------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment