Reputation: 1763
I got one column (latlon
) which is a ST_MultiPolygon
.
The other geometry is a point which I just want to check if it is inside one of my MultiPolygons.
I tried:
SELECT ST_CONTAINS(latlon, ST_GeometryFromText('POINT(48.208417 16.372472)')
FROM districts
It always returns false; why can't I check if a point is within a multipolygon with ST_Contains
?
Upvotes: 18
Views: 22784
Reputation: 7942
The st_contains works with multi geometries. You must ensure that the point is on the same coordinate system of polygon geometry.
Also you must know that if the point falls into boundary of your multipolygon it will not be considered contained. In this case it will return false since no point inside of polygon geometry.
Upvotes: 3
Reputation: 1763
it worked like this:
SELECT name, st_contains(latlon, ST_GeomFromText('POINT(16.391944 48.218056)', 4326)) FROM bezirks
Upvotes: 23