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
매개변수 중 하나에 잘못된 값이 전달되었습니다.
속성
GeoPoint
클래스의 인스턴스에는 다음 속성이 있습니다.
- latitude
적도에서의 각도 거리(도)입니다. 적도 남쪽에 위치한 지점은 음수 값을 갖고 적도 북쪽에 위치한 지점은 양수 값을 갖습니다.
- longitude
본초자오선에서의 각도 거리(도)입니다. 본초자오선 서쪽에 위치한 지점은 양수 값을 갖고 본초자오선 동쪽에 위치한 지점은 음수 값을 갖습니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-03-26(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-26(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."]]],[]]