locked
Search using lat/long within a given radius RRS feed

  • Question

  • How can I find all items by lat/long within the specified radius (X meters away of the center)?

    I need a way that also works on SQL Azure.


    If you found this post helpful, please "Vote as Helpful". If it actually answered your question, remember to "Mark as Answer".

    Se achou este post útil, por favor clique em "Votar como Útil". Se por um acaso respondeu sua dúvida, lembre de "Marcar como Resposta".

    Sunday, November 4, 2012 2:46 AM

Answers

All replies

  • Hello Juliano,

    When you are using spatial data tpe, you can use the STDistance methode to calculate the distance between your reference- and the other point to filter them by the radius values.

    Spatial data types are supported by SQL Azure, see Supported Windows Azure SQL Database Data Types


    Olaf Helper

    Blog Xing

    Sunday, November 4, 2012 7:36 AM
  • Thank you Olaf.

    One more question...

    Do you suggest any link about optimizing my table indexes for this kind of search?


    If you found this post helpful, please "Vote as Helpful". If it actually answered your question, remember to "Mark as Answer".

    Se achou este post útil, por favor clique em "Votar como Útil". Se por um acaso respondeu sua dúvida, lembre de "Marcar como Resposta".

    Sunday, November 4, 2012 11:33 PM