ST_PointOnSurface — サーフェス上にあることを保障されたPOINT
を返します。
geometry ST_PointOnSurface(
geometry g1)
;
サーフェス上にあることを保障されたPOINT
を返します。
このメソッドはOpenGIS Simple Features Implementation Specification for SQL 1.1.に準拠しています。 s3.2.14.2 // s3.2.18.2
このメソッドはSQL/MM仕様に準拠しています。 SQL-MM 3: 8.1.5, 9.5.6. According to the specs, ST_PointOnSurface works for surface geometries (POLYGONs, MULTIPOLYGONS, CURVED POLYGONS). So PostGIS seems to be extending what the spec allows here. Most databases Oracle,DB II, ESRI SDE seem to only support this function for surfaces. SQL Server 2008 like PostGIS supports for all common geometries.
この関数は3次元に対応し、Z値を削除しません。
SELECT ST_AsText(ST_PointOnSurface('POINT(0 5)'::geometry)); st_astext ------------ POINT(0 5) (1 row) SELECT ST_AsText(ST_PointOnSurface('LINESTRING(0 5, 0 10)'::geometry)); st_astext ------------ POINT(0 5) (1 row) SELECT ST_AsText(ST_PointOnSurface('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'::geometry)); st_astext ---------------- POINT(2.5 2.5) (1 row) SELECT ST_AsEWKT(ST_PointOnSurface(ST_GeomFromEWKT('LINESTRING(0 5 1, 0 0 1, 0 10 2)'))); st_asewkt ---------------- POINT(0 0 1) (1 row)