A simple geographical region bounded by two latitude lines, and two longitude lines, i.e., a
"rectangle". It's not really a rectangle, of course, because longitude lines are not really
parallel.
Intended for use in a geo-containment predicate filter.
Determines whether the given GeoPt value lies within this geographic region. If the
point lies on the border of the region it is considered to be contained.
[[["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-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eQuery.GeoRegion.Rectangle\u003c/code\u003e defines a geographic area bounded by two latitude lines and two longitude lines, forming a "rectangle" shape.\u003c/p\u003e\n"],["\u003cp\u003eThis class is designed for use in geo-containment filters, to determine if a given point lies within the defined geographic region.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eRectangle\u003c/code\u003e constructor requires two \u003ccode\u003eGeoPt\u003c/code\u003e parameters, \u003ccode\u003esouthwest\u003c/code\u003e and \u003ccode\u003enortheast\u003c/code\u003e, to define the boundaries of the rectangular region.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003econtains(GeoPt point)\u003c/code\u003e method checks if a specified \u003ccode\u003eGeoPt\u003c/code\u003e lies within the defined \u003ccode\u003eRectangle\u003c/code\u003e region, including points on the border.\u003c/p\u003e\n"],["\u003cp\u003eMethods such as \u003ccode\u003egetNortheast()\u003c/code\u003e, \u003ccode\u003egetSouthwest()\u003c/code\u003e, \u003ccode\u003eequals(@Nullable Object o)\u003c/code\u003e, \u003ccode\u003ehashCode()\u003c/code\u003e, and \u003ccode\u003etoString()\u003c/code\u003e are also available to interact with and define the GeoRegion.\u003c/p\u003e\n"]]],[],null,["# Class Query.GeoRegion.Rectangle (2.0.0)\n\n public static final class Query.GeoRegion.Rectangle extends Query.GeoRegion\n\nA simple geographical region bounded by two latitude lines, and two longitude lines, i.e., a\n\"rectangle\". It's not really a rectangle, of course, because longitude lines are not really\nparallel.\n\nIntended for use in a geo-containment predicate filter. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e [Query.GeoRegion](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Query.GeoRegion) \\\u003e Query.GeoRegion.Rectangle \n\nInherited Members\n-----------------\n\n[Query.GeoRegion.contains(GeoPt)](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Query.GeoRegion#com_google_appengine_api_datastore_Query_GeoRegion_contains_com_google_appengine_api_datastore_GeoPt_) \n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nConstructors\n------------\n\n### Rectangle(GeoPt southwest, GeoPt northeast)\n\n public Rectangle(GeoPt southwest, GeoPt northeast)\n\nMethods\n-------\n\n### contains(GeoPt point)\n\n public boolean contains(GeoPt point)\n\nDetermines whether the given [GeoPt](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.GeoPt) value lies within this geographic region. If the\npoint lies on the border of the region it is considered to be contained.\n\n**Overrides** \n[Query.GeoRegion.contains(GeoPt point)](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Query.GeoRegion#com_google_appengine_api_datastore_Query_GeoRegion_contains_com_google_appengine_api_datastore_GeoPt_)\n\n### equals(@Nullable Object o)\n\n public boolean equals(@Nullable Object o)\n\n**Overrides** \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-)\n\n### getNortheast()\n\n public GeoPt getNortheast()\n\n### getSouthwest()\n\n public GeoPt getSouthwest()\n\n### hashCode()\n\n public int hashCode()\n\n**Overrides** \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--)\n\n### toString()\n\n public String toString()\n\n**Overrides** \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)"]]