FlatGeobuf
FlatGeobuf is a new geospatial data format that allows users to work more efficiently with vector data. It can be used as a replacement for GeoJSON, providing smaller file sizes and faster loads. It is a binary (FlatBuffers-encoded) format that defines geospatial geometries. It is row-oriented rather than columnar like GeoParquet and GeoArrow and offers a different set of trade-offs.
FlatGeobuf was inspired by geobuf and flatbush.
Characteristics
- Binary
- Row oriented
- Supports appends, but not random writes
- Optionally supports a spatial index
Goals are to be suitable for large volumes of static data, significantly faster than legacy formats without size limitations for contents or meta information and to be suitable for streaming/random access.
Geometries
FlatGeobuf supports any vector geometry type defined in the OGC Simple Features specification (the same feature types supported by the WKB 2D geometry type enumeration).
GeoBuf geometries include the standard building blocks of Point
, LineString
, Polygon
,MultiPoint
, MultiLineString
, MultiPolygon
, and GeometryCollection
, but also includes more infrequently types such as CircularString
, Surface
, and `TIN`` (Triangulated irregular network). These additional types are not supported by Studio.
Type | Value | Studio | Comment |
---|---|---|---|
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 | 1 | ❌ |
Note: Storing only geometries with the same type allows readers to know which geometry type is stored without scanning the entire file.
Schema
Apart from geometry, FlatGeobuf supports columns with a range of types:
Type | Description |
---|---|
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 |
Spatial indexing
Studio does not yet use the spatial index in flatgeobuf files.
Updated 10 months ago