Storing Lat Lng values in MySQL using Spatial Point Type

前端 未结 4 1747
太阳男子
太阳男子 2020-12-04 09:44

Tech used: MySQL 5.1 and PHP 5.3

I am just designing a new database for a site I am writing. I am looking at the best way of now storing Lat and Lng values.

4条回答
  •  失恋的感觉
    2020-12-04 10:12

    Mysql GIS yagni:

    If you have no experience with GIS, learning spatial extensions is practically like learning a new database, plus a little math, and a lot of acronyms. Maps, projections, srids, formats... Do you have to learn all that to calculate distances between points given a certain lat/long: probably not, will you be integrating 3rd party GIS data or working with anything more complex than points, what coordinate system will you be using?

    Going back to yagni: do things as simple as posible, in this case implement your code in php or with simple SQL. Once you reach a barrier and decide you need spatial, read up on GIS system, coordinate systems, projects, and conventions.

    By then, you will probably want PostGIS.

提交回复
热议问题