[postgis-devel] [PostGIS] #573: ST_Contains(geog, geog) gives wrong answer
PostGIS
trac at osgeo.org
Tue Aug 17 14:58:34 PDT 2010
#573: ST_Contains(geog, geog) gives wrong answer
---------------------+------------------------------------------------------
Reporter: pramsey | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 1.5.2
Component: postgis | Version: 1.5.X
Keywords: |
---------------------+------------------------------------------------------
{{{
create table gpoints (id integer, g geography);
insert into gpoints values
(1, 'POINT(-120.585938 55.195313)'),
(2, 'POINT(116.367188 57.656250)');
select
st_astext(g),
st_covers('POLYGON((-128.3203125 61.171875, -103.7109375 -54.140625,
72.0703125 0.3515625, 134.296875 15.8203125, 17.2265625 71.3671875,
-6.328125 75.5859375, -128.3203125 61.171875))'::geography,g)
from gpoints;
select
st_astext(g),
st_covers('POLYGON((-124.453125 64.6875, -127.6171875 -46.0546875,
51.6796875 -18.6328125, 46.0546875 -9.84375, 47.8125 17.2265625,
50.9765625 32.34375,-124.453125 64.6875))'::geography,g)
from gpoints;
}}}
This appears to be similar to #562, where the point-in-polygon routine was
failing because the generated "point outside" the polygon actually wasn't
outside. In the second example, and outside point simply cannot be
generated and everything stops.
I fear that as polygons get bigger, the question of what they "bound"
comes into sharp relief in a way that is less problematic for small
polygons. While most geodata is small enough to be obviously containing
the "smaller" part of the sphere, it's trivially easy to generate a large
polygon using a global mercator map in a GUI. Click, click, click, and you
have a query polygon that visually covers most of the globe.
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/573>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-devel
mailing list