패키지, 저장소 및 앱 카테고리 검색

패키지 상세v3.1.0

google_polyline_algorithm

Google의 폴리라인 인코딩 손실 압축 알고리즘의 다트 구현.

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],]

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트