Baidu map, how to search according to a coordinate point in the database near the distance of the n coordinate points
Source: Internet
Author: User
Baidu map, how to search for a coordinate point in the database near the number of the distance of n coordinate points
Environment: Php+mysql
The existing database holds some latitude and longitude (100W or more) coordinate points,
What if I get all the information within 1 miles of the vicinity based on a coordinate point?
The Longitude field in the database for the LNG latitude field Lat:
Baidu map is used.
Online and so on thank you.
------Solution--------------------
Sort coordinate columns
To filter the Euclidean distance to the qualifying record
------Solution--------------------
I think so:
Since there is a center point latitude and longitude, then according to the dimension, calculate the latitude and longitude in accordance with the approximate range of n kilometers. The result of this search is a 2n*2n square,
For example, north latitude 34.5°,1 km there is no need to find latitude 35+ or 34-point, the specific can be converted in the program
However, it is necessary to filter part of the circle outside the radius n,
If this is possible, as long as the LNG LAT Joint index, million scale, very fast
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service