Android wants to display the number of merchants in the vicinity, how to design coordinates for php database
Source: Internet
Author: User
Android requires nearby merchants to display, how many meters of businesses are displayed, how to design coordinates for php database android requires nearby merchants to display, how many meters of businesses are displayed, and how to design coordinates for php database, at least & nbsp; Longitude & nbsp; Latitude & nbsp ~ & Nbsp; then, you can use php or android to show the number of sellers in the nearby range and how to design coordinates for the php database.
Android needs to display the number of merchants in the vicinity, and how to design coordinates for php databases
------ Solution --------------------
At least two fields, longitude and latitude, are required ~ Then, you can use php or java to calculate the longitude and latitude of a certain point. the largest and smallest longitude and latitude of the center xx meters are the radius. in this way, you can get the four coordinate points. conditional shops with longitude and latitude, of course, this is the scope of a quadrilateral! It is troublesome to circle!
------ Solution --------------------
There are not many sellers in the meter range
But the number of meters the merchant is in.
Although it looks the same, the subject has changed.
The seller is the subject and his position is fixed. he will not move the seller because of your move.
You only need to save the merchant's coordinates.
------ Solution --------------------
This field exists in the child mysql itself.
------ Solution --------------------
Record the longitude and latitude of each seller.
Then calculate the distance between the current location and each seller
Create a distance calculation function in mysql to query it using SQL statements.
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