2

I have a table with latitude(lat) and longitude(lng).

I want to get results with in a 35 kilometers (20 miles) radius.

I have a central latitude of "-38.156900" and longitude of "144.349150".

Using MySQL how can I work this out?

Any help will be appreciated.

Chris Maher
  • 43
  • 1
  • 3
  • 1
    @JohnConde that is quite a different question, this is to find objects within a single point radius, rather than the distance between two fixed points. – diagonalbatman Jan 03 '14 at 17:20
  • @diagonalbatman that's the same, you just construct the `where` condition. If you look at the linked answer he's doing exactly the same: `having distance < 10` – Tomas Jan 03 '14 at 17:32

1 Answers1

3

There is a really good guide to this here, which also talks about some of the performance aspects when doing geo-calculations in MySQL.

diagonalbatman
  • 17,340
  • 3
  • 31
  • 31
  • 2
    +1 as the source is very interesting, but link-only answers are not very good because the link might stop working. You should include the key messages from the linked resource into your answer. – Tomas Jan 03 '14 at 17:33
  • Also the answer is behind a paywall – sMyles Feb 08 '23 at 23:29