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()
Content copied to clipboard