480575 MySQL Function to Calculate Distance

I need a function to be stored in MySQL. The function calculates the distance in miles between a latitude and longitude parameter and a "latitude" and "longitude" field in a database table. If the latitude or longitude in the database is 0, the function should return some large number (e.g. 99999999).

To improve calculation speed, a third parameter distance_limit is added to create a bounding box for the search, where a 0 value is ignored (all records are searched) and a non-zero number creates a box n miles in each direction. Latitudes or longitudes outside the box return 99999999, reducing the requirement to calculate those distances.

The function will be used (for example) as such:

SELECT DISTANCE(41.345, [url removed, login to view], 2) as dist, [url removed, login to view], [url removed, login to view] FROM users WHERE dist < 2.0

Beceriler: Her şey Kabul, MySQL

Daha fazlasını gör: number function, function number, mysql search table, latitude longitude table, mysql search database table, function search, mysql create table, distance search, distance calculate, create search function, mysql distance, mysql longitude latitude, distance table, mysql select box, create search function database, create table mysql, calculate value, distance calculation, bounding, search box function, function search box, box mysql, mysql select, mysql records, direction calculation

İşveren Hakkında:
( 2 değerlendirme ) East Hampton, United States

Proje NO: #2226485



Let do it... Thanks jain

1 gün içinde %selectedBids___i_sum_sub_4%%project_currencyDetails_sign_sub_5% USD
(96 Değerlendirme)