Ticket #171 (closed defect: fixed)
Non-Square Rectangle Should Contain Rectangle
| Reported by: | vivahome2 | Owned by: | |
|---|---|---|---|
| Priority: | critical | Milestone: | 3.1.0 |
| Component: | Core | Version: | 3.0.0 |
| Severity: | Unassigned | Keywords: | |
| Cc: |
Description
With PostGIS, when I tried something like
ST_Contains(Non-Rectangle-Polygon, Rectangle-Polygon)
It returned false, where Non-Rectangle-Polygon indeed "contained" Rectangle-Polygon
The actual SQL is
SELECT
ST_Contains(
GeomFromText('POLYGON((0 0,0 11,11 10,10 0,0 0))', -1),
GeomFromText('POLYGON((5 5,5 6,6 6,6 5,5 5))', -1) );
The source code of PostGIS where ST_Contains is defined is (I think)
char GEOSrelateContains(Geometry *g1, Geometry*g2)
{
try {
bool result;
result = g1->contains(g2);
return result;
}
catch (GEOSException *ge)
{
NOTICE_MESSAGE(ge->toString().c_str());
delete ge;
return 2;
}
catch (...)
{
return 2;
}
}
Change History
Note: See
TracTickets for help on using
tickets.
