Python 2.7 has reached end of support
and will be
deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Python 2.7
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Python
2.7 applications will continue to run and receive traffic after their
deprecation date. We recommend that
you
migrate to the latest supported version of Python.
The GeoPoint Class
Stay organized with collections
Save and categorize content based on your preferences.
Class GeoPoint
represents a point on the earth's surface represented by latitude and longitude coordinates.
GeoPoint
is defined in the module google.appengine.api.search
.
Introduction
The 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:
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)
]
For more information about performing location-based searches, please see Queries on geopoint fields
.
Constructor
The constructor for class GeoPoint
is defined as follows:
-
GeoPoint(latitude, longitude)
A point on the earth's surface represented by latitude and longitude coordinates.
Arguments
- latitude
The angle between the equatorial plan and a line that passes through the GeoPoint, between -90 and 90 degrees.
- longitude
The angle east or west from a reference meridian to another meridian that passes through the GeoPoint, between -180 and 180 degrees.
Exceptions
- TypeError
Any of the parameters has an invalid type, or an unknown attribute was passed.
- ValueError
An invalid value was passed for one of the parameters.
Properties
An instance of class GeoPoint
has the following properties:
- latitude
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.
- longitude
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 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,[]]