I'm doing a spatial query in PostGIS wanting to get all objects within a given polygon or with some feature inside that polygon. PostGIS only returns objects that are inside the polygon. Those objects that have part of their feature inside this polygon are not being returned by the query.
We are using
ST_CONTAINS but it only returns objects that are inside the polygon.
SELECT ID, TIPO, St_AsText(ST_Transform(C.COORDENADAS,5641)) COORD FROM POLYGONS_GEOMETRY C WHERE ST_Contains(ST_GEOMFROMTEXT('SRID=5641;POLYGON((a b c d))'), C.COORDENADAS)