搜尋套件、儲存庫與 APP 分類

套件詳情v3.0.2

r_tree

用於索引和查詢二維數據的 R 樹實作

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
2萬
喜歡數
11
Pub 分數
145

安裝套件

flutter pub add r_tree

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

r_tree 套件提供了一個 R 樹實作,用於在 Dart 中高效地索引與查詢二維空間資料。它支援快速的範圍查詢與最近鄰搜尋,非常適合應用於地理座標、碰撞偵測或版面管理。此套件專為效能與跨平台相容性設計,支援 Android、iOS、Web、macOS、Windows 與 Linux。該套件由 Workiva 維護,並可透過 pub 與 Flutter 專案無縫整合。

適用情境

  • 空間數據索引
  • 遊戲中的碰撞檢測
  • 地理坐標查詢
  • UI 元素命中測試
  • 基於距離的搜尋
  • 基於地圖的應用程式功能

主要特色

  • 高效的一維範圍查詢
  • 支援最近鄰搜尋
  • 跨平台相容性
  • 高效能空間索引
  • 用於插入和查詢的簡單 API
  • 執行緒安全作業

適合對象

  • 遊戲開發
  • GIS 應用
  • 具有空間邏輯的互動式 UI
  • 資料視覺化工具
  • 位置感知應用
  • 效能敏感的空間操作

使用建議

  • 最適合2D資料
  • 未針對無分區的大數據集進行優化
  • 需要仔細處理座標精度
  • 在某些使用情境中,僅限於靜態或批次更新的資料
  • 無內建持久化支援

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

RTree Build Status

A recursive RTree library written in Dart. This R-tree implementation is used to index and query two-dimensional data. Items are inserted and balanced via the RTree class and can then be queried by Rectangle. The balancing can be tweaked by modifying the branch factor of the RTree.

"R-trees are tree data structures used for spatial access methods, i.e., for indexing multi-dimensional information such as geographical coordinates, rectangles or polygons." - http://en.wikipedia.org/wiki/R-tree

Example

Run the example app for a visual demonstration of the RTree

webdev serve example:8080

Navigate to http://localhost:8080. A canvas is drawn, click & drag on the canvas to add rectangles of various colors to your RTree, then click the search button and click & drag over an area of the canvas to search it for rectangles.

Benchmarks

Run the benchmarks in the command line (Dart VM) using:

dart benchmark/benchmarks.dart

You can also run them in a browser using dart2js. This takes an extra step since webdev will only build the web directory as of this writing. You'll also need some binary for serving a directory on a web server, the example below uses serve.

cp -R benchmark/ web
webdev build
serve build

Click the run button and observe the output in the browser console.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。