Skip to content
pubscout

r_tree

3.0.2, released 9 months ago by workiva.com

An R-tree implementation to index and query two-dimensional data in Dart.

WASM-ready
$ flutter pub add r_tree
Source repository

What it does

Provides an R-tree data structure for spatial access methods, indexing multi-dimensional information like rectangles and geographical coordinates. Items can be inserted and balanced via the RTree class and queried using rectangles.

AI-written summary of version 3.0.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to index and query two-dimensional spatial data efficiently.
  • You are working with bounding boxes, rectangles, or coordinates.

Skip it when

  • You need a general-purpose key-value store or traditional database.
  • You are dealing with high-dimensional data beyond 2D spatial indexing.

Strengths

  • Dedicated recursive R-tree implementation for Dart.
  • Supports bulk loading and filtering search results.
  • Includes performance benchmarks and branch factor tuning.

Weaknesses

  • License is unknown.
  • Limited to two-dimensional data structures.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0

not documented

import 'package:r_tree/r_tree.dart';

// Create and use the RTree
var rtree = RTree<String>();
rtree.add(Rectangle(0, 0, 10, 10), 'item1');
var results = rtree.search(Rectangle(0, 0, 5, 5));

Alternatives

Packages that do the same job and could replace r_tree.

  • csv_plus

    Fast, zero-dependency CSV parser, encoder, streamer, and query engine for Dart.

  • kdtree

    A fast Dart implementation of the k-dimensional (k-d) tree data structure.

  • rbush

    High-performance Dart R-tree spatial index for points and rectangles.

Works with

Packages commonly used together with r_tree: ones it builds on, ones built on it, and its own family.