How to calculate distance from a point to a line segment, on a sphere?

Here’s my own solution, based on the idea in ask Dr. Math. I’d be happy to see your feedback. Disclaimer first. This solution is correct for spheres. Earth isn’t a sphere, and the coordinates system (WGS 84) doesn’t assume it’s a sphere. So this is just an approximation, and I can’t really estimate is error. … Read more

Unable to load SqlServerSpatial.dll

I had the same problem on a Windows Server 2012 machine. It had an SqlServerSpatial110.dll file in \Windows\System32, but no SqlServerSpatial.dll. The solution was installing the Microsoft System CLR Types for SQL Server 2008 R2 on the machine. http://www.microsoft.com/en-us/download/details.aspx?id=26728 Click Download Check off one of these depending on your processor architecture: 1033\x64\SQLSysClrTypes.msi 1033\x86\SQLSysClrTypes.msi 1033\IA64\SQLSysClrTypes.msi Click … Read more

Is the Haversine Formula or the Vincenty’s Formula better for calculating distance?

Haversine and Vincenty are two algorithms for solving different problems. Haversine computes the great circle distance on a sphere while Vincenty computes the shortest (geodesic) distance on the surface of an ellipsoid of revolution. So the answer to your question can be broken into 2 parts: Do you want to compute the distance on a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)