st_force2d 함수

적용 대상:예 Databricks SQL 확인 표시 예 Databricks Runtime 18.1 이상으로 표시

중요합니다

이 기능은 공개 미리보기 단계에 있습니다.

비고

이 기능은 Databricks SQL 클래식 웨어하우스에서 사용할 수 없습니다. Databricks SQL 웨어하우스에 대한 자세한 내용은 SQL 웨어하우스 유형을 참조하세요.

입력 GEOGRAPHY 또는 GEOMETRY 값의 2D 프로젝션을 반환합니다.

문법

st_force2d ( geoExpr )

Arguments

  • geoExpr: A GEOGRAPHY 또는 GEOMETRY 값입니다.

Returns

입력 값의 2D 프로젝션을 나타내는 형식 GEOGRAPHY 또는 GEOMETRY값입니다.

출력 GEOGRAPHY 또는 GEOMETRY 값의 SRID 값은 입력 값의 값과 같습니다.

입력이 NULL인 경우 함수는 NULL를 반환합니다.

Notes

입력에 Z 또는 M 좌표가 있는 경우 출력에서 제외됩니다.

입력이 이미 2D이면 함수는 변경되지 않은 상태로 반환합니다.

예제

-- Drops the M coordinate from a point geography.
> SELECT st_astext(st_force2d(st_geogfromtext('POINT M (1 2 3)')));
  POINT(1 2)
-- Drops Z and M coordinates from a multipoint geography.
> SELECT st_astext(st_force2d(st_geogfromtext('MULTIPOINT ZM (EMPTY,0 0 10 20, 1 1 11 21)')));
  MULTIPOINT(EMPTY,(0 0),(1 1))
-- Drops the Z coordinate from a polygon geography.
> SELECT st_astext(st_force2d(st_geogfromtext('POLYGON Z ((0 0 2,1 0 3,0 1 4,0 0 5))')));
  POLYGON((0 0,1 0,0 1,0 0))
-- Drops the Z coordinate from a point geometry.
> SELECT st_astext(st_force2d(st_geomfromtext('POINT Z (1 2 3)')));
  POINT(1 2)
-- Drops Z and M coordinates from a linestring geometry.
> SELECT st_astext(st_force2d(st_geomfromtext('LINESTRING ZM (0 0 10 20, 1 1 11 21)')));
  LINESTRING(0 0,1 1)
-- Returns the input 2D geometry as is.
> SELECT st_astext(st_force2d(st_geomfromtext('POINT(1 2)')));
  POINT(1 2)
-- Preserves the SRID of the input geography.
> SELECT st_srid(st_force2d(st_geogfromtext('POINT(1 2)')));
  4326
-- Preserves the SRID of the input geometry.
> SELECT st_srid(st_force2d(st_geomfromtext('POINT(1 2)', 4326)));
  4326
-- Returns NULL if the input is NULL.
> SELECT st_force2d(NULL);
   NULL