W3cubDocs

/RethinkDB Python

ReQL command: circle

Command syntax

r.circle([longitude, latitude], radius[, num_vertices=32, geo_system='WGS84', unit='m', fill=True]) → geometry
r.circle(point, radius[, {num_vertices=32, geo_system='WGS84', unit='m', fill=True]) → geometry

Description

Construct a circular line or polygon. A circle in RethinkDB is a polygon or line approximating a circle of a given radius around a given center, consisting of a specified number of vertices (default 32).

The center may be specified either by two floating point numbers, the latitude (−90 to 90) and longitude (−180 to 180) of the point on a perfect sphere (see Geospatial support for more information on ReQL’s coordinate system), or by a point object. The radius is a floating point number whose units are meters by default, although that may be changed with the unit argument.

Optional arguments available with circle are:

  • num_vertices: the number of vertices in the polygon or line. Defaults to 32.
  • geo_system: the reference ellipsoid to use for geographic coordinates. Possible values are WGS84 (the default), a common standard for Earth’s geometry, or unit_sphere, a perfect sphere of 1 meter radius.
  • unit: Unit for the radius distance. Possible values are m (meter, the default), km (kilometer), mi (international mile), nm (nautical mile), ft (international foot).
  • fill: if True (the default) the circle is filled, creating a polygon; if False the circle is unfilled (creating a line).

Example: Define a circle.

r.table('geo').insert({
    'id': 300,
    'name': 'Hayes Valley',
    'neighborhood': r.circle([-122.423246, 37.779388], 1000)
}).run(conn)

Related commands

Get more help

Couldn't find what you were looking for?

© RethinkDB contributors
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
https://rethinkdb.com/api/python/circle/