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

套件詳情v2.1.0

dart_geohash

一個簡單的經度/緯度和地理哈希的編碼、解碼及鄰居查找工具。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
2.7萬
喜歡數
52
Pub 分數
150

安裝套件

flutter pub add dart_geohash

套件介紹

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

一個輕量級的 Dart 套件,用於將地理座標編碼和解碼為 geohash,以及尋找鄰近的 geohash。透過將緯度和經度對轉換為緊湊的字串表示,該套件實現了高效的空間索引和鄰近查詢。此套件支援所有主要平台,非常適合需要快速地理空間運算的應用程式,例如基於位置的服務或地圖群集。

適用情境

  • 地理空間資料索引
  • 基於位置的搜尋
  • 地圖聚類
  • 接近檢測
  • 空間查詢優化

主要特色

  • 將緯度/經度編碼/解碼為地理哈希
  • 查找相鄰的geohash鄰居
  • 高效能,開銷極小
  • 跨平台相容性
  • 簡單、直覺的 API

適合對象

  • 具有位置功能的行動和網頁應用
  • 即時位置追蹤系統
  • 地理空間資料儲存與檢索
  • 需要高效空間分割的應用程式

使用建議

  • 僅限基本的geohash操作
  • 不支援複雜的空間查詢
  • 需要手動處理精度層級
  • 未針對大規模地理空間資料庫進行優化

原始 README

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

dart_geohash

GeoHash is a simple way of storing a latitude/longitude location as a simple string.

Includes a Class for encode/decode and finding neighbors as well as a Class that can be given a location and will contain all needed information for that GeoHash.

Example

// Create a simple geohash from a given string
GeoHash myHash = GeoHash("9yf0zhhtj");
// Immediately be able to get all other information related to it
myHash.geohash;
myHash.longitude();
myHash.latitude(decimalAccuracy: 4);
myHash.neighbors; // Returns a Map with itself and 8 surrounding neighbors
myHash.neighbor(Direction.NORTH);
// You can also create it from a specific lon/lat
GeoHash myOtherHash = GeoHash.fromDecimalDegrees(-98.1235, 38.1234);
// Separately you can use only the Geohasher functions
GeoHasher geoHasher = GeoHasher();
geoHasher.encode(-98, 38); // Returns a string geohash
geoHasher.encode(-98, 38, precision: 6) // Returns string geohash with length
geoHasher.decode("9yf0zhhtj"); // Returns decimal longitude/latitude
geoHasher.neighbors("9yf0zhhtj"); // Returns itself and 8 neighbors as a Map

Based on the Python Package Mapzen GeoHash

所屬分類

原始碼儲存庫

使用此套件的專案