Name
ST_GeneratePoints — Generates random points contained in a Polygon or MultiPolygon.
Synopsis
geometry ST_GeneratePoints(
g geometry , npoints integer )
;
geometry ST_GeneratePoints(
geometry g , integer npoints , integer seed = 0 )
;
Beschreibung
ST_GeneratePoints generates a given number of pseudo-random points which lie within the input area. The optional seed
is used to regenerate a deterministic sequence of points, and must be greater than zero.
Verfügbarkeit: 2.3.0
Erweiterung: mit 3.0.0 wurde das Argument "seed" hinzugefügt
Beispiele
SELECT ST_GeneratePoints(geom, 12, 1996)
FROM (
SELECT ST_Buffer(
ST_GeomFromText(
'LINESTRING(50 50,150 150,150 50)'),
10, 'endcap=round join=round') AS geom
) AS s;