C
C
cjitkul332017-06-05 20:06:16
MySQL
cjitkul33, 2017-06-05 20:06:16

What is the best way to store geo-routes in MySQL for searching them?

There are many (several hundred thousand) gps routes in gpx files. You need to overtake them in a sql-storage with the ability to search. Those. a certain square is given and you need to find which routes pass through this square.
As an example - we are looking for the square N-45 (the coordinates of the corners are known in advance), the output is a list of route id.
You need to use mySQL. Other options are not considered.
I've thought of two options so far:
1. 3 fields - lat (float), lon (float), routeId (int). Indexes on lat and lon. Using mathematical comparison, I find a distinct routeid in a given boundbox. Those. there are as many entries in the table as there are points in all routes.
2. 2 fields - route (multistring), routeId (int). There are as many entries in the table as there are routes. Each entry contains all waypoints.
Which option is less resource intensive and fastest?
Maybe there are better options?
UPD - postgresql lovers - well, pass by, it is clearly written that only MySQL, even the corresponding tag.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fixid, 2017-06-05
@Fixid

It will be correctly stored in postgresql with the postgis extension. All operations can be performed literally with one select at high speed

V
vvovas, 2017-06-06
@vvovas

Here is a good doc: https://www.scribd.com/presentation/2569355/Geo-Di...
They advise you to connect the sphinx.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question