블로그 이미지
010-9967-0955 보미아빠

카테고리

보미아빠, 석이 (505)
밥벌이 (16)
싸이클 (1)
일상 (1)
Total
Today
Yesterday

달력

« » 2024.10
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

공지사항

최근에 올라온 글

-- 각 지점의 위도 경도 구하기 (아래 사이트에서 구함, kakao api 이용해도 가능)
-- https://tablog.neocities.org/keywordposition
-- 검색한 위도 경도를 이용해 서울역에서 용인두산위브까지의 거리 SQL서버로 구하기
-- Parse 는 대소문자를 구분하고, STGeomFromText 에서 SRID를 4236으로 고정한 값으로 계산함 
-- https://learn.microsoft.com/en-us/sql/t-sql/spatial-geography/parse-geography-data-type?view=sql-server-ver16
-- https://learn.microsoft.com/ko-kr/sql/t-sql/spatial-geometry/stgeomfromtext-geometry-data-type?view=sql-server-ver16
-- POINT는 점으로 계산, LINESTRING 은 선분으로 계산 WKT 표현임, 모든 데이터베이스에 이런거 다 지원함

 

 

DECLARE @g geography;  
DECLARE @h geography;  
SET @g = geography::Parse('POINT(126.9720686318752 37.55593878839654)'); 
SET @h = geography::Parse('POINT(127.15001085373893 37.28340610861977)'); 
SELECT @g.STDistance(@h);  --this is the distance in meters
GO

DECLARE @g geography;  
DECLARE @h geography;  
SET @g = geography::STGeomFromText('POINT(126.9720686318752 37.55593878839654)', 4326); 
SET @h = geography::STGeomFromText('POINT(127.15001085373893 37.28340610861977)', 4326); 
SELECT @g.STDistance(@h);  --this is the distance in meters
GO

-- SET @g = geography::STGeomFromText('LINESTRING(-122.360 47.656, -122.343 47.656)', 4326);

Posted by 보미아빠
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함