What is the ideal data type to use when storing latitude / longitude in a MySQL database?

前端 未结 21 2741
梦如初夏
梦如初夏 2020-11-22 09:40

Bearing in mind that I\'ll be performing calculations on lat / long pairs, what datatype is best suited for use with a MySQL database?

21条回答
  •  孤城傲影
    2020-11-22 10:15

    Google provides a start to finish PHP/MySQL solution for an example "Store Locator" application with Google Maps. In this example, they store the lat/lng values as "Float" with a length of "10,6"

    http://code.google.com/apis/maps/articles/phpsqlsearch.html

提交回复
热议问题