Name

ST_LengthSpheroid — 도형의 기하학적 중심을 반환합니다.

Synopsis

float ST_LengthSpheroid(geometry a_geometry, spheroid a_spheroid);

설명

타원체 상에 있는 도형의 길이/둘레를 계산합니다. 이 함수는 도형의 좌표가 경도/위도이며 재투영하지 않고 길이를 얻고 싶을 때 유용합니다. 이 타원체는 개별적인 데이터베이스 유형으로 다음과 같이 작성할 수 있습니다:


SPHEROID[<NAME
>,<SEMI-MAJOR AXIS
>,<INVERSE FLATTENING
>]
 

도형 예시

SPHEROID["GRS_1980",6378137,298.257222101]

1.2.2 버전부터 사용할 수 있습니다.

변경 사항: 2.2.0 미만 버전에서는 ST_Length_Spheroid라는 명칭이었으며, ST_3DLength_Spheroid라는 동일 함수가 있었습니다.

This function supports 3d and will not drop the z-index.

예시

SELECT ST_LengthSpheroid( geometry_column,
                          'SPHEROID["GRS_1980",6378137,298.257222101]' )
                          FROM geometry_table;

SELECT ST_LengthSpheroid( geom, sph_m ) As tot_len,
ST_LengthSpheroid(ST_GeometryN(geom,1), sph_m) As len_line1,
ST_LengthSpheroid(ST_GeometryN(geom,2), sph_m) As len_line2
                          FROM (SELECT ST_GeomFromText('MULTILINESTRING((-118.584 38.374,-118.583 38.5),
        (-71.05957 42.3589 , -71.061 43))') As geom,
CAST('SPHEROID["GRS_1980",6378137,298.257222101]' As spheroid) As sph_m)  as foo;
        tot_len      |    len_line1     |    len_line2
------------------+------------------+------------------
 85204.5207562955 | 13986.8725229309 | 71217.6482333646

 --3D
SELECT ST_LengthSpheroid( geom, sph_m ) As tot_len,
ST_LengthSpheroid(ST_GeometryN(geom,1), sph_m) As len_line1,
ST_LengthSpheroid(ST_GeometryN(geom,2), sph_m) As len_line2
                          FROM (SELECT ST_GeomFromEWKT('MULTILINESTRING((-118.584 38.374 20,-118.583 38.5 30),
        (-71.05957 42.3589 75, -71.061 43 90))') As geom,
CAST('SPHEROID["GRS_1980",6378137,298.257222101]' As spheroid) As sph_m)  as foo;

         tot_len      |    len_line1    |    len_line2
------------------+-----------------+------------------
 85204.5259107402 | 13986.876097711 | 71217.6498130292