File: generate_points.sql

package info (click to toggle)
postgis 3.6.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 74,680 kB
  • sloc: ansic: 163,427; sql: 95,196; xml: 54,290; cpp: 12,646; perl: 5,875; sh: 5,415; makefile: 3,492; python: 1,207; yacc: 447; lex: 151; pascal: 58
file content (12 lines) | stat: -rw-r--r-- 351 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
-- Check containment and count of generated points
WITH circle AS (
	SELECT ST_Point(5000,5000) AS pt,
	       ST_Buffer(ST_Point(5000,5000),10) AS geom
),
pts AS (
	SELECT (ST_Dump(ST_GeneratePoints(geom, 50))).geom AS geom
	FROM circle
)
SELECT 'generate_points_1', bool_and(ST_Distance(circle.pt, pts.geom) < 10), count(pts.geom)
FROM circle, pts