Correct datatype for latitude and longitude? (in activerecord)

前端 未结 6 1364
借酒劲吻你
借酒劲吻你 2021-01-30 03:07

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

6条回答
  •  借酒劲吻你
    2021-01-30 03:22

    If you're not using a spatially-enabled database, Google Maps recommends using floats of size (10,6). That gives you 6 digits after the decimal - if you want more precision, you can adjust accordingly.

提交回复
热议问题