GeoPoint クラス
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
GeoPoint
クラスは、緯度と経度の座標で指定される地球上の地点を表します。
GeoPoint
は、google.appengine.api.search
モジュールで定義されます。
概要
GeoPoint クラスを使用すると、地図上の場所を検索できるようになります。まず、GeoPoint クラスをインスタンス化してから、そのオブジェクトを特定のドキュメント フィールドに渡します。
from google.appengine.api import search
...
# Construct the GeoPoint class
geopoint = search.GeoPoint(latitude, longitude)
fields = [search.TextField(name='name', value=store_name),
search.TextField(name='address', value=store_address),
# Construct a GeoField passing geopoint as the value of that field
search.GeoField(name='store_location', value=geopoint)
]
場所に基づいて検索を行う方法の詳細については、Queries on geopoint fields
をご覧ください。
コンストラクタ
GeoPoint
クラスのコンストラクタは、次のように定義されます。
-
GeoPoint(latitude, longitude)
緯度と経度の座標で表される地球上の地点。
引数
- latitude
赤道面と GeoPoint を通る線との間の角度。-90~90 度。
- longitude
基準子午線と GeoPoint を通る別の子午線との間の角度(東側または西側)。-180~180 度。
例外
- TypeError
いずれかのパラメータが無効なタイプであるか、不明な属性が渡されました。
- ValueError
パラメータのいずれか 1 つに対して無効な値が渡されました。
プロパティ
GeoPoint
クラスのインスタンスには次のプロパティがあります。
- latitude
赤道からの角距離(度数)。赤道の南に位置する地点は負の値になり、北に位置する地点は正の値になります。
- longitude
グリニッジ子午線からの角距離(度数)。グリニッジ子午線の西に位置する地点は正の値になり、東に位置する地点は負の値になります。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-03-06 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-06 UTC。"],[[["The `GeoPoint` class represents a location on Earth using latitude and longitude coordinates."],["`GeoPoint` objects are created by passing latitude and longitude values to the `GeoPoint` constructor, each within specified degree ranges."],["`GeoPoint` objects can be used within a `GeoField` to make map locations searchable in documents."],["The latitude property represents the north-south position, and the longitude property represents the east-west position, each with specific degree ranges and signs."]]],[]]