question

shridhar avatar image
shridhar asked

Find address using radius in SQL with geography

I have below table table1 id lat lng adress radiusmeter geograpghy 1 18.20 73.020 A t43gv4b4b3j24vgh3f4 2 18.30 74.120 B 200 jhg324324jg234jhg2 3 23.20 64.320 C kjh234234jkh234kjh 4 25.20 30.400 D 500 jhgjh4545jhg344345 if I want to find address for lat long 18.20,73.020 and 18.70,74.020 then I want to serach data like for id 1 and 3 default STDistance<50 meter for 2 distance will be 200 and for id 4 distance will be 500 meter currtly I search address like below query SELECT TOP 1 adress FROM table1 WITH(index(SpatialIndex_Area)) WHERE geography.STDistance(adresGeo) <50 ORDER BY geography.STDistance(adresGeo)) as Address, adresGeo is geography of searching lat long
sql-server-2016spatialgeographysq
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.