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

套件詳情v3.0.0

mgrs_dart

用於在WGS84緯度/經度和MGRS座標之間進行轉換的工具(proj4js/mgrs的Dart版本)。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
120萬
喜歡數
7
Pub 分數
160

安裝套件

flutter pub add mgrs_dart

套件介紹

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

mgrs_dart 套件提供了一種 Dart 實現,可在 WGS84 緯度/經度座標與軍用格網參考系統(MGRS)座標之間進行轉換。其設計旨在模擬 proj4js/mgrs 的功能,提供準確且高效的地圖空間轉換。適用於需要在軍事或地理情境中精確定位引用的應用程式,支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 與 Linux。此套件輕量級,可順暢整合至 Flutter 項目中。

適用情境

  • 軍事與國防應用
  • 地理空間資料處理
  • 基於位置的映射工具
  • 欄位資料蒐集系統
  • 跨平台的座標標準化

主要特色

  • 精確的 WGS84 到 MGRS 轉換
  • 支援所有主要平台
  • 輕量且易於整合
  • 雙向座標轉換
  • 開源且持續維護

適合對象

  • 開發人員處理地理空間資料
  • 需要MGRS標準的應用程式
  • Flutter 應用需要座標系統轉換
  • 涉及野外作業或軍事後勤的項目

使用建議

  • 需要了解MGRS坐標系統
  • 僅限WGS84和MGRS轉換
  • 不支援其他座標系統
  • 最適合需要MGRS精度的用例
  • 不適用於一般用途的GIS工作流程

原始 README

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

mgrs_dart

Utility for converting between WGS84 lat/lng and MGRS coordinates (Dart version of proj4js/mgrs).

Installing

Add mgrs_dart to pubspec.yml (dependencies section), then run pub get to download the new dependencies.

dependencies:
  mgrs_dart: any # or the latest version on Pub

Using

Mgrs_dart has 3 methods

  • toPoint, takes an mgrs string, returns an array of [lon,lat]
  • forward, takes an array of [lon,lat] and optional accuracy and returns an mgrs string
  • inverse, takes an mgrs string and returns a bbox.
import 'package:mgrs_dart/mgrs_dart.dart';

void main() {
  var point = [-115.08209766323476, 36.236123461597515];
  var mgrsString = '11SPA7234911844';
  var accuracy = 5;

  // MGRS string to LonLat (results List<double>)
  var calculatedPoint = Mgrs.toPoint(mgrsString);
  print("Mgrs.toPoint('$mgrsString') = $calculatedPoint;");
  // Mgrs.toPoint('11SPA7234911844') = [-115.08209766323476, 36.236123461597515];

  // LonLat to MGRS string (results String)
  var calculatedMgrsString = Mgrs.forward(point, accuracy);
  print("Mgrs.forward($point, $accuracy) = '$calculatedMgrsString';");
  // Mgrs.forward([-115.08209766323476, 36.236123461597515], 5) = '11SPA7234911844';

  // MGRS string to BBOX  (results List<double>)
  var calculatedBox = Mgrs.inverse(mgrsString);
  print("Mgrs.inverse('$mgrsString') = $calculatedBox;");
  // Mgrs.inverse('11SPA7234911844') = [-115.08209766323476, 36.236123461597515, -115.08208632067898, 36.23613229376363];
}

Author

Mgrs_dart was ported from proj4js/mgrs by Gergely Padányi-Gulyás (@fegyi001) at Ulyssys Ltd, Budapest, Hungary.

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案