Skip to content

Instantly share code, notes, and snippets.

@tetrashine
Created March 14, 2021 06:01
Show Gist options
  • Select an option

  • Save tetrashine/fdd2439b3c25361a618f59691b0c758e to your computer and use it in GitHub Desktop.

Select an option

Save tetrashine/fdd2439b3c25361a618f59691b0c758e to your computer and use it in GitHub Desktop.
Generate random points from reference geometry
CREATE TABLE map.cluster_locations (
id serial PRIMARY KEY,
geom Geometry
);
INSERT INTO map.cluster_locations (geom)
SELECT (ST_Dump(ST_GeneratePoints(geom, 100000, 1996))).geom as geom
FROM (
SELECT ST_Union(geom) as geom FROM map.singapore
) AS s;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment