# FGB — FlatGeobuf (FGB)

> FGB (FlatGeobuf (FGB)): Open binary vector format built on FlatBuffers with an optional packed Hilbert R-tree spatial index. Specs, software and free sample files; convert FGB to 39 formats online.

- Page: https://beta.mygeodata.cloud/formats/fgb



## What is a FGB file?

FlatGeobuf is an open, performance-oriented binary format for simple features, developed as an open-source project initiated by Björn Harrtell. It targets fast reading of large vector datasets, both locally and over HTTP, and supports streaming and spatially filtered access through range requests without a server-side service.

A file begins with a magic number and a header that holds the layer schema, geometry type, feature count and an optional coordinate reference system. An optional packed Hilbert R-tree spatial index follows, then the features, each serialized with FlatBuffers. Field names and string values are stored as UTF-8 without formal length limits. Point, line, polygon, multi-part and collection geometries are supported, optionally with Z and M values. Each file holds a single layer. The format is designed to be written once and read many times, so editing or appending features generally means rewriting the file.

FGB files are usually exchanged by GIS analysts and web developers who need to move large vector layers quickly, often through cloud storage or web maps. Each file holds only one layer, so multi-layer datasets must be split into several files. Because the format is written once and read many times, edits normally mean rewriting the whole file. Check that the CRS is stored in the header.

### Technical details

| | |
|---|---|
| Full name | FlatGeobuf (FGB) |
| Data type | Vector · GIS vector |
| File extension | .fgb |
| Files | Single file |
| Media type | application/octet-stream |
| Geometry types | Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection |
| Multiple layers | No |
| Mixed geometry in a layer | Yes |
| Attribute names | No length limit (UTF8) |
| Coordinate system | Any (EPSG, ESRI, custom) |
| Converter support | Read & write |
| Typical software | GDAL/OGR, QGIS, PostGIS, DuckDB, OpenLayers |
| Specification | https://flatgeobuf.org/ |

### Specifications & references

- https://flatgeobuf.org/
- https://github.com/flatgeobuf/flatgeobuf
- https://gdal.org/en/stable/drivers/vector/flatgeobuf.html

### Sample FGB files — free download

- [Places (points)](https://beta.mygeodata.cloud/static/landing/samples/v1/flatgeobuf/st-helena-places.fgb) — 58 places of Saint Helena (20 settlements, 17 peaks, 21 points of interest) with name, category, elevation from Copernicus DEM and OSM id. FlatGeobuf with a packed spatial index. (12.4 kB, EPSG:4326)
- [Roads and paths (lines)](https://beta.mygeodata.cloud/static/landing/samples/v1/flatgeobuf/st-helena-roads.fgb) — 110 named roads, streets, tracks and paths (OSM segments merged by name) with class, surface, speed limit and length. FlatGeobuf with a packed spatial index. (95.1 kB, EPSG:4326)
- [Land cover (polygons)](https://beta.mygeodata.cloud/static/landing/samples/v1/flatgeobuf/st-helena-landcover.fgb) — 190 land-cover polygons (forest, scrub, farmland, residential, water, …) from OpenStreetMap with area in hectares. FlatGeobuf with a packed spatial index. (115.4 kB, EPSG:4326)
- [Jamestown buildings (polygons)](https://beta.mygeodata.cloud/static/landing/samples/v1/flatgeobuf/st-helena-buildings.fgb) — 179 building footprints in Jamestown with type, footprint area and ground elevation. FlatGeobuf with a packed spatial index. (41.3 kB, EPSG:4326)

### Convert FGB to other formats

- [FGB to SHP](https://beta.mygeodata.cloud/converter/fgb-to-shp)
- [FGB to GeoJSON](https://beta.mygeodata.cloud/converter/fgb-to-geojson)
- [FGB to GPKG](https://beta.mygeodata.cloud/converter/fgb-to-gpkg)
- [FGB to DXF](https://beta.mygeodata.cloud/converter/fgb-to-dxf)
- [FGB to KML](https://beta.mygeodata.cloud/converter/fgb-to-kml)
- [FGB to XLSX](https://beta.mygeodata.cloud/converter/fgb-to-xlsx)
- [FGB to GeoPDF](https://beta.mygeodata.cloud/converter/fgb-to-geopdf)
- [FGB to CSV](https://beta.mygeodata.cloud/converter/fgb-to-csv)
- [FGB to GPX](https://beta.mygeodata.cloud/converter/fgb-to-gpx)
- [FGB to KMZ](https://beta.mygeodata.cloud/converter/fgb-to-kmz)
- [FGB to TopoJSON](https://beta.mygeodata.cloud/converter/fgb-to-topojson)
- [FGB to Parquet](https://beta.mygeodata.cloud/converter/fgb-to-parquet)
- [FGB to SVG](https://beta.mygeodata.cloud/converter/fgb-to-svg)
- [FGB to DGN](https://beta.mygeodata.cloud/converter/fgb-to-dgn)
- [FGB to GML](https://beta.mygeodata.cloud/converter/fgb-to-gml)
- [FGB to MapInfo](https://beta.mygeodata.cloud/converter/fgb-to-mapinfo)
- [FGB to MIF](https://beta.mygeodata.cloud/converter/fgb-to-mif)
- [FGB to SQLite](https://beta.mygeodata.cloud/converter/fgb-to-sqlite)

## Frequently asked questions

### How does FGB differ from GeoJSON?

FGB is a binary format with a typed schema in its header and an optional spatial index, so large files can be read quickly and filtered by area. GeoJSON is plain text without an index, which must be parsed in full and is therefore slower for big datasets.

### Why does my FGB file have no coordinate system?

The CRS in the FGB header is optional, so a file can be written without one. If it is missing, the CRS has to be assigned from the data source or documentation before the layer is used with other data.

### Can an FGB file contain several layers?

No. Each FGB file holds a single layer with one schema. To keep several layers, write each one to its own FGB file, or use a multi-layer format such as GeoPackage.

### What is a FGB file?

FlatGeobuf is an open, performance-oriented binary format for simple features, developed as an open-source project initiated by Björn Harrtell. It targets fast reading of large vector datasets, both locally and over HTTP, and supports streaming and spatially filtered access through range requests without a server-side service.

A file begins with a magic number and a header that holds the layer schema, geometry type, feature count and an optional coordinate reference system. An optional packed Hilbert R-tree spatial index follows, then the features, each serialized with FlatBuffers. Field names and string values are stored as UTF-8 without formal length limits. Point, line, polygon, multi-part and collection geometries are supported, optionally with Z and M values. Each file holds a single layer. The format is designed to be written once and read many times, so editing or appending features generally means rewriting the file.

### How do I open a FGB file?

FGB files can be opened in GDAL/OGR, QGIS, PostGIS, DuckDB and OpenLayers. Without any software you can preview and convert them online in MyGeodata Cloud.

### What can I convert FGB to?

Popular conversions are SHP, GeoJSON, GPKG, DXF, KML and XLSX. In total the Converter writes FGB data to 39 formats.

### How do I create a FGB file?

Convert existing data to FGB — for example from GeoJSON, SHP, KMZ, DWG and DXF. Upload the file, choose FGB as output and download the result.

