パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v3.1.0

google_polyline_algorithm

Google のポリラインエンコーディング損失圧縮アルゴリズムのDart実装。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
2.9万
いいね数
55
Pub ポイント
160

パッケージをインストール

flutter pub add google_polyline_algorithm

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Google の Polyline エンコーディングアルゴリズムの Dart 実装で、緯度と経度の座標をコンパクトな文字列形式に圧縮するために使用されます。この損失圧縮により、マップパスのデータサイズが削減され、地理情報アプリケーションにおける効率的な送信および保存に最適です。このパッケージは、Android、iOS、Web、macOS、Windows、Linux を含むすべての主要プラットフォームをサポートしています。開発者が最小限のオーバーヘッドでポリラインをエンコードおよびデコードでき、ほとんどのマッピング用途において十分な精度を維持します。

用途

  • マップルートの可視化
  • 効率的なGPSデータ送信
  • 地理パスのコンパクトなストレージ
  • リアルタイムでの位置追跡
  • 地理空間データの共有
  • オフラインマップデータ

主な機能

  • 損失のある座標圧縮
  • クロスプラットフォーム対応
  • シンプルなエンコード/デコード API
  • 高性能
  • 通常の地図距離に正確
  • 軽量な依存関係

適している対象

  • モバイルおよびウェブマッピングアプリ
  • 位置ベースのサービス
  • ルート計画ツール
  • データ効率的な地理空間 API
  • 大規模なGPSデータセットを扱うアプリケーション

注意事項

  • 圧縮による精度の低下
  • 高精度の科学的測定には適していません
  • 極端な緯度におけるエッジケースの慎重な取り扱いが必要です
  • ポリラインのみのジオメトリに制限
  • 重要なナビゲーションシステムの検証が必要になる可能性があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

google_polyline_algorithm

Build codecov Pub GitHub GitHub stars

Dart implementation of Googles Polyline Encoding lossy compression Algorithm.

Getting Started

This package adds following methods to work with Googles Polyline Encoding Algorithm:

  • encodePoint(num current, {num previous = 0, int accuracyExponent = 5}) encodes a single coordinate

  • encodePolyline(List<List<num>> coordinates, {int accuracyExponent = 5}) encodes a list of coordinates into an encoded polyline stirng

  • decodePolyline(String polyline, {int accuracyExponent = 5}) decodes an encoded polyline string into a list of coordinates

Examples

import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';

final coord = encodePoint(-179.9832104);
print(coord);
// output is `~oia@'

final coords = encodePolyline([
  [38.5, -120.2],
  [40.7, -120.95],
  [43.252, -126.453],
]);
print(coords);
// output is `_p~iF~ps|U_ulLnnqC_mqNvxq`@'

final polyline = decodePolyline('_p~iF~ps|U_ulLnnqC_mqNvxq`@');
print(polyline);
// output is [[38.5, -120.2],[40.7, -120.95],[43.252, -126.453],]

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト