SqlGeographyFactory factory = new SqlGeographyFactory(); int srid = 4326; //WGS 84 SRS (GPS) SqlGeography point = factory.Point(48.8582, 2.2945, srid);
SqlGeographyFactory factory = new SqlGeographyFactory(); int srid = 4326; //WGS 84 SRS (GPS) SqlGeography point1 = factory.Point(48.8582, 2.2945, srid); SqlGeography point2 = factory.Point(51.5074, -0.1278, srid); double distance = point1.STDistance(point2).Value;Package Library To use SqlGeography in your C# project, you need to include the System.Data.SqlTypes package library. This library is included with SQL Server and is also available as a NuGet package that you can add to your project.