postgresql st_contains
时间: 2023-07-22 19:25:45 浏览: 115
postgresql-container:基于Red Hat Software Collections的PostgreSQL容器映像,旨在用于OpenShift和常规用法。 用户可以在基于Red Hat Enterprise Linux,Fedora和CentOS的映像之间进行选择
`ST_Contains` is a PostGIS function that checks if a geometry (such as a point, line or polygon) is completely inside another geometry. It returns true if the first geometry is completely inside the second geometry, otherwise it returns false.
Here's an example usage of `ST_Contains` in PostgreSQL:
```
SELECT *
FROM table1
WHERE ST_Contains(table1.geom, table2.geom);
```
This query selects all records from `table1` where the geometry in the `geom` column of `table1` is completely inside the geometry in the `geom` column of `table2`.
Note that `ST_Contains` only works with two-dimensional geometries. If you are working with three-dimensional geometries, you should use `ST_3DContains` instead.
阅读全文