The Docstring says:
Polygon.contains
Returns True if the geometry contains the other, else False
Polygon.within
Returns True if geometry is within the other, else False
How are they different?
They are inverse relationships: A
contains B
, and B
is within A
.
>>> A.contains(B)
True
>>> B.within(A)
True
+----------------------------------+
| |
| +----------+ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | B | |
| | | |
| +----------+ |
| |
| |
| A |
| |
+----------------------------------+