comparison flys-backend/doc/schema/postgresql-spatial.sql @ 1230:e2deda3b77a7

Introduced support for FLYS spatial data. flys-backend/trunk@2507 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 18 Aug 2011 15:03:20 +0000
parents
children 324cb486db9f
comparison
equal deleted inserted replaced
1229:8b12b338a3f6 1230:e2deda3b77a7
1 BEGIN;
2
3 CREATE TABLE river_axes (
4 id SERIAL PRIMARY KEY NOT NULL,
5 river_id int REFERENCES rivers(id),
6 kind int NOT NULL DEFAULT 0
7 );
8 SELECT AddGeometryColumn('river_axes', 'geom', 31466, 'LINESTRING', 2);
9
10
11 CREATE TABLE cross_section_tracks (
12 id SERIAL PRIMARY KEY NOT NULL,
13 river_id int REFERENCES rivers(id),
14 km NUMERIC NOT NULL,
15 z NUMERIC NOT NULL DEFAULT 0
16 );
17 SELECT AddGeometryColumn('cross_section_tracks', 'geom', 31466, 'LINESTRING', 2);
18
19
20 CREATE TABLE lines (
21 id SERIAL PRIMARY KEY NOT NULL,
22 river_id int REFERENCES rivers(id),
23 kind int NOT NULL DEFAULT 0,
24 z NUMERIC DEFAULT 0
25 );
26 SELECT AddGeometryColumn('lines', 'geom', 31466, 'LINESTRING', 4);
27 -- 'kind':
28 -- 0: ROHR1
29 -- 1: DAMM
30
31
32 CREATE TABLE buildings (
33 id SERIAL PRIMARY KEY NOT NULL,
34 river_id int REFERENCES rivers(id),
35 name VARCHAR(50)
36 );
37 SELECT AddGeometryColumn('buildings', 'geom', 31466, 'LINESTRING', 2);
38
39
40 CREATE TABLE fixpoints (
41 id SERIAL PRIMARY KEY NOT NULL,
42 river_id int REFERENCES rivers(id),
43 x int,
44 y int,
45 km NUMERIC NOT NULL,
46 HPGP VARCHAR(2)
47 );
48 SELECT AddGeometryColumn('fixpoints', 'geom', 31466, 'POINT', 2);
49
50 END;

http://dive4elements.wald.intevation.org