## Name

ST_GeneratePoints — Generates a multipoint of random points contained in a Polygon or MultiPolygon.

## Synopsis

`geometry ST_GeneratePoints(`geometry g, integer npoints, integer seed = 0`)`;

## Descrição

ST_GeneratePoints generates a multipoint consisting of 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.

## Exemplos Generated a multipoint consisting of 12 Points overlaid on top of original polygon using a random seed value 1996

```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;```

Given a table of polygons s, return 12 individual points per polygon. Results will be different each time you run.

```SELECT s.id, dp.path AS pt_id, dp.geom
FROM s, ST_DumpPoints(ST_GeneratePoints(s.geom,12)) AS dp;```
{"ft_lang_label":"__label__en","ft_lang_prob":0.54304266,"math_prob":0.9933936,"size":853,"snap":"2023-40-2023-50","text_gpt3_token_len":229,"char_repetition_ratio":0.15547703,"word_repetition_ratio":0.0,"special_character_ratio":0.2602579,"punctuation_ratio":0.19642857,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.957863,"pos_list":[0,1,2],"im_url_duplicate_count":[null,1,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-12-01T03:56:27Z\",\"WARC-Record-ID\":\"<urn:uuid:6152a669-4a1e-4573-ac67-54e88f106917>\",\"Content-Length\":\"4730\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:ab48faf3-e703-4def-9334-e98ce235bde0>\",\"WARC-Concurrent-To\":\"<urn:uuid:243fcb25-6614-4184-84b7-a4721939a50e>\",\"WARC-IP-Address\":\"209.208.97.173\",\"WARC-Target-URI\":\"https://postgis.net/docs/manual-dev/br/ST_GeneratePoints.html\",\"WARC-Payload-Digest\":\"sha1:CS43XKK27MFISLXHLK7HIFC5FL7PNMIF\",\"WARC-Block-Digest\":\"sha1:6BQ5FQ3344YAIQGIUSI2JBPO5QMM7EYH\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100264.9_warc_CC-MAIN-20231201021234-20231201051234-00662.warc.gz\"}"}