-
-
Notifications
You must be signed in to change notification settings - Fork 78
/
header.fbs
84 lines (78 loc) · 4.04 KB
/
header.fbs
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
namespace FlatGeobuf;
// Geometry type enumeration
// NOTE: Same as WKB 2D geometry type enumeration
enum GeometryType: ubyte {
Unknown = 0,
Point = 1,
LineString = 2,
Polygon = 3,
MultiPoint = 4,
MultiLineString = 5,
MultiPolygon = 6,
GeometryCollection = 7,
CircularString = 8,
CompoundCurve = 9,
CurvePolygon = 10,
MultiCurve = 11,
MultiSurface = 12,
Curve = 13,
Surface = 14,
PolyhedralSurface = 15,
TIN = 16,
Triangle = 17
}
enum ColumnType: ubyte {
Byte, // Signed 8-bit integer
UByte, // Unsigned 8-bit integer
Bool, // Boolean
Short, // Signed 16-bit integer
UShort, // Unsigned 16-bit integer
Int, // Signed 32-bit integer
UInt, // Unsigned 32-bit integer
Long, // Signed 64-bit integer
ULong, // Unsigned 64-bit integer
Float, // Single precision floating point number
Double, // Double precision floating point number
String, // UTF8 string
Json, // General JSON type intended to be application specific
DateTime, // ISO 8601 date time
Binary // General binary type intended to be application specific
}
table Column {
name: string (required); // Column name
type: ColumnType; // Column type
title: string; // Column title
description: string; // Column description (intended for free form long text)
width: int = -1; // Column values expected width (-1 = unknown) (currently only used to indicate the number of characters in strings)
precision: int = -1; // Column values expected precision (-1 = unknown) as defined by SQL
scale: int = -1; // Column values expected scale (-1 = unknown) as defined by SQL
nullable: bool = true; // Column values expected nullability
unique: bool = false; // Column values expected uniqueness
primary_key: bool = false; // Indicates this column has been (part of) a primary key
metadata: string; // Column metadata (intended to be application specific and suggested to be structured fx. JSON)
}
table Crs {
org: string; // Case-insensitive name of the defining organization e.g. EPSG or epsg (NULL = EPSG)
code: int; // Numeric ID of the Spatial Reference System assigned by the organization (0 = unknown)
name: string; // Human readable name of this SRS
description: string; // Human readable description of this SRS
wkt: string; // Well-known Text Representation of the Spatial Reference System
code_string: string; // Text ID of the Spatial Reference System assigned by the organization in the (rare) case when it is not an integer and thus cannot be set into code
}
table Header {
name: string; // Dataset name
envelope: [double]; // Bounds
geometry_type: GeometryType; // Geometry type (should be set to Unknown if per feature geometry type)
has_z: bool = false; // Does geometry have Z dimension?
has_m: bool = false; // Does geometry have M dimension?
has_t: bool = false; // Does geometry have T dimension?
has_tm: bool = false; // Does geometry have TM dimension?
columns: [Column]; // Attribute columns schema (can be omitted if per feature schema)
features_count: ulong; // Number of features in the dataset (0 = unknown)
index_node_size: ushort = 16; // Index node size (0 = no index)
crs: Crs; // Spatial Reference System
title: string; // Dataset title
description: string; // Dataset description (intended for free form long text)
metadata: string; // Dataset metadata (intended to be application specific and suggested to be structured fx. JSON)
}
root_type Header;