RethinkDB.Query.Geospatial

ReQL methods for aggregation operations.

All examples assume that use RethinkDB has been called.

Summary

circle(left, right)
circle(left, right, opts)

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)

distance(left, right)
distance(left, right, opts)

Compute the distance between a point and another geometry object. At least one of the geometry objects specified must be a point

fill(arg)
fill(arg, opts)
geojson(arg)
geojson(arg, opts)
get_intersecting(left, right)
get_intersecting(left, right, opts)
get_nearest(left, right)
get_nearest(left, right, opts)
includes(left, right)
includes(left, right, opts)
intersects(left, right)
intersects(left, right, opts)
line(args)

Construct a geometry object of type Line. The line can be specified in one of two ways:

point(arg1)

Construct a geometry object of type Point. The point is specified by two floating point numbers, the longitude (−180 to 180) and latitude (−90 to 90) of the point on a perfect sphere

point(left, right)
point(left, right, opts)
polygon(args)
polygon_sub(left, right)
polygon_sub(left, right, opts)
to_geojson(arg)
to_geojson(arg, opts)

Functions

circle(left, right)
circle(left, right, opts)

Specs:

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).
distance(left, right)
distance(left, right, opts)

Specs:

Compute the distance between a point and another geometry object. At least one of the geometry objects specified must be a point.

Optional arguments available with distance are:

  • 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 to return the distance in. Possible values are m (meter, the default), km (kilometer), mi (international mile), nm (nautical mile), ft (international foot).

If one of the objects is a polygon or a line, the point will be projected onto the line or polygon assuming a perfect sphere model before the distance is computed (using the model specified with geo_system). As a consequence, if the polygon or line is extremely large compared to Earth’s radius and the distance is being computed with the default WGS84 model, the results of distance should be considered approximate due to the deviation between the ellipsoid and spherical models.

fill(arg)

Specs:

fill(arg, opts)
geojson(arg)

Specs:

geojson(arg, opts)
get_intersecting(left, right)
get_intersecting(left, right, opts)

Specs:

get_nearest(left, right)
get_nearest(left, right, opts)

Specs:

includes(left, right)

Specs:

includes(left, right, opts)
intersects(left, right)

Specs:

intersects(left, right, opts)
line(args)

Specs:

Construct a geometry object of type Line. The line can be specified in one of two ways:

  • Two or more two-item arrays, specifying latitude and longitude numbers of the line’s vertices;
  • Two or more Point objects specifying the line’s vertices.
point(arg1)

Specs:

Construct a geometry object of type Point. The point is specified by two floating point numbers, the longitude (−180 to 180) and latitude (−90 to 90) of the point on a perfect sphere.

point(left, right)
point(left, right, opts)
polygon(args)

Specs:

polygon_sub(left, right)

Specs:

polygon_sub(left, right, opts)
to_geojson(arg)

Specs:

to_geojson(arg, opts)