File: voronoi.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 (15 lines) | stat: -rw-r--r-- 813 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-- postgres

-- SRID is preserved
SELECT 1,  32145 = ST_SRID(ST_VoronoiPolygons('SRID=32145;MULTIPOINT (0 0, 1 1, 2 2)'));
-- NULL -> NULL
SELECT 2,  ST_VoronoiPolygons(NULL) IS NULL;
-- NULL tolerance produces error
SELECT 3,  ST_VoronoiPolygons('MULTIPOINT (0 0, 1 1, 2 2)', NULL);
-- Tolerance can't be negative
SELECT 5,  ST_VoronoiPolygons('MULTIPOINT (0 0, 1 1, 2 2)', -2);
-- Output types are correct
SELECT 6,  GeometryType(ST_VoronoiPolygons('MULTIPOINT (0 0, 1 1, 2 2)')) = 'GEOMETRYCOLLECTION';
SELECT 7,  GeometryType(ST_VoronoiLines('MULTIPOINT (0 0, 1 1, 2 2)')) = 'MULTILINESTRING';
-- Clipping extent is handled correctly
SELECT 8,  ST_Equals(ST_Envelope('LINESTRING (-20 -10, 10 10)'::geometry), ST_Envelope(ST_VoronoiPolygons('MULTIPOINT (0 0, 1 1, 2 2)', 0.0, 'MULTIPOINT (-20 -10, 10 10)')));