Distance between 2 geocodes

前端 未结 9 1472
一生所求
一生所求 2020-12-05 22:10

What is the formula for calculating the distance between 2 geocodes? I have seen some of the answers on this site but they basically say to rely on SQL Server 08 functions,

9条回答
  •  余生分开走
    2020-12-05 22:52

    Sorry, I don't know what country you are in even. Are we talking about Easting and Northings (UK, Ordance Survey system) or Lat/Long or some other system? If we are talking Easting and Northing then you can use
    sqr((x1-x2)^2 + (y1-y2)^2)
    This does not allow for the fact that the earth is a sphere, but for short distances you won't notice. We use it at work for distances between points within the county.
    Be carful about how longer grid reference you use. I think an 8 figure reference will give you a distance in metres. I'll be able to get a definate answer at work next week if no one else has supplied it.

提交回复
热议问题