跳转至
🎉 SedonaDB 0.4.0 已正式发布!🗺️ 新增 Python DataFrame API、R dplyr 接口、Geography 支持及 GPU 加速空间连接。阅读发布博客 →

ST_GeogToGeometry

Introduction:

This function constructs a planar Geometry object from a Geography. While Sedona makes every effort to preserve the original spatial object, the conversion is not always exact because Geography and Geometry have different underlying models:

  • Geography represents shapes on the Earth's surface (spherical).
  • Geometry represents shapes on a flat, Euclidean plane.

Because geography vertices are stored as points on the sphere, converting back to planar coordinates can introduce small floating-point differences. Wrap the result with ST_ReducePrecision if you need a fixed number of decimals.

Sedona does not validate or enforce the SRID of the input Geography. Whatever SRID is attached to the Geography will be carried over to the resulting Geometry.

Format:

ST_GeogToGeometry (geog: Geography)

Return type: Geometry

Since: v1.9.1

Example:

SELECT ST_ReducePrecision(ST_GeogToGeometry(ST_GeogFromWKT('MULTILINESTRING ((90 90, 20 20, 10 40), (40 40, 30 30, 40 20, 30 10))', 4326)), 6)

Output:

MULTILINESTRING ((90 90, 20 20, 10 40), (40 40, 30 30, 40 20, 30 10))