SQL Server Geography datatype nearest point on line

前端 未结 2 807
滥情空心
滥情空心 2021-02-01 10:08

I am trying to build a query, but I am having some difficulty.

I have a SQL Server 2008 database with a table that includes, among other fields, a geography field that d

2条回答
  •  南旧
    南旧 (楼主)
    2021-02-01 10:47

    How are your road segments stored? lat and long? if so, you can convert them to radians, and do the math:

    • http://www.zipcodeworld.com/samples/distance.mssql.html
    • http://www.petefreitag.com/item/622.cfm
    • http://johndyer.name/post/2005/07/11/LatitudeLongitude-Distance-Calculation-in-SQL-Server.aspx

提交回复
热议问题