File: tables.sql

package info (click to toggle)
pgsphere 1.1.1%2B2020-10-20-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,700 kB
  • sloc: ansic: 12,032; sql: 6,091; cpp: 853; makefile: 216; perl: 168; yacc: 145; xml: 66; lex: 55; sh: 1
file content (41 lines) | stat: -rw-r--r-- 1,315 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
-- Create tables

SET client_min_messages = 'warning';

CREATE TABLE spheretmp1 (p spoint);

\copy spheretmp1 from 'data/test_spherepoint.data'
\copy spheretmp1 from 'data/test_spherepoint.data'
\copy spheretmp1 from 'data/test_spherepoint.data'
\copy spheretmp1 from 'data/test_spherepoint.data'

CREATE TABLE spheretmp2 (c scircle);

\copy spheretmp2 from 'data/test_spherecircle.data'
\copy spheretmp2 from 'data/test_spherecircle.data'
\copy spheretmp2 from 'data/test_spherecircle.data'
\copy spheretmp2 from 'data/test_spherecircle.data'

CREATE TABLE spheretmp3 (b sbox);
\copy spheretmp3 from 'data/test_spherebox.data'

CREATE TABLE spheretmp4 AS                
  SELECT sline ( p , p - strans '-15d,-15d,-15d,ZXZ' ) AS l
  FROM spheretmp1;

CREATE TABLE spheretmp5 (id int PRIMARY KEY , p spoly );
\copy spheretmp5 from 'data/test_spherepolygon.data'

CREATE TABLE spheretmp6 (id int PRIMARY KEY , p spath );
\copy spheretmp6 from 'data/test_spherepath.data'

-- Aggregate data from tables

SELECT set_sphere_output_precision(12);

CREATE TABLE spheretmp7 (p spoint);
\copy spheretmp7 from 'data/test_spherepolygon_aggregate.data'
SELECT spoly(p) FROM spheretmp7;
CREATE TABLE spheretmp8 (p spoint);
\copy spheretmp8 from 'data/test_spherepoint.data'
SELECT spath(p) FROM spheretmp8 WHERE p IS NOT NULL;