Should I store latitude and longitude as strings or floats (or something else)?
(I’m using activerecord / ruby on rails, if that matters).
Update:
Mysql in development and postgresql in production (why does it matter?)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you need to do more complex geographical calculations, you can investigate PostGIS for Postgresql or MySQL Spatial Extensions for MySQL. Otherwise, a float (double precision might be a good idea) should work.
Edit: It looks like the GeoRuby library includes a Rails extension for working with the spatial/GIS extensions for both of the aforementioned databases.