PHP le SQL: Bala kapa u botse sebaka se seholo sa selikalikoe pakeng tsa lintlha tsa Latitude le Longitude le Foromo ea Haversine

Foromo ea Haversine - Bala sebaka se seholo sa selikalikoe le PHP kapa MySQL

Khoeling ena ke ntse ke hlophisa hanyane ka PHP le MySQL mabapi le GIS. Ho lla ho potoloha letlooa, ke bile le bothata ba ho fumana tse ling tsa Lipalo tsa Geographic ho fumana sebaka se pakeng tsa libaka tse peli ka hona ke ne ke batla ho li arolelana mona.

'Mapa oa sefofane Europe o na le sebaka se seholo sa selikalikoe

Tsela e bonolo ea ho bala sebaka se pakeng tsa lintlha tse peli ke ho sebelisa mokhoa oa Pythagorean ho bala khopolo-taba ea triangolo (A² + B² = C²). Sena se tsejoa e le Sebaka sa Euclidean.

Ke qalo e khahlisang empa ha e sebetse le Geography kaha sebaka se lipakeng tsa mela le bolelele se teng eseng sebaka se lekanang arohana. Ha u ntse u atamela equator, mela ea latitude e ea arohana. Haeba u sebelisa mofuta o mong oa equation e bonolo ea triangulation, e ka lekanya sebaka ka nepo sebakeng se seng mme e fosahetse hampe ho se seng, ka lebaka la ho kobeha ha Lefatše.

Sebaka se seholo sa selikalikoe

Litsela tse tsamauoang libaka tse telele ho potoloha Lefatše li tsejoa e le Sebaka se seholo sa selikalikoe. Ke hore… sebaka se sekhutšoaane lipakeng tsa lintlha tse peli tse lebaleng se fapane le lintlha tse 'mapeng o sephara. Kopanya seo le taba ea hore bolelele le bolelele ha li lekane… 'me u na le lipalo tse thata.

Mona ke tlhaloso e ntle ea video ea kamoo li-Circles tse kholo li sebetsang kateng.

Foromo ea Haversine

Sebaka se sebelisang ho kobeha ha Lefatše se kenyelelitsoe ho Morero oa Haversine, e sebelisang trigonometry ho lumella ho kobeha ha lefatše. Ha o fumana sebaka se pakeng tsa libaka tse 2 lefatšeng (joalo ka ha lekhoaba le fofa), mola o otlolohileng ehlile ke arc.

Sena se sebetsa le sefofaneng sa moea - na o kile oa sheba 'mapa oa lifofane mme oa hlokomela hore li arched? Ke hobane e khuts'oane ho fofa sebakeng se pakeng tsa lintlha tse peli ho feta ka kotloloho ho ea sebakeng seo.

PHP: Bala Palo lipakeng tsa lintlha tse 2 tsa Latitude le Longitude

Leha ho le joalo, ena ke mokhoa oa PHP oa ho bala sebaka se lipakeng tsa lintlha tse peli (hammoho le phetoho ea Mile vs. Kilometer) ho isa libakeng tse peli tsa decimal.

function getDistanceBetweenPointsNew($latitude1, $longitude1, $latitude2, $longitude2, $unit = 'miles') {
  $theta = $longitude1 - $longitude2; 
  $distance = (sin(deg2rad($latitude1)) * sin(deg2rad($latitude2))) + (cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) * cos(deg2rad($theta))); 
  $distance = acos($distance); 
  $distance = rad2deg($distance); 
  $distance = $distance * 60 * 1.1515; 
  switch($unit) { 
    case 'miles': 
      break; 
    case 'kilometers' : 
      $distance = $distance * 1.609344; 
  } 
  return (round($distance,2)); 
}

SQL: Ho khutlisa lirekoto tsohle ka har'a mokoloko ka ho bala bolelele ba limithara ho sebelisa bolelele le bolelele

Hape hoa khoneha ho sebelisa SQL ho etsa lipalo ho fumana litlaleho tsohle sebakeng se itseng. Mohlala ona, ke tla botsa MyTable ho MySQL ho fumana lirekoto tsohle tse ka tlase ho kapa tse lekanang le sebaka se fapaneng sa $ (ho Miles) ho ea sebakeng sa ka ho $ latitude le $ longitude:

Potso ea ho fumana lirekoto tsohle ka har'a e itseng distanta ka ho bala sebaka se bohole pakeng tsa lintlha tse peli tsa latitude le longitude ke:

$query = "SELECT *, (((acos(sin((".$latitude."*pi()/180)) * sin((`latitude`*pi()/180)) + cos((".$latitude."*pi()/180)) * cos((`latitude`*pi()/180)) * cos(((".$longitude."- `longitude`)*pi()/180)))) * 180/pi()) * 60 * 1.1515) as distance FROM `table` WHERE distance <= ".$distance."

U tla hloka ho etsa sena ka mokhoa oa hau:

  • $ longitude - ona ke phapang ea PHP moo ke fetisang bolelele ba ntlha.
  • $ latitude - ona ke phapang ea PHP moo ke fetisang bolelele ba ntlha.
  • $ hole - Ena ke sebaka seo u ka ratang ho fumana lirekoto tsohle li le tlase kapa se lekana.
  • tafoleng - Ena ke tafole… u tla batla ho e nkela sebaka ka lebitso la tafole ea hau.
  • latitude - ena ke tšimo ea bolokolohi ba hau.
  • longitude - ena ke tšimo ea bolelele ba hau.

SQL: Ho fumana lirekoto tsohle ka har'a mokoloko ka ho bala bohole ba lik'hilomithara ho sebelisa bolelele le bolelele

Mona ke potso ea SQL e sebelisang kilometara ho MySQL:

$query = "SELECT *, (((acos(sin((".$latitude."*pi()/180)) * sin((`latitude`*pi()/180)) + cos((".$latitude."*pi()/180)) * cos((`latitude`*pi()/180)) * cos(((".$longitude."- `longitude`) * pi()/180)))) * 180/pi()) * 60 * 1.1515 * 1.609344) as distance FROM `table` WHERE distance <= ".$distance."

U tla hloka ho etsa sena ka mokhoa oa hau:

  • $ longitude - ona ke phapang ea PHP moo ke fetisang bolelele ba ntlha.
  • $ latitude - ona ke phapang ea PHP moo ke fetisang bolelele ba ntlha.
  • $ hole - Ena ke sebaka seo u ka ratang ho fumana lirekoto tsohle li le tlase kapa se lekana.
  • tafoleng - Ena ke tafole… u tla batla ho e nkela sebaka ka lebitso la tafole ea hau.
  • latitude - ena ke tšimo ea bolokolohi ba hau.
  • longitude - ena ke tšimo ea bolelele ba hau.

Ke sebelisitse khoutu ena sethaleng sa 'mapa sa khoebo seo re se sebelisitseng lebenkeleng le nang le libaka tse fetang 1,000 XNUMX ho la Amerika Leboea mme e ne e sebetsa hantle.

76 Comments

  1. 1

    Ke leboha haholo ka ho arolelana. Ona e ne e le mosebetsi oa ho kopitsa le ho beha habonolo mme o sebetsa hantle. U mpholositse nako e ngata.
    FYI bakeng sa mang kapa mang ea kenang ho C:
    habeli deg2rad (habeli deg) {khutla deg * (3.14159265358979323846 / 180.0); }

  2. 2

    Sekhechana se setle haholo sa poso - se sebelitse hantle haholo - ke ne ke tlameha feela ho fetola lebitso la tafole e tšoereng nako e telele. E sebetsa ka potlako ho .. Ke na le palo e nyane ea lat-longs (<400) empa ke nahana hore sena se tla nyoloha hantle. Sebaka se setle sa marang-rang - ke sa tsoa se kenya ho ak'haonte ea ka ea del.icio.us mme ke tla sheba khafetsa.

  3. 4
  4. 5

    Ke batlile letsatsi lohle bakeng sa lipalo tsa sebaka mme ka fumana algorithm ea harversine, ke leboha uena ka ho fana ka mohlala oa hore na u ka e beha joang polelong ea sql. Kea leboha ebile rea lumelisa, Daniel

  5. 8

    ke nahana hore SQL ea hau e hloka polelo e nang le polelo.
    sebakeng sa WHERE hole <= $ hole eo u ka hlokang
    sebelisa HAVING hole <= $ hole

    ho seng joalo leboha ka ho mpolokela nako le matla.

  6. 10
  7. 11
  8. 12

    Ke leboha haholo ka ho arolelana khoutu ena. E mpholositse nako e ngata ea ntlafatso. Hape, re leboha babali ba hau ka ho supa hore polelo ea HAVING ea hlokahala bakeng sa MySQL 5.x. E thusa haholo.

  9. 14
  10. 15

    Lumela,

    Potso e 'ngoe. Na ho na le foromo ea likhoele tsa NMEA joalo ka e ka tlase?

    1342.7500, N, 10052.2287, E

    $GPRMC,032731.000,A,1342.7500,N,10052.2287,E,0.40,106.01,101106,,*0B

    Thanks,
    Harry

  11. 16

    Ke fumane hape hore WHERE ha e sebetse ho nna. E fetotse HAVING mme tsohle li sebetsa hantle. Qalong ke ne ke sa bale litlhaloso ebe ke li ngola hape ke sebelisa sehlaha khetha. Ka bobeli li tla sebetsa hantle.

  12. 17
  13. 18

    E thusa ka mokhoa o makatsang, ke leboha haholo! Ke ne ke na le mathata ka "HAVING" e ncha, ho fapana le hore "HOO", empa hang ha ke bala litlhaloso mona (kamora halofo ea hora ea ho tsikitlanya meno ka ho ferekana = P), ke ile ka e sebetsa hantle. Kea leboha ^ _ ^

  14. 19
  15. 20

    Hopola hore polelo e khethiloeng joalo e tla ba matla haholo ka likhomphutha mme ka hona e liehe. Haeba u na le lipotso tse ngata, e ka koala lintho kapele haholo.

    Mokhoa o seng matla haholo ke ho sebelisa khetho ea pele (e sa hlonepheng) o sebelisa sebaka sa SQUARE se hlalositsoeng ke sebaka se baliloeng ke hore, "khetha * ho tloha tafoleng ea lebitso moo sebaka se pakeng tsa lat1 le lat2 le longitude lipakeng tsa lon1 le lon2". lat1 = targetlatitude - latdiff, lat2 = targetlatitude + latdiff, e ts'oanang le lon. latdiff ~ = hole / 111 (bakeng sa km), kapa hole / 69 bakeng sa limaele ho tloha ha 1 latitude e le ~ 111 km (phapang e nyane ho tloha ha lefats'e le le motopo o monyane, empa le lekane molemong ona). londiff = hole / (abs (cos (deg2rad (latitude)) * 111)) - kapa 69 bakeng sa limaele (o ka nka sekwere se seholo hanyane bakeng sa ho ikarabella bakeng sa phapang). Ebe u nka sephetho sa seo ebe u se fepa ka khetho ea radial. Se ke oa lebala ho ikarabella bakeng sa likhokahanyo tse kantle ho meeli - ke hore, bolelele ba bolelele bo amohelehang ke -180 ho +180 'me sebaka sa sebaka se amohelehang ke -90 ho isa ho + 90 - haeba latdiff kapa londiff ea hau e ka ba ka ntle ho sebaka sena. . Hlokomela hore maemong a mangata sena se kanna sa se sebetse hobane se ama feela lipalo holim'a moeli ho pholletsa le leoatle la pacific ho tloha pole ho ea pole, leha e kopanya karolo ea chukotka le karolo ea alaska.

    Seo re se fihlellang ka sena ke phokotso e kholo palo ea lintlha tseo u etsang palo ena khahlanong le tsona. Haeba u na le lintlha tse milione lefats'eng ka bophara tse tsamaisitsoeng ka mokhoa o ts'oanang 'me u batla ho batla ka har'a 100 km, patlo ea hau ea pele (e potlakileng) ke sebaka sa 10000 sq km mme mohlomong e tla hlahisa litholoana tse ka bang 20 (ho ipapisitsoe le kabo e fetang sebaka se ka bang 500M sq km), ho bolelang hore o tsamaisa palo e rarahaneng ea lipalo makhetlo a 20 bakeng sa potso ena ho fapana le makhetlo a milione.

    • 21
      • 22

        Keletso e makatsang! Ke hlile ke sebelitse le moqapi ea ngotseng ts'ebetso e hulang sekwere se kahare ebe e etsa mosebetsi o iphetang o entseng 'lisekoere' ho potoloha moeli ho kenyelletsa le ho khetholla lintlha tse setseng. Sephetho e bile sephetho se potlakileng ka mokhoa o makatsang - o ne a ka lekola lintlha tse limilione ka li-microseconds.

        Mokhoa oa ka o kaholimo o hlile o `` sa hlonepha '' empa oa khona. Ke leboha hape!

        • 23

          Doug,

          Ke ntse ke leka ho sebelisa mysql le php ho lekola hore na ntlha e telele e ka hare ho polygon. Na ua tseba hore na motsoalle oa hau oa moqapi o phatlalalitse mehlala efe kapa efe ea ho etsa mosebetsi ona. Kapa na u tseba mehlala e metle. Kea leboha.

  16. 24

    Kea le lumelisa bohle ena ke polelo ea ka ea SQL ea teko:

    SELECT DISTINCT area_id, (
    (
    (
    acos( sin( ( 13.65 * pi( ) /180 ) ) * sin( (
    `lat_dec` * pi( ) /180 ) ) + cos( ( 13.65 * pi( ) /180 ) ) * cos( (
    `lat_dec` * pi( ) /180 )
    ) * cos( (
    ( 51.02 - `lon_dec` ) * pi( ) /180 )
    )
    )
    ) *180 / pi( )
    ) *60 * 1.1515 * 1.609344
    ) AS distance
    FROM `post_codes` WHERE distance <= 50

    mme Mysql o ntse a mpolella hore hole joalo, ha e eo e le kholomo, nka sebelisa odara ka, nka e etsa ntle le HONA, mme ea sebetsa, empa eseng le eona…

  17. 26

    Hona ho hotle, leha ho le joalo ho joalo feela ka ha linonyana li fofa. Ho ka ba hotle ho leka ho kenyelletsa limmapa tsa google ho sena ka tsela e itseng (mohlomong ho sebelisa litsela jj.) Ho fana ka mohopolo feela u sebelisa mokhoa o fapaneng oa lipalangoang. Ke ntse ke sa tlameha ho etsa ts'ebetso e ts'oanelang ea ho kenya linoko ho PHP e tla khona ho fana ka tharollo e sebetsang bothateng ba morekisi ea tsamaeang. Empa ke nahana hore nka khona ho sebelisa tse ling tsa khoutu ea hau ho etsa joalo.

  18. 27
  19. 28

    Sengoloa se setle! Ke fumane lingoliloeng tse ngata tse hlalosang mokhoa oa ho lekanya sebaka se pakeng tsa lintlha tse peli empa ke ne ke hlile ke batla snippet ea SQL.

  20. 29
  21. 30
  22. 31
  23. 32
  24. 36

    Matsatsi a 2 a lipatlisiso hore qetellong ke fumane leqephe lena le rarollang bothata ba ka. Ho bonahala eka nka ntlafatsa WolframAlpha ea ka 'me ka hlatsoa lipalo tsa ka. Phetoho ho tloha HA HO ea HAVING e na le sengoloa sa ka se sebetsang. KEA LEBOHA

  25. 37
    • 38
  26. 39

    Ke lakatsa eka ena e ne e le leqephe la pele leo ke le fumaneng ho lona. Kamora ho leka litaelo tse ngata tse fapaneng ena ke eona feela e neng e ka sebetsa hantle, 'me ka liphetoho tse fokolang tse hlokahalang ho lekana database ea ka.
    Ke leboha haholo!

  27. 40

    Ke lakatsa eka ena e ne e le leqephe la pele leo ke le fumaneng ho lona. Kamora ho leka litaelo tse ngata tse fapaneng ena ke eona feela e neng e ka sebetsa hantle, 'me ka liphetoho tse fokolang tse hlokahalang ho lekana database ea ka.
    Ke leboha haholo!

  28. 41
  29. 42
  30. 43
  31. 45
  32. 46
  33. 47

    Kea tseba hore moralo ona oa sebetsa, empa ha ke bone hore na radius ea lefats'e e nkuoa joang. Ka kopo, na ho na le motho ea ka nts'isetsang?

  34. 49
  35. 50

    Lintho tse kholo Douglas. Na o kile oa leka ho fumana sebaka sa mateano a litsela se fuoeng Long / Lat / Bearing ea lintlha tse peli?

  36. 52

    Kea leboha Douglas, Potso ea SQL ke sona hantle seo ke neng ke se hloka, mme ke ile ka nahana hore ke tla tlameha ho se ngola ka bonna. U mpholositse ho tloha molemong oa ho ithuta bolelele ba lihora tse latitude!

  37. 53
  38. 55
  39. 56
  40. 58

    kea leboha ka ho beha sengoloa sena se thusang,  
    empa ka lebaka le itseng ke kopa ho botsa
    U ka fumana sebaka se pakeng tsa likhoele kahare ho mysql db le li-coord tse kentsoeng ho php ke mosebelisi?
    ho hlalosa ka ho hlaka:
    1.user o tlameha ho kenya [id] bakeng sa ho khetha lintlha tse boletsoeng ho tsoa ho li-db le li-coord tsa mosebelisi ka boeona
    Faele ea 2.php e fumana lintlha tse lebisitsoeng (li-coord) u sebelisa [id] ebe u bala sebaka se pakeng tsa mosebelisi le ntlha e lebisitsoeng

    kapa na u ka fumana hole feela le khoutu e ka tlase?

    $ qry = “KHETHA *, (((acos (sin ((“. $ latitude. ”* pi () / 180)) * sebe ((` Latitude` * pi () / 180)) + cos ((“. $ latitude. ”* pi () / 180)) * cos ((` Latitude` * pi () / 180)) * cos (((“. $ longitude.” - `Longitude`) * pi () / 180) ))) * 180 / pi ()) * 60 * 1.1515 * 1.609344) e le bohole HO TLOHA` MyTable` WHERE hole> = “. $ Distance.” >>>> na nka "tlosa" hole ho tloha mona?
    ke leboha hape,
    Timmy S

    • 59

      ho sa tsotelehe, ke bone hore na "ts'ebetso" e sebetsa joang ho php
      $ dis = getDistanceBetweenPointsNew ($ userLati, $ userLongi, $ lati, $ longi, $ unit = 'Km')
      ke leboha haholo!! 

  41. 60

    ho lokile, ntho e ngoe le e ngoe eo ke e lekileng ha e sebetse. Ke bolela hore seo ke nang le sona sea sebetsa, empa libaka li hole haholo.

    Na ho na le motho ea ka bonang se phoso ka khoutu ee?

    haeba (isset ($ _ POST ['submitted'])) {$ z = $ _POST ['zipcode']; $ r = $ _POST ['radius']; echo "Liphetho tsa". $ z; $ sql = mysql_query ("KHETHA KHETHO m.zipcode, m.MktName, m.LocAddSt, m.LocAddCity, m.LocAddState, m.x1, m.y1, m.verified, z1.lat, z2.lon, z1. toropo, z1.state HO TSOA mrk m, zip z1, zip z2 HOKAE m.zipcode = z1.zipcode LE z2.zipcode = $ z LE (3963 * acos (truncate (sin (z2.lat / 57.2958) * sin (m. y1 / 57.2958) + cos (z2.lat / 57.2958) * cos (m.y1 / 57.2958) * cos (m.x1 / 57.2958 - z2.lon / 57.2958), 8))) <= $ r ") kapa shoa (mysql_error ()); ha ($ row = mysql_fetch_array ($ sql)) {$ store1 = $ mola ['MktName']. "”; $ store = $ mola ['LocAddSt']. ””; $ store. = $ row ['LocAddCity']. ”,". $ row ['LocAddState']. ” ". $ Mola ['zipcode"]; $ latitude1 = $ mola ['lat']; $ longitude1 = $ mola ['lon']; $ latitude2 = $ mola ['y1']; $ longitude2 = $ mola ['x1']; $ toropo = $ mola ['motse']; $ state = $ mola ['state']; $ dis = fumana ncha ($ latitude1, $ longitude1, $ latitude2, $ longitude2, $ unit = 'Mi'); // $ dis = hole ($ lat1, $ lon1, $ lat2, $ lon2); $ netefalitsoeng = $ row ['netefalitsoeng']; haeba ($ verified == '1') {echo "”; echo "". $ lebenkele. ""; hlakola $ dis. "Bohōle ba lik'hilomithara"; pheta ""; } tse ling {echo "". $ store. ""; hlakola $ dis. "Bohōle ba lik'hilomithara"; pheta ""; }}}

    my code.php khoutu
    sebetsa getnew ($ latitude1, $ longitude1, $ latitude2, $ longitude2, $ unit = 'Mi') {$ theta = $ longitude1 - $ longitude2; $ hole = (sebe (deg2rad ($ latitude1)) * sebe (deg2rad ($ latitude2)) + + (cos (deg2rad ($ latitude1)) * cos (deg2rad ($ latitude2)) * cos (deg2rad ($ theta)) ); $ hole = acos ($ hole); $ hole = rad2deg ($ hole); $ hole = $ hole * 60 * 1.1515; fapoha ($ unit) {case 'Mi': break; nyeoe ea 'Km': $ hole = $ hole * 1.609344; } khutla (potoloha ($ hole, 2)); }

    kea leboha

  42. 61
  43. 62

    Hey Douglas, sengoloa se setle. Ke fumane tlhaloso ea hau ea likhopolo tsa libaka le khoutu e khahlisa haholo. Tlhahiso ea ka feela e ne e tla ba ho beha sebaka le ho hlahisa khoutu bakeng sa pontšo (joalo ka Stackoverflow, mohlala). Kea utloisisa hore u batla ho boloka sebaka, empa mokhoa o tloaelehileng oa ho arola khoutu / khokahano o tla etsa hore ho be bonolo haholo ho nna, joalo ka moqapi, ho e bala le ho e arola. Leha ho le joalo, ke ntho e nyane. Tsoela pele ka mosebetsi o motle.

  44. 64
  45. 65

    mona ha re ntse re sebelisa ts'ebetsong re ntse re fumana mofuta o mong oa sebaka .. ha re ntse re sebelisa lipotso ke mofuta o mong oa sebaka sa ona o tlang

  46. 66
  47. 67
  48. 68
  49. 69
  50. 70

    e bonahala e potlakile (mysql 5.9) ho sebelisa foromo habeli ho khetho le moo:
    $ formula = “(((acos (sin ((“. $ latitude. ”* pi () / 180)) * sebe ((` Latitude` * pi () / 180)) + cos ((“. $ latitude. ”* Pi () / 180)) * cos ((` Latitude` * pi () / 180)) * cos (((“. $ Longitude.” - `Longitude`) * pi () / 180))))) * 180 / pi ()) * 60 * 1.1515 * 1.609344) ";
    $ sql = 'KHETHA *,'. $ foromo. ' joalo ka sebaka HO TLOHA tafoleng HO HOKA'' $ formula. ' <= '. $ hole;

  51. 71
  52. 72

    Ke leboha haholo ka ho kuta sengoloa sena.se thusa haholo.
    Qalong PHP e ne e entsoe e le sethala se bonolo sa mongolo se bitsoang "Leqephe la Lehae la Botho". Matsatsing ana PHP (e khuts'oane bakeng sa Hypertext Preprocessor) ke mokhoa o mong oa mahlale a Microsoft's Active Server Pages (ASP).

    PHP ke puo e bulehileng ea lehlakore la seva e sebelisetsoang ho etsa maqephe a mahlale a maholo. E ka kenngoa ho HTML. Hangata PHP e sebelisoa hammoho le database ea MySQL ho li-server tsa Linux / UNIX. Mohlomong ke puo e tsebahalang haholo ea mongolo.

  53. 73

    Ke fumane tharollo e kaholimo e sa sebetse hantle.
    Ke hloka ho fetohela ho:

    $ qqq = “KHETHA *, (((acos (sin ((“. $ latitude. ”* pi () / 180)) * sebe ((` latt` * pi () / 180)) + cos ((”. $ latitude. "* pi () / 180)) * cos ((` latt` * pi () / 180)) * cos (((". $ longitude." - `longt`) * pi () / 180) ))) * 180 / pi ()) * 60 * 1.1515) joalo ka sebaka ho tloha `ngolisong` `;

  54. 75
  55. 76

    Lumela, ka kopo ke tla hloka thuso ea hau ho sena.

    Ke entse kopo ho seva sa ka sa webo http://localhost:8000/users/findusers/53.47792/-2.23389/20/
    53.47792 = Latitude la $
    -2.23389 = bolelele ba $
    le 20 = sebaka seo ke batlang ho se lata

    Leha ho le joalo ha u sebelisa foromo, e fumana mela eohle ho db ea ka

    $ results = DB :: khetha (DB :: raw ("SELECT *, (((acos (sin ((". $ latitude. "* pi () / 180)) * sebe ((lat * pi () / 180) )) + cos ((“. $ latitude.” * pi () / 180)) * cos ((lat * pi () / 180)) * cos (((“. $ longitude.” - lng) * pi ( ) / 180)))) * 180 / pi ()) * 60 * 1.1515 * 1.609344) joalo ka hole ho tloha ho litsupa HO NA le sebaka> = “. $ Hole));

    [{"Id": 1, "name": "Frankie Johnnie & Luigo Too", "aterese": "939 W El Camino Real, Mountain View, CA", "lat": 37.386337280273, "lng": - 122.08582305908, "Distance": 16079.294719663}, {"id": 2, "name": "Amici's East Coast Pizzeria", "aterese": "790 Castro St, Mountain View, CA", "lat": 37.387138366699, "lng": -122.08323669434, ”hole”: 16079.175940152}, {“id”: 3, ”name”: ”Kapp's Pizza Bar & Grill”, ”aterese”: ”191 Castro St, Mountain View, CA”, ”lat”: 37.393886566162, "Lng": - 122.07891845703, "hole": 16078.381373826}, {"id": 4, "name": "Round Table Pizza: Mountain View", "address": "570 N Shoreline Blvd, Mountain View, CA", "Lat": 37.402652740479, "lng": - 122.07935333252, "distance": 16077.420540582}, {"id": 5, "name": "Tony & Alba's Pizza & Pasta", "aterese": ”619 Escuela Ave, Mountain Sheba, CA "," lat ": 37.394012451172," lng ": - 122.09552764893," hole ": 16078.563225154}, {" id ": 6," name ":" Pizza ea Wood-Fired ea Oregano "," aterese ":” 4546 El Camino Real, Los Altos, CA "," lat ": 37.401725769043," lng ": - 122.11464691162," sebaka ": 16077.937560795}, {" id ”: 7,” name ”:" The bars and grills "," aterese ":" 24 Whiteley Street, Manchester "," lat ": 53.485118865967," lng ": - 2.1828699111938," hole ": 8038.7620112314}]

    Ke batla ho lata mela e nang le li-mile tsa 20 empa e tlisa mela eohle. Ke kopa o etse phoso

U nahana eng?

Sebaka sena se sebelisa Akismet ho fokotsa spam. Ithute kamoo litlhaloso tsa hau li hlahang kateng.