couchbase/geocouch
56.5
Adequate · 23 September 2026
5.5k
lines of production code
Erlang
primary language
5
measurements over time
What this system is
This system is a geospatial extension for CouchDB and Couchbase that enables spatial indexing and querying capabilities. It provides a new R\*-tree based spatial index (vtree) and HTTP handlers to support geospatial search, including bounding box queries and geometry data handling. The codebase includes utilities for converting between OGC Well Known Binary and GeoJSON formats, alongside comprehensive test suites validating the spatial view and index operations.
How it got here
2011 — Build system migration and legacy code removal
4 changes.
This period focused on modernizing the project's build infrastructure by migrating to CMake and Rebar, enabling support for both Couchbase and Apache CouchDB. Concurrently, the team performed a significant cleanup by removing deprecated spatial index handlers, vtree visualization tools, and associated test suites to streamline the codebase.
2014–2015 — Geospatial indexing implementation
12 changes.
This period focused on the initial implementation of geospatial search capabilities for both CouchDB and Couchbase. The work introduced the vtree data structure and WKB conversion library to support spatial indexing, alongside comprehensive test suites to validate the new spatial view functionality.
Features
Add geocouch spatial view support
Introduces the gc-couchbase module, which provides spatial view capabilities for CouchDB. This includes the CMake build configuration, a rebar configuration that enforces warnings as errors, and the header file defining the spatial query arguments record structure.
gc-couchbase · high confidence
Added WKB library for converting between OGC Well Known Binary and GeoJSON
The wkb library has been added to the codebase, providing Erlang modules to convert between OGC Well Known Binary (WKB) and GeoJSON formats. The library includes a reader (wkb\_reader) that parses WKB binary data into GeoJSON structures, and a writer (wkb\_writer) that converts GeoJSON into WKB binary data. This supports various geometry types including Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. The library is built as an OTP application (version 1.2.0) and includes comprehensive unit tests for both reading and writing operations.
wkb · high confidence
Build configuration added for vtree module
The vtree module now includes build configuration files (CMakeLists.txt and rebar.config) that define how the Erlang sources are compiled and installed. The CMake script sets up the OTP application build for vtree version 0.1.0, specifying source and header directories and an installation path under lib/couchdb/plugins. The rebar configuration ensures test files are compiled and includes necessary header paths.
vtree · high confidence
Define vtree data structures and types
A new header file vtree.hrl is introduced, defining the core data structures for the vtree implementation. This includes type definitions for keys, geometries, and nodes, as well as record definitions for kv\_node, kp\_node, and vtree. The kv\_node record is expanded to include fields for geometry, body, size, and partition, while the vtree record defines the tree structure with fields for root node, less function, reduce function, and chunk thresholds.
vtree/include · high confidence
Initial implementation of the vtree spatial index
The vtree module is introduced as a new spatial index for Apache CouchDB and Couchbase, implementing an R\*-tree variant with support for bulk insertions, deletions, and searches. This change adds core components including node selection, splitting, and modification logic, along with serialization and utility functions, enabling spatial queries and efficient tree maintenance.
vtree/src · high confidence
Initial release of GeoCouch for Apache CouchDB
Added the GeoCouch spatial extension for Apache CouchDB, enabling geospatial indexing and query capabilities. The update includes a comprehensive README detailing installation, spatial query usage, and list function support, alongside build configuration (rebar.config.script) and test runner scripts to facilitate development and testing of the new spatial features.
gc-couchdb · high confidence
Introduce GeoCouch spatial indexing and querying capabilities
This change adds the core GeoCouch implementation to CouchDB, introducing support for spatial (geospatial) indexing and querying. The diff introduces a new suite of Erlang modules (\couch\_spatial\, \couch\_spatial\_index\, \couch\_spatial\_updater\, etc.) that enable the creation and management of spatial indexes. Users can now define spatial views in design documents and perform spatial queries using bounding boxes or ranges. The implementation includes HTTP handlers for querying and managing spatial indexes, a compactor for spatial data, and utilities for handling GeoJSON and WKB geometries. This effectively adds a new feature for geospatial search capabilities within CouchDB.
gc-couchdb/src · high confidence
Introduce new spatial index data structures for CouchDB
A new header file, couch\_spatial.hrl, has been added to define the internal record structures for spatial indexing. This includes records for spatial state, headers, query arguments (supporting multidimensional bounding boxes), spatial index definitions, and vtree state, establishing the data model for the new spatial search capabilities.
gc-couchdb/include · high confidence
Introduce new spatial view implementation and HTTP handlers
The gc-couchbase/src directory now contains a complete spatial view implementation, including the application definition (gc-couchbase.app.src), HTTP request handlers (spatial\_http.erl), the spatial merger (spatial\_merger.erl), and the core spatial view logic (spatial\_view.erl). This adds support for spatial queries and geometry data, enabling users to perform spatial indexing and querying via the Couchbase API.
gc-couchbase/src · high confidence
Removals
Removal of deprecated spatial index HTTP handlers
The deprecated spatial index HTTP handlers (couch\_httpd\_spatial, couch\_httpd\_spatial\_list) and their associated internal modules (couch\_spatial, couch\_spatial\_group, couch\_spatial\_updater, and geocouch\_duplicates) have been removed. This cleanup eliminates the old implementation of spatial queries and list functions, streamlining the codebase and removing legacy code that was no longer required.
src/geocouch · high confidence
Removed vtree visualization and benchmarking tools
The vtree module and its associated test suite, visualization helper, and benchmarking script have been removed from the codebase. This eliminates the ability to generate visual representations of the spatial index tree structure and run insertion performance benchmarks, as these were development and debugging aids rather than core functionality.
src/vtree · high confidence
Architecture
Migrate build system to CMake and Rebar
The project replaces the previous build configuration with a new CMakeLists.txt file and Rebar configuration files (rebar\_couchbase.config, rebar\_couchdb.config) to support building against both Couchbase and Apache CouchDB. The Makefile is updated to invoke Rebar for compilation and testing, and the build process now distinguishes between unit test builds (exporting all functions) and standard builds (including Dialyzer checks).
(repo-wide) · high confidence
Test coverage
Added comprehensive tests for spatial view functionality; Added spatial query tests for bounding box, offsets, and list functions; Added unit tests for the vtree module; Removed spatial test suite.
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 47 → 57 (+9.1)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 97 → 97 (+0.4)
- Architecture 100 → 100 (+0.0)
- Maturity 38 → 50 (+12.3)
- Readiness 24 → 37 (+12.4)
- Security 100 → 100 (+0.0)
Resolved (7)
- Coverage not included — suite not readable by the collector
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- No exposed public API
- Test reliability not included
- TooManyMethods: spatial_view (gc-couchbase/src/spatial_view.erl)
- complexity unreadable for .erl, .hrl — churn × complexity hotspots could not be measured
- dormant codebase — no living knowledge left to concentrate
New (19)
- Coverage not measured — no coverage collector is wired up
- Documentation: no installation or build instructions (README.md)
- Duplicated block (14 lines × 2) (gc-couchbase/src/spatial_view.erl)
- Duplicated block (14 lines × 2) (gc-couchbase/src/spatial_view.erl)
- Duplicated block (28 lines × 2) (gc-couchbase/src/spatial_view.erl)
- Duplicated block (6 lines × 2) (vtree/src/vtree_split.erl)
- TodoComment (gc-couchbase/src/spatial_view.erl)
- TodoComment (gc-couchdb/src/couch_spatial_list.erl)
- XxxComment (gc-couchbase/src/spatial_merger.erl)
- XxxComment (gc-couchbase/src/spatial_view.erl)
- XxxComment (gc-couchbase/src/spatial_view.erl)
- XxxComment (gc-couchbase/src/spatial_view.erl)
- XxxComment (gc-couchbase/src/spatial_view.erl)
- XxxComment (gc-couchbase/src/spatial_view.erl)
- XxxComment (gc-couchdb/src/couch_spatial_compactor.erl)
- XxxComment (gc-couchdb/src/couch_spatial_updater.erl)
- XxxComment (gc-couchdb/src/geocouch_file.erl)
- XxxComment (vtree/src/vtree_io.erl)
- XxxComment (vtree/src/vtree_io.erl)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
couchbase/geocouch was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 23 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 68f3b9d36630682d17ca5232770f1693b9b8fa18 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-955b9cee9818.