ST_PointOnSurface()

TL;DR

Use ST_PointOnSurface() to return a point on a geometry’s surface.

Returns a point on a geometry’s surface.

Syntax

ST_PointOnSurface(geom)

Arguments

Argument

Description

geom

A GEOMETRY or GEOMETRY32 value.

Return Value

Returns the same geometry precision type as geom.

Usage Notes

Examples

DROP DATABASE IF EXISTS geo_accessor_demo;
CREATE DATABASE geo_accessor_demo;
USE geo_accessor_demo;
SELECT ST_AsText(ST_PointOnSurface(ST_GeomFromText('POLYGON((0 0,4 0,4 4,0 4,0 0)'))) AS point_on_surface;
DROP DATABASE geo_accessor_demo;

See Also

ST_Centroid, ST_Envelope