Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.01 KB

File metadata and controls

31 lines (22 loc) · 1.01 KB
layout api-command
language Java
permalink api/java/get_intersecting/
command getIntersecting
related_commands
getNearest
get_nearest/

Command syntax

{% apibody %} table.getIntersecting(geometry).optArg("index", index) → selection {% endapibody %}

Description

Get all documents where the given geometry object intersects the geometry object of the requested geospatial index.

The index optarg is mandatory. This command returns the same results as row -> row.g(index).intersects(geometry). The total number of results is limited to the array size limit which defaults to 100,000, but can be changed with the array_limit option to run.

Example: Which of the locations in a list of parks intersect circle1?

import com.rethinkdb.gen.ast.Circle;

Circle circle1 = r.circle(r.array(-117.220406, 32.719464), 10)
                  .optArg("unit", "mi");

r.table("parks").getIntersecting(circle1).optArg("index", "area").run(conn);