You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tabor is a database modeling language for GIS based on YAML, but with additional syntax restrictions. The goal of Tabor is to allow GIS users to create and maintain complex database rules using plain-text configuration files. The following is an example of a Tabor configuration file for a PostGIS database:
6
6
7
7
```
8
-
tabor: 0.2.0
8
+
tabor: 0.3.0
9
9
layers:
10
10
11
11
- name: grass
12
12
schema: public
13
13
owner: geocml
14
14
geometry: polygon
15
+
srid: 4326
15
16
fields:
16
17
- name: fid
17
18
type: int
@@ -21,6 +22,7 @@ layers:
21
22
schema: public
22
23
owner: geocml
23
24
geometry: point
25
+
srid: 4326
24
26
fields:
25
27
- name: fid
26
28
type: int
@@ -41,6 +43,7 @@ layers:
41
43
schema: public
42
44
owner: geocml
43
45
geometry: polyline
46
+
srid: 4326
44
47
fields:
45
48
- name: fid
46
49
type: int
@@ -71,13 +74,52 @@ Tabor supports the following geometry types:
71
74
72
75
If a layer has no geometry type, it may still be defined as a non-geometric table in the database.
73
76
77
+
The spatial reference of each layer in your Tabor file can be defined with the `srid` field, followed by the SRID of your reference system.
74
78
75
79
=== Supported Field Types
76
80
77
-
Tabor supports the following field types:
81
+
Tabor supports the following primitive field types:
78
82
79
83
- `int` -> for whole numbers
80
84
- `numeric` -> for decimal numbers
81
85
- `text` -> for unlimited length character strings
86
+
- `boolean` -> for true or false values
87
+
88
+
Tabor also supports arrays of primitive data. You can define an array as `type: <primitive> array`
82
89
83
90
It is strongly recommended that you have a primary key (pk) on each of your layers. You can define a field as a primary key using `pk: true`.
91
+
92
+
=== Data Constraints
93
+
94
+
You can define complex business logic in your Tabor file with data constraints. Data constraints ensure that changes to your database table meets specific rules before they are committed to the database. You can choose to include as many data constraints on your layers as you need.
95
+
96
+
Tabor supports the following data constraints:
97
+
98
+
- `on` -> Checks that new features are at least partially within the boundaries of another layer (works with all geometry types)
99
+
100
+
ex.
101
+
```yaml
102
+
constraints:
103
+
- name: on
104
+
layer: other_layer
105
+
```
106
+
107
+
- `length` -> Checks that new polyline features have either a minimum or maximum length
108
+
109
+
ex.
110
+
```yaml
111
+
constraints:
112
+
- name: length
113
+
minimum: 0.5
114
+
maximum: 99.5 # You must include either a minimum or maximum value, but not both!
115
+
```
116
+
117
+
- `near` -> Checks that new features are placed within a given distance of another layer (works with all geometry type)
0 commit comments