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

패키지 상세v1.0.3

geocode

지오코딩 요청을 수행하는 패키지입니다. 좌표를 위치로, 주소를 좌표로 변환하는 두 가지 메서드를 제공합니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1.6만
좋아요
124
Pub 점수
160

패키지 설치

flutter pub add geocode

패키지 개요

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

geocode 패키지는 지리 좌표와 물리적 주소 간의 원활한 변환을 가능하게 합니다. 두 가지 핵심 메서드를 제공합니다. 하나는 좌표를 인간이 읽을 수 있는 위치로 역지오코딩하는 것이고, 다른 하나는 주소를 위도와 경도로 정방향 지오코딩하는 것입니다. 크로스플랫폼 사용을 위해 설계되어 Android, iOS, Web, macOS, Windows, Linux를 지원합니다. 가볍고 Flutter 앱에서 위치 기반 서비스가 필요한 경우 쉽게 통합할 수 있습니다. imanol.dev에 의해 개발되었으며 외부 종속성 없이 지오로케이션 작업을 단순화합니다.

사용 사례

  • 사용자 위치 표시를 위한 역 지오코딩
  • GPS 좌표에서 주소 검색
  • 위치 기반 검색 기능
  • 주소에서 지도 핀 배치
  • 여행 또는 배송 앱에서의 위치 정보
  • 주소 입력과 지도 통합

주요 기능

  • 정방향 및 역방향 지오코딩을 위한 간단한 API
  • 크로스 플랫폼 호환성
  • 경량이며 종속성 없음
  • 모든 주요 플랫폼을 지원합니다
  • Flutter와의 간편한 통합
  • 깔끔하고 읽기 쉬운 응답 구조

적합한 대상

  • 지도를 통합한 앱을 개발하는 개발자
  • 주소에서 좌표로 변환을 필요로 하는 앱
  • 다중 플랫폼의 위치 인식 애플리케이션
  • 지오로케이션 기능 프로토타이핑
  • 최소한의 지오코딩 오버헤드가 필요한 프로젝트

고려 사항

  • 외부 지오코딩 서비스(예: Google Maps, OpenStreetMap)에 의존합니다
  • 백엔드에 따라 속도 제한이 적용될 수 있습니다
  • 요청을 위해 인터넷 연결이 필요합니다
  • 정확도는 기반 지오코딩 제공자에 따라 달라집니다
  • 내장 캐시 메커니즘이 없음
  • 공급자에 따라 API 키 구성이 필요할 수 있습니다

원본 README

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

Geocode library

workflow name likes popularity pub points

Introduction

Package to make Geocode requests. It exposes two methods to translate coordinates into locations and addresses into coordinates.

It's a basic implementation of the most useful methods in the Dart language of the following API geocode.xyz.

It's free for one request per second quota. Register in the above site to get an API Key and increase the number of requests to 10 per second. These are paid plans that allow more requests per second. For more information, review the site.

Installation

dependecies:
  geocode: 1.0.3

Example

See example/main.dart

import 'package:geocode/geocode.dart';

void main() async {
  GeoCode geoCode = GeoCode();

  try {
    Coordinates coordinates = await geoCode.forwardGeocoding(
        address: "532 S Olive St, Los Angeles, CA 90013");

    print("Latitude: ${coordinates.latitude}");
    print("Longitude: ${coordinates.longitude}");
  } catch (e) {
    print(e);
  }
}

Methods

Constructor

Library GeoCode class constructor, includes an optional parameter to set the apiKey.

GeoCode({this.apiKey});
Reverse Geocode

Method to translate a pair of latitude and longitude coordinates into a real address.

Future<Address> reverseGeocoding({double latitude, double longitude})
Forward Geocode

Method to translate an address into a pair of latitude and longitudecoordinates.

Future<Coordinates> forwardGeocoding({String address})

Responses

Reverse Geocode
Attribute Type Description
elevation double The elevation in meters.
timezone String The timezone.
geoNumber int geocode is an alphanumeric string representing both latitude and longitude as one value. Nearby points will have similar geocodes.
streetNumber int The properly formated street address number to be returned.
streetAddress String The properly formated street address to be returned.
city String The properly formated city name to be returned.
countyCode String The properly formated country code to be returned.
countryName String The properly formated country name to be returned.
region String The properly formated region to be returned.
postal String The properly formated postal code to be returned.
distance double The distance of the result location from the input location.
Forward Geocode
Attribute Type Description
latitude double Latitude coordinate value.
longitude double Longitude coordinate value.

Exceptions

  • AccountOutOfCreditsException: auth has ran out of credits.
  • AuthTokenNotFoundException: authentication token: auth not found.
  • PostalCodeFormatException: postal Code is not in the proper Format.
  • RequestThrottledException: request Throttled.
  • InvalidQueryException: supply a valid query.
  • EmptyResultException: your request did not produce any results. Check your spelling and try again.
  • UnknownErrorException: unkown error.

Dependencies

http: '>=0.13.0 <2.0.0'

License

BSD 3-Clause License

카테고리

의존성

의존성 목록 1 개

소스 저장소

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