Skip to content

Commit 48fae2e

Browse files
Merge pull request #24 from geoCML/tabor-0.3.0-doc-update
Tabor v0.3.0 documentation update
2 parents 73ffe0d + dcf205b commit 48fae2e

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

topics/tabor.adoc

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ image::Tabor-Logo.png["Tabor Logo", 250, 250]
55
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:
66

77
```
8-
tabor: 0.2.0
8+
tabor: 0.3.0
99
layers:
1010

1111
- name: grass
1212
schema: public
1313
owner: geocml
1414
geometry: polygon
15+
srid: 4326
1516
fields:
1617
- name: fid
1718
type: int
@@ -21,6 +22,7 @@ layers:
2122
schema: public
2223
owner: geocml
2324
geometry: point
25+
srid: 4326
2426
fields:
2527
- name: fid
2628
type: int
@@ -41,6 +43,7 @@ layers:
4143
schema: public
4244
owner: geocml
4345
geometry: polyline
46+
srid: 4326
4447
fields:
4548
- name: fid
4649
type: int
@@ -71,13 +74,52 @@ Tabor supports the following geometry types:
7174

7275
If a layer has no geometry type, it may still be defined as a non-geometric table in the database.
7376

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.
7478

7579
=== Supported Field Types
7680

77-
Tabor supports the following field types:
81+
Tabor supports the following primitive field types:
7882

7983
- `int` -> for whole numbers
8084
- `numeric` -> for decimal numbers
8185
- `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`
8289

8390
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)
118+
119+
ex.
120+
```yaml
121+
constraints:
122+
- name: near
123+
distance: 15.6
124+
layer: other_layer
125+
```

0 commit comments

Comments
 (0)