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

latlong2 표지
패키지 상세v0.10.1

latlong2

일반적인 위도 및 경도 계산을 위한 가벼운 라이브러리

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
133만
좋아요
403
Pub 점수
150

패키지 설치

flutter pub add latlong2

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

latlong2는 효율적이고 정확한 위도 및 경도 계산을 위한 가벼운 Dart 라이브러리입니다. 거리 계산, 중점 결정, 좌표 변환과 같은 핵심 지리공간 유틸리티를 제공합니다. 성능과 간결함을 고려하여 개발되었으며, 안드로이드, iOS, 웹, macOS, Windows, 리눅스 등 다양한 플랫폼을 지원합니다. 큰 맵핑 프레임워크의 부담 없이 기본적인 위치 정보 작업이 필요한 애플리케이션에 이상적입니다. 깔끔한 API 덕분에 Flutter 프로젝트에 쉽게 통합할 수 있습니다.

사용 사례

  • 두 좌표 사이의 거리 계산
  • 위치 사이의 중점 찾기
  • 좌표 형식 간 변환
  • 지오페싱 및 근접 감지
  • 지도 기반 앱 개발

주요 기능

  • 경량이고 빠름
  • 크로스 플랫폼 지원
  • 간단하고 직관적인 API
  • 일반적인 지리공간 작업을 지원합니다
  • 외부 종속성 없음

적합한 대상

  • 지오로케이션 계산이 필요한 Flutter 앱
  • 지도 기능을 개발하는 개발자
  • 최소한의 지리공간 논리를 필요로 하는 프로젝트
  • 위치 기반 서비스의 프로토타이핑
  • 다중 플랫폼을 대상으로 하는 앱

고려 사항

  • 완전한 지도 렌더링을 포함하지 않음
  • 기본 지리공간 계산에 한정
  • 내장된 지오코딩 또는 역지오코딩 없음
  • 복잡한 GIS 작업에 적합하지 않습니다
  • 극점과 같은 에지 케이스를 수동으로 처리해야 합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

This is a fork of https://github.com/MikeMitterer/dart-latlong. The goal is to keep it up to date with Dart language changes.

LatLong provides a lightweight library for common latitude and longitude calculation.

This library supports both, the "Haversine" and the "Vincenty" algorithm.

"Haversine" is a bit faster but "Vincenty" is far more accurate!

LatLong

Catmull-Rom algorithm is used for smoothing out the path.

Basic usage

Distance
final Distance distance = Distance();

// km = 423
final double km = distance.as(LengthUnit.kilometer,
    LatLng(52.518611, 13.408056), LatLng(51.519475, 7.46694444));

// meter = 422591.551
final double meter = distance(
  LatLng(52.518611, 13.408056),
  LatLng(51.519475, 7.46694444),
);

Offset

final Distance distance = const Distance();
final num distanceInMeter = (earthRadius * pi / 4).round();

final p1 = LatLng(0.0, 0.0);
final p2 = distance.offset(p1, distanceInMeter, 180);

// LatLng(latitude:-45.219848, longitude:0.0)
print(p2.round());

// 45° 13' 11.45" S, 0° 0' 0.00" O
print(p2.toSexagesimal());

Path smoothing

// zigzag is a list of coordinates
final Path path = Path.from(zigzag);

// Result is below
final Path steps = path.equalize(8, smoothPath: true);

Smooth path

Features and bugs

Please file feature requests and bugs at the issue tracker.

License

Copyright 2015 Michael Mitterer (office@mikemitterer.at),
IT-Consulting and Development Limited, Austrian Branch

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language
governing permissions and limitations under the License.

If this plugin is helpful for you - please (Circle) me or star this repo here on GitHub

카테고리

의존성

의존성 목록 1 개

소스 저장소

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