Name

ST_PointOnBoundary — Returns a Point guaranteed to lie on the geometry's boundary.

Synopsis

geometry ST_PointOnBoundary(bytea Geometry);

Alias

PointOnBoundary

Description

Returns a Point guaranteed to lie on the geometry's boundary. The boundary of a Point is the empty set, so this fuction will return null for Points.

[Note]

This method does not support GeometryCollection arguments

Coordinate Dimensions
2D3DM
Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
----

Examples

--MULTIPOINT
SELECT ST_PointOnBoundary(ga)  from (SELECT ST_GeomFromText('MULTIPOINT (-10 30, 0 30, -10 20)') as ga) as foo;
--Result
null

--LINESTRING
SELECT ST_AsText(ST_PointOnBoundary(ga)) 
 from (SELECT ST_GeomFromText('LINESTRING (0 0 20, 10 10 40, 10 5 60, 15 10 80)') as ga) as foo;
--Result:
POINT (0 0 20)

--POLYGON
SELECT ST_AsText(ST_PointOnBoundary(ga)) 
 from (SELECT ST_GeomFromText('POLYGON ((10 30, 0 10, 30 20, 30 30, 20 40, 10 30))') as ga) as foo;
--Result:
POINT (30 20)
LINESTRING
POLYGON

Related functions

ST_PointOnSurface