root/Shapely/trunk/tests/Predicates.txt

Revision 1082 (checked in by seang, 9 months ago)

a == b (Python equality) is no longer the same thing as a.equals(b) (topological equality), new safer predicate shortcuts for objects that are identical in the Python sense (#163)

  • Property svn:eol-style set to native
Line 
1 Test GEOS predicates
2 ====================
3
4   >>> from shapely.geometry import Point
5   >>> point = Point(0.0, 0.0)
6
7 Binary Predicates
8 -----------------
9
10   >>> point.disjoint(Point(-1.0, -1.0))
11   True
12
13   >>> point.touches(Point(-1.0, -1.0))
14   False
15
16   >>> point.crosses(Point(-1.0, -1.0))
17   False
18
19   >>> point.within(Point(-1.0, -1.0))
20   False
21
22   >>> point.contains(Point(-1.0, -1.0))
23   False
24
25   >>> point.overlaps(Point(-1.0, -1.0))
26   False
27
28   >>> point.equals(Point(-1.0, -1.0))
29   False
30
31   >>> point.equals(Point(0.0, 0.0))
32   True
33
34 Unary Predicates
35 ----------------
36
37   >>> point.is_empty
38   False
39
40   >>> point.is_valid
41   True
42  
43   >>> point.is_simple
44   True
45
46   >>> point.is_ring
47   False
48
49   >>> point.has_z
50   False
51
Note: See TracBrowser for help on using the browser.