flatbush_dart 1.2.2 copy "flatbush_dart: ^1.2.2" to clipboard
flatbush_dart: ^1.2.2 copied to clipboard

A fast static spatial index for 2D points and rectangles, Dart port of https://github.com/mourner/flatbush/tree/main.

Flatbush Dart #

Pub License

A fast static spatial index for 2D points and rectangles in Dart, ported from the excellent JavaScript implementation by Volodymyr Agafonkin, and includes the extension for geographic queries.

Usage #

// Initialize Flatbush for a given number type and number of items
final index = Flatbush.double64(1000);

// fill it with 1000 rectangles
for (final p in items) {
    index.add(
      minX: p.minX,
      minY: p.minY,
      maxX: p.maxX,
      maxY: p.maxY
    );
}

// perform the indexing
index.finish();

// make a bounding box query
final found = index.search(
  minX: minX,
  minY: minY,
  maxX: maxX,
  maxY: maxY
).map((i) => items[i]);
2
likes
150
pub points
41%
popularity

Publisher

verified publishermsfstef.dev

A fast static spatial index for 2D points and rectangles, Dart port of https://github.com/mourner/flatbush/tree/main.

Repository (GitHub)
View/report issues

Documentation

API reference

License

ISC (license)

Dependencies

collection, meta

More

Packages that depend on flatbush_dart