下面的距离计算是否没有考虑到地球的曲率?
“普通地球模型上的 STDistance() 与精确测地距离的偏差不超过 0.25%。”
文档:http: //msdn.microsoft.com/en-us/library/bb933808.aspx
create proc findNearbyZips
@lat float,
@lon float,
@radius float
as
begin
declare @geo geography;
set @geo = geography::Point(@lat, @lon,4326);
with ZipsWithinRadius as
(
select zip5, city, state from zips
where
@geo.STDistance( zips.centroidGeoLocationInBinaryFormat ) <= @radius * 5280.00
)
select [...]
end