GeoCircle

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

val newYork = GeoPoint.create(latitude = 40.730610, longitude = -73.935242)
val searchArea = GeoCircle.create(center = newYork, radius = Distance.fromMiles(2.0))
val restaurants = realm.query<Restaurant>("location GEOWITHIN $0", searchArea).find()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val center: GeoPoint

Center of the circle.

Link copied to clipboard
abstract val radius: Distance

Radius of the circle as an equatorial distance. Distance cannot be a negative number.

Functions

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

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