SQL Server 2008 Geography .STBuffer () distance units

I work with a geographic point using lat / long and you need to find other points in our database within 5 miles of this point. However, I canโ€™t understand what โ€œunitsโ€ are for STBuffer, it doesnโ€™t seem to correspond to feet, miles, meters, kilometers, etc. Does the documentation only refer to them as "units", any suggestions? Thanks

[...] from the geography :: STGeomFromText ('POINT (xy)', 4326) .STBuffer (z) .STIntersects (geography :: STGeomFromText ('POINT (' + CAST (v. Longitude as varchar (max)) + '' + CAST (v. Latitude as varchar (max)) + ')', 4326)) = 1

+6
units-of-measurement sql geography distance
source share
2 answers

STBuffer is in meters. More details here.

To convert miles to meters, divide the number of miles by 0.0006213712

(i.e. 5 miles / 0.0006213712 = 8 046.72 meters)

+5
source share

The unit of measurement depends on the spatial reference system used. See this system view for more details:

SELECT * FROM sys.spatial_reference_systems;

+9
source share

All Articles