Android wants to show sellers nearby, how many meters are displayed for sellers, and how to design coordinates for php databases-php Tutorial

Source: Internet
Author: User
Tags php database
Android wants to display nearby merchants, how many meters are displayed for sellers, how to design coordinates for php database android wants to display nearby merchants, and how many meters are displayed for sellers, how to Design coordinates for the php database ------ solution ------------------ minimum & nbsp; Longitude & nbsp; Latitude & nbsp; these two fields ~ & Nbsp android: shows the number of sellers in the vicinity and the coordinates of 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.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.