ST_PointOnSurface — Returns a Point guaranteed to lie on the geometry
geometry ST_PointOnSurface(
bytea
Geometry)
;
Returns a Point guaranteed to lie on the geometry
OGC originally defined this function for Surfaces as MultiSurfaces, Jaspa extends it to any Geometry |
3D and M, are not supported for surface geometries. |
2D | 3D | M |
---|---|---|
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 |
---|---|---|---|
2.1.9.1 , 2.1.11.1 | 7.2.14.1 , 7.2.18.1 | 7.2.12.2 , 7.2.19.2 | 8.1.5 , 9.5.6 |
--MultiPoint SELECT ST_AsText(ST_PointOnSurface(ga)) from (SELECT ST_GeomFromText('MULTIPOINT (-10 30, 0 30, -10 20, -2 24, -7 27, -6 21)') as ga) as foo; --Result POINT (-7 27) --LineString SELECT ST_AsText(ST_PointOnSurface(ga)) from (SELECT ST_GeomFromText('LINESTRING (0 0 0 -2, 10 10 20 -5, 10 5 10 -8, 15 10 20 -4)') as ga) as foo; --Result POINT (10 5 10 -8) --Polygon SELECT ST_AsText(ST_PointOnSurface(ga)) from (SELECT ST_GeomFromText('POLYGON ((10 30 2, 0 10 4, 30 20 6, 30 30 8, 20 40 8, 10 30 2))') as ga) as foo; --Result POINT (18.75 25)
LineString | Polygon |