toString
Returns the textual representation of the GeoPolygon, this is also formatting it in a way that makes it usable in queries, e.g.:
val outerRing = listOf(
GeoPoint.create(0.0, 0.0),
GeoPoint.create(10.0, 0.0),
GeoPoint.create(10.0, 10.0),
GeoPoint.create(0.0, 10.0),
GeoPoint.create(0.0, 0.0)
)
val searchArea = GeoPolygon.create(outerRing)
val results = realm.query<Restaurant>("location GEOWITHIN $searchArea").find()
Content copied to clipboard