Answer the question
In order to leave comments, you need to log in
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
It will be correctly stored in postgresql with the postgis extension. All operations can be performed literally with one select at high speed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question