CONTAINS()

Documentation

VoltDB Home » Documentation » Using VoltDB

CONTAINS()

CONTAINS() — Returns true or false depending if a point falls within the specified polygon.

Synopsis

CONTAINS( polygon, point )

Description

The CONTAINS() function determines if a given point falls within the specified GEOGRAPHY polygon. If so, the function returns a boolean value of true. If not, it returns false.

Example

The following example uses the CONTAINS function to see if a specific user is with the boundaries of a city or not by evaluating if the user.location GEOGRAPHY_POINT column value falls within the polygon defined by the city.boundary GEOGRAPHY column.

SELECT user.name, user.id, city.name FROM user, city
    WHERE user.id = ? AND CONTAINS(city.boundary,user.location);