GeoBox

This class represents a rectangle on the surface of a the earth. It cannot be persisted - i.e you can't declare a Realm property that is of type GeoBox. It can only be used as a query argument for a geospatial query like this:

val bottomLeft = GeoPoint.create(latitude = 5.0, longitude = 5.0)
val topRight = GeoPoint.create(latitude = 10.0, longitude = 10.0)
val searchArea = GeoBox.create(bottomLeft, topRight)
val restaurants = realm.query<Restaurant>("location GEOWITHIN $0", searchArea).find()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val bottomLeft: GeoPoint

The bottom left corner of the rectangle.

Link copied to clipboard
abstract val topRight: GeoPoint

The top right corner of the rectangle.

Functions

Link copied to clipboard
abstract override fun toString(): String

Returns the textual representation of the GeoBox, this is also formatting it in a way that makes it usable in queries, e.g.: