Polygon.contains 和 Polygon.within 有什么区别?

What is the difference between Polygon.contains and Polygon.within?

文档字符串说:

Polygon.contains Returns 如果几何包含另一个则为真,否则为假

Polygon.within Returns 如果几何体在另一个内部则为真,否则为假

它们有什么不同?

它们是反向关系:A包含BBA内。

   >>> A.contains(B)
   True
   >>> B.within(A)
   True

   +----------------------------------+
   |                                  |
   |         +----------+             |
   |         |          |             |
   |         |          |             |
   |         |          |             |
   |         |          |             |
   |         |          |             |
   |         |    B     |             |
   |         |          |             |
   |         +----------+             |
   |                                  |
   |                                  |
   |   A                              |
   |                                  |
   +----------------------------------+