Haversine formula using SQL server to find closest venue - vb.net

后端 未结 2 2016
孤城傲影
孤城傲影 2021-01-03 10:23

I am grabbing a postcode from a form. I can then convert this postcode to lng,lat coordinates as I have these stored in a table.

SELECT lng, lat from postcodeL

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-03 10:49

    Alternatively uou could also use SQL Server 2008 geography datatypes. If you currently store the longitude/latitide as varchar() in the DB, you will have to store them as geograpghy datatype and then use a function like STIntersects() to get the distance.

提交回复
热议问题