What is the best way to store a polyline (google maps) in a database?

Sorry, my English first ... I have to store a lot of polylines in the database. It occurred to me to create a table call of the “point” and save all the points from each polyline. Another thing that occurred to me was to serialize (with php) polylines and store each polylin in one line

Which option is better?

Thank you very much

+3
source share
5 answers

If you are not married to MySQL, PostgreSQL has a PostGIS extension that initially processes geographic data, including queries against it.

MySQL, , . , .

+3

, .

.

0

/. Polyline.

. / , , .

.:)

0

Creating a point table with a different relation that maps the set to a polyline / polygon is good practice. With this approach, I wrote several GIS schemas. Yes, some databases have spatial extensions, but you can do a lot of work to simply configure individual points, scale them with.

There is a normalization, I use it.

0
source

Mysql has an extension for spatial data, here is the link: http://dev.mysql.com/doc/refman/5.7/en/spatial-extensions.html hope this helps someone.

0
source

Source: https://habr.com/ru/post/1785532/


All Articles