Python 2.7은 지원이 종료되었으며 2026년 1월 31일에
지원 중단됩니다. 지원 중단 후에는 조직에서 이전에 조직 정책을 사용하여 레거시 런타임의 배포를 다시 사용 설정한 경우에도 Python 2.7 애플리케이션을 배포할 수 없습니다. 기존 Python 2.7 애플리케이션은
지원 중단 날짜 이후에도 계속 실행되고 트래픽을 수신합니다.
지원되는 최신 Python 버전으로 마이그레이션하는 것이 좋습니다.
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-09-04(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-09-04(UTC)"],[[["\u003cp\u003eThe \u003ccode\u003eGeoPoint\u003c/code\u003e class represents a location on Earth using latitude and longitude coordinates.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGeoPoint\u003c/code\u003e objects are created by passing latitude and longitude values to the \u003ccode\u003eGeoPoint\u003c/code\u003e constructor, each within specified degree ranges.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGeoPoint\u003c/code\u003e objects can be used within a \u003ccode\u003eGeoField\u003c/code\u003e to make map locations searchable in documents.\u003c/p\u003e\n"],["\u003cp\u003eThe latitude property represents the north-south position, and the longitude property represents the east-west position, each with specific degree ranges and signs.\u003c/p\u003e\n"]]],[],null,["# The GeoPoint Class\n\nClass `GeoPoint` represents a point on the earth's surface represented by latitude and longitude coordinates.\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| python3\n|\n| /services/access). If you are updating to the App Engine Python 3 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/python-differences) to learn about your migration options for legacy bundled services.\n\n`GeoPoint` is defined in the module `google.appengine.api.search`.\n\nIntroduction\n------------\n\nThe GeoPoint class allows you to make map locations searchable. You start by instantiating the GeoPoint class and then pass that object to a specific document field: \n\n```python\nfrom google.appengine.api import search\n...\n# Construct the GeoPoint class\ngeopoint = search.GeoPoint(latitude, longitude)\n\nfields = [search.TextField(name='name', value=store_name),\n search.TextField(name='address', value=store_address),\n # Construct a GeoField passing geopoint as the value of that field\n search.GeoField(name='store_location', value=geopoint)\n ]\n```\n\nFor more information about performing location-based searches, please see [Queries on geopoint fields](/appengine/docs/legacy/standard/python/search/query_strings#queries_on_geopoint_fields).\n\nConstructor\n-----------\n\nThe constructor for class `GeoPoint` is defined as follows:\n\n\nGeoPoint(latitude, longitude)\n\n: A point on the earth's surface represented by latitude and longitude coordinates.\n\n:\n\n Arguments\n\n latitude\n\n : The angle between the equatorial plan and a line that passes through the GeoPoint, between -90 and 90 degrees.\n\n longitude\n\n : The angle east or west from a reference meridian to another meridian that passes through the GeoPoint, between -180 and 180 degrees.\n\n Exceptions\n\n TypeError\n\n : Any of the parameters has an invalid type, or an unknown attribute was passed.\n\n ValueError\n\n : An invalid value was passed for one of the parameters.\n\nProperties\n----------\n\nAn instance of class `GeoPoint` has the following properties:\n\nlatitude\n\n: An angular distance, in degrees, from the equator. Points located to the south of the equator have negative values, while points located to the north of it have positive values.\n\nlongitude\n\n: An angular distance, in degrees, from the prime meridian. Points located to the west of the prime meridian have positive values, while points located to the east of it have negative values."]]