Apache Pinot Docs
Search…
latest
ST_Contains
This section contains reference documentation for the ST_Contains function.
Returns true if and only if no points of the second geometry/geography lie in the exterior of the first geometry/geography, and at least one point of the interior of the first geometry lies in the interior of the second geometry.

Signature

ST_Contains(geometry, geometry)

Usage Examples

These examples are based on the Streaming Quick Start.
1
select group_city,
2
ST_AsText(location) AS locationString,
3
ST_Contains(
4
ST_GeomFromText('POLYGON ((
5
-74.171737 40.607377,
6
-74.089339 40.753180,
7
-73.911498 40.769303,
8
-74.016555 40.604249,
9
-74.171737 40.607377))'),
10
toGeometry(location)
11
) AS inPolygon
12
from meetupRsvp
13
order by inPolygon DESC
14
limit 5
Copied!
group_city
locationString
inPolygon
New York
POINT (-73.99 40.75)
1
New York
POINT (-73.99 40.75)
1
Staten Island
POINT (-74.15 40.61)
1
New York
POINT (-73.99 40.75)
1
New York
POINT (-73.99 40.75)
1
1
select count(*)
2
from meetupRsvp
3
WHERE ST_Contains(
4
ST_GeomFromText('POLYGON ((
5
-74.171737 40.607377,
6
-74.089339 40.753180,
7
-73.911498 40.769303,
8
-74.016555 40.604249,
9
-74.171737 40.607377))'),
10
toGeometry(location)
11
) = 1
Copied!
count(*)
8
Last modified 5d ago
Copy link