Peter Larsson Blog

Patron Saint of Lost Yaks

First test with November CTP

declare

@sample table (p geography)

insert @sample
select geography::STGeomFromText('POINT(12.65100 65.34900)', 4619) union all
select
geography::STGeomFromText('POINT(35.65100 23.34900)', 4619) union all
select
geography::STGeomFromText('POINT(64.65100 12.34900)', 4619)

DECLARE @h geography

SET @h = geography::STGeomFromText('POINT(47.65100 -122.34900)', 4619)

SELECT p.STDistance(@h) / 1000 as [km]
from @sample