以下距离计算是否未考虑地球的曲率?
“普通地球模型上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
答案 0 :(得分:3)
确保你使用正确的单位,这样你就不用计算米里面的东西,反之亦然。如有疑问,请假设SI基本单位(http://en.wikipedia.org/wiki/SI_base_unit)