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

パッケージ詳細v1.0.3

geocode

ジオコーディングリクエストを行うためのパッケージ。座標を場所に、住所を座標に変換する2つのメソッドを提供しています。

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

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

flutter pub add geocode

パッケージ概要

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

geocode パッケージは、地理座標と物理的な住所の間でスムーズな変換を可能にします。2つの主要なメソッドを提供しています。1つは座標を人間が読み取り可能な場所に逆ジオコーディングするもので、もう1つは住所を緯度と経度にフォワードジオコーディングするものです。クロスプラットフォーム対応を目的としており、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 件

ソースリポジトリ

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