Back to Playground Home

Indicates how many points fit inside the polygon

select ST_Contains(ST_GeomFromText(
         'POLYGON((-117.02636718749997 48.341646172374595,-111.9287109375 31.57853542647338,-77.29980468749999 29.152161283318932,-67.28027343749999 43.96119063892027,-90.04394531249999 55.677584411089526,-117.02636718749997 48.341646172374595))'),
         toGeometry(bytes_field)) AS inPolygon, 
       count(*) 
from users
group by inPolygon
ORDER BY inPolygon DESC