Koordinat üzerinden mesafe hesaplama

Google map yada benzeri sayisal haritalama sistemlerinden aldiginiz koordinat bilgileri arasindaki kuş uçuşu mesafeleri aşagıdaki sql kodu ile hesaplayabilirsiniz.

    SELECT *,( 6371 * acos( cos( radians(28.9905166625977) )
                         * cos( radians( lat ) ) * cos( radians( lng ) – radians(41.0595502142225) )
                         + sin( radians(28.9905166625977) ) * sin( radians( lat ) ) ) ) AS distance
                         FROM map
                         HAVING distance < 100000 ORDER BY distance
No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>