fromgoogle.appengine.apiimportsearch...# Construct the GeoPoint classgeopoint=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 fieldsearch.GeoField(name='store_location',value=geopoint)]
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-21。"],[[["\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."]]