I have a query: (This query uses geographical implementation of ST_Covers function)
SELECT ST_Covers(ST_GeoGraphyFromText('MULTIPOLYGON(((179 -89,179 89,-179 89,-179 -89,179 -89)))'),ST_GeographyFromText('POINT(20 30)'));
When I run this query it should return true but it returns false. I don't know whats wrong with PostGIS (or with this query). When I change the geographical implementation with geometrical one, and rearrange the query to be like below:
SELECT ST_Covers(ST_ASTEXT(ST_GeoGraphyFromText('MULTIPOLYGON(((179 -89,179 89,-179 89,-179 -89,179 -89)))')),text('POINT(20 30)'));
This query works as it should, returning true:
I can use this query to be content but the problem is when database is large it takes too much time. Can someone tell me
how to make query 1 to work right (as intended, returning true)? or
how to make query 2 work fast with large tables?
(please do not suggest that i should remove ST_GeoGraphyFromText('MULTIPOLYGON(((179 -89,179 89,-179 89,-179 -89,179 -89)
because it only represents geographical data that will be replaced by data from the column of table )
Other values which fail with query 1, are (5 5) (10 10) (-10 -10) (and many more)