cellulite
An embedded geospatial database built on LMDB for storing and querying GeoJSON shapes.
Repository Health
Technical Analysis
cellulite is an embedded geospatial database for Rust that stores and retrieves shapes in the GeoJSON format on top of the memory-mapped LMDB key-value store. Developed for Meilisearch, it indexes geometries using H3 hexagonal cells so applications can insert GeoJSON documents by ID and run spatial queries directly inside their own process with no separate database server.
What You Get
- An embedded geospatial store backed by memory-mapped LMDB
- Insertion and removal of GeoJSON documents keyed by numeric ID
- H3 hexagonal cell indexing for efficient spatial lookups
- Transactional reads and writes through heed’s typed LMDB API
Common Use Cases
- Adding geospatial filtering to a Meilisearch-style search engine
- Storing and querying GeoJSON shapes without a standalone GIS server
- Indexing points and polygons for proximity or containment queries
Under The Hood
Architecture
The crate exposes a Cellulite struct (lib.rs) that manages several LMDB databases opened through heed. builder.rs and metadata/ handle database setup, keys.rs encodes spatial keys, and geometries are indexed into H3 hexagonal cells (via the h3o crate) with roaring bitmaps (roaring.rs) tracking cell membership. reader.rs serves queries while writes and reads run inside heed transactions.
Tech Stack
Rust (edition 2024) organized as a workspace, built on heed (LMDB bindings) for storage, the geo, geo-types, and geojson crates for geometry, h3o for hexagonal indexing, roaring for compressed bitmaps, and zerometry for zero-copy geometry access.
Code Quality
The code is modular, separating storage, indexing, keys, and reading into distinct files, and includes an in-repo test module plus a benchmarks crate and examples. As a younger project it is still evolving its API, but its use within the Meilisearch ecosystem drives practical, workload-informed design.
API Design
The primary entry point is Cellulite::create_from_env, after which add and remove operate on GeoJSON within explicit heed transactions. The transactional, LMDB-oriented model is powerful but assumes familiarity with heed environments and write transactions, which raises the initial learning curve somewhat.