shapely 1.5.7__tar.gz → 1.5.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. {Shapely-1.5.7 → Shapely-1.5.8}/CHANGES.txt +8 -1
  2. {Shapely-1.5.7/Shapely.egg-info → Shapely-1.5.8}/PKG-INFO +9 -2
  3. {Shapely-1.5.7 → Shapely-1.5.8/Shapely.egg-info}/PKG-INFO +9 -2
  4. Shapely-1.5.8/VERSION.txt +1 -0
  5. {Shapely-1.5.7 → Shapely-1.5.8}/setup.py +1 -1
  6. Shapely-1.5.8/shapely/__init__.py +1 -0
  7. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/ctypes_declarations.py +24 -5
  8. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/geometry/base.py +4 -0
  9. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/geos.py +23 -3
  10. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/impl.py +6 -0
  11. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/prepared.py +32 -4
  12. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/speedups/_speedups.c +9 -9
  13. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_predicates.py +2 -0
  14. Shapely-1.5.8/tests/test_prepared.py +51 -0
  15. Shapely-1.5.7/VERSION.txt +0 -1
  16. Shapely-1.5.7/shapely/__init__.py +0 -1
  17. Shapely-1.5.7/tests/test_prepared.py +0 -31
  18. {Shapely-1.5.7 → Shapely-1.5.8}/CREDITS.txt +0 -0
  19. {Shapely-1.5.7 → Shapely-1.5.8}/LICENSE.txt +0 -0
  20. {Shapely-1.5.7 → Shapely-1.5.8}/README.rst +0 -0
  21. {Shapely-1.5.7 → Shapely-1.5.8}/Shapely.egg-info/SOURCES.txt +0 -0
  22. {Shapely-1.5.7 → Shapely-1.5.8}/Shapely.egg-info/dependency_links.txt +0 -0
  23. {Shapely-1.5.7 → Shapely-1.5.8}/Shapely.egg-info/top_level.txt +0 -0
  24. {Shapely-1.5.7 → Shapely-1.5.8}/docs/design.rst +0 -0
  25. {Shapely-1.5.7 → Shapely-1.5.8}/docs/index.rst +0 -0
  26. {Shapely-1.5.7 → Shapely-1.5.8}/docs/manual.rst +0 -0
  27. {Shapely-1.5.7 → Shapely-1.5.8}/docs/project.rst +0 -0
  28. {Shapely-1.5.7 → Shapely-1.5.8}/setup.cfg +0 -0
  29. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/_geos.pxi +0 -0
  30. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/affinity.py +0 -0
  31. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/algorithms/__init__.py +0 -0
  32. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/algorithms/cga.py +0 -0
  33. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/coords.py +0 -0
  34. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/examples/__init__.py +0 -0
  35. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/examples/dissolve.py +0 -0
  36. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/examples/geoms.py +0 -0
  37. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/examples/intersect.py +0 -0
  38. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/ftools.py +0 -0
  39. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/geometry/__init__.py +0 -0
  40. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/geometry/collection.py +0 -0
  41. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/geometry/geo.py +0 -0
  42. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/geometry/linestring.py +0 -0
  43. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/geometry/multilinestring.py +0 -0
  44. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/geometry/multipoint.py +0 -0
  45. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/geometry/multipolygon.py +0 -0
  46. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/geometry/point.py +0 -0
  47. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/geometry/polygon.py +0 -0
  48. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/geometry/proxy.py +0 -0
  49. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/iterops.py +0 -0
  50. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/linref.py +0 -0
  51. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/ops.py +0 -0
  52. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/predicates.py +0 -0
  53. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/speedups/__init__.py +0 -0
  54. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/speedups/_speedups.pyx +0 -0
  55. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/strtree.py +0 -0
  56. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/topology.py +0 -0
  57. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/validation.py +0 -0
  58. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/vectorized/__init__.py +0 -0
  59. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/vectorized/_vectorized.pyx +0 -0
  60. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/wkb.py +0 -0
  61. {Shapely-1.5.7 → Shapely-1.5.8}/shapely/wkt.py +0 -0
  62. {Shapely-1.5.7 → Shapely-1.5.8}/tests/__init__.py +0 -0
  63. {Shapely-1.5.7 → Shapely-1.5.8}/tests/binascii_hex.txt +0 -0
  64. {Shapely-1.5.7 → Shapely-1.5.8}/tests/conftest.py +0 -0
  65. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_affinity.py +0 -0
  66. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_box.py +0 -0
  67. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_cga.py +0 -0
  68. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_collection.py +0 -0
  69. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_coords.py +0 -0
  70. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_delaunay.py +0 -0
  71. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_delegated.py +0 -0
  72. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_dlls.py +0 -0
  73. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_doctests.py +0 -0
  74. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_emptiness.py +0 -0
  75. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_equality.py +0 -0
  76. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_geointerface.py +0 -0
  77. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_geomseq.py +0 -0
  78. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_geos_err_handler.py +0 -0
  79. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_getitem.py +0 -0
  80. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_hash.py +0 -0
  81. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_invalid_geometries.py +0 -0
  82. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_iterops.py +0 -0
  83. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_linear_referencing.py +0 -0
  84. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_linemerge.py +0 -0
  85. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_linestring.py +0 -0
  86. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_locale.py +0 -0
  87. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_mapping.py +0 -0
  88. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_multilinestring.py +0 -0
  89. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_multipoint.py +0 -0
  90. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_multipolygon.py +0 -0
  91. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_ndarrays.py +0 -0
  92. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_nearest.py +0 -0
  93. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_operations.py +0 -0
  94. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_operators.py +0 -0
  95. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_persist.py +0 -0
  96. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_pickle.py +0 -0
  97. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_point.py +0 -0
  98. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_polygon.py +0 -0
  99. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_polygonize.py +0 -0
  100. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_products_z.py +0 -0
  101. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_singularity.py +0 -0
  102. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_snap.py +0 -0
  103. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_strtree.py +0 -0
  104. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_styles.py +0 -0
  105. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_svg.py +0 -0
  106. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_transform.py +0 -0
  107. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_union.py +0 -0
  108. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_validation.py +0 -0
  109. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_vectorized.py +0 -0
  110. {Shapely-1.5.7 → Shapely-1.5.8}/tests/test_xy.py +0 -0
  111. {Shapely-1.5.7 → Shapely-1.5.8}/tests/threading_test.py +0 -0
@@ -1,7 +1,14 @@
1
1
  Changes
2
2
  =======
3
3
 
4
- 1.5.6 (2015-03-16)
4
+ 1.5.8 (2015-04-29)
5
+ ------------------
6
+ - Setup file encoding bug fix (#254).
7
+ - Support for pyinstaller (#261).
8
+ - Major prepared geometry operation fix for Windows (#268, #269).
9
+ - Major fix for OS X binary wheel (#262).
10
+
11
+ 1.5.7 (2015-03-16)
5
12
  ------------------
6
13
  - Test and fix buggy error and notice handlers (#249).
7
14
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: Shapely
3
- Version: 1.5.7
3
+ Version: 1.5.8
4
4
  Summary: Geometric objects, predicates, and operations
5
5
  Home-page: https://github.com/Toblerity/Shapely
6
6
  Author: Sean Gillies
@@ -215,7 +215,14 @@ Description: =======
215
215
  Changes
216
216
  =======
217
217
 
218
- 1.5.6 (2015-03-16)
218
+ 1.5.8 (2015-04-29)
219
+ ------------------
220
+ - Setup file encoding bug fix (#254).
221
+ - Support for pyinstaller (#261).
222
+ - Major prepared geometry operation fix for Windows (#268, #269).
223
+ - Major fix for OS X binary wheel (#262).
224
+
225
+ 1.5.7 (2015-03-16)
219
226
  ------------------
220
227
  - Test and fix buggy error and notice handlers (#249).
221
228
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: Shapely
3
- Version: 1.5.7
3
+ Version: 1.5.8
4
4
  Summary: Geometric objects, predicates, and operations
5
5
  Home-page: https://github.com/Toblerity/Shapely
6
6
  Author: Sean Gillies
@@ -215,7 +215,14 @@ Description: =======
215
215
  Changes
216
216
  =======
217
217
 
218
- 1.5.6 (2015-03-16)
218
+ 1.5.8 (2015-04-29)
219
+ ------------------
220
+ - Setup file encoding bug fix (#254).
221
+ - Support for pyinstaller (#261).
222
+ - Major prepared geometry operation fix for Windows (#268, #269).
223
+ - Major fix for OS X binary wheel (#262).
224
+
225
+ 1.5.7 (2015-03-16)
219
226
  ------------------
220
227
  - Test and fix buggy error and notice handlers (#249).
221
228
 
@@ -0,0 +1 @@
1
+ 1.5.8
@@ -36,7 +36,7 @@ if version is None:
36
36
 
37
37
  # Handle UTF-8 encoding of certain text files.
38
38
  open_kwds = {}
39
- if sys.version_info > (3,):
39
+ if sys.version_info >= (3,):
40
40
  open_kwds['encoding'] = 'utf-8'
41
41
 
42
42
  with open('VERSION.txt', 'w', **open_kwds) as fp:
@@ -0,0 +1 @@
1
+ __version__ = "1.5.8"
@@ -249,6 +249,9 @@ def prototype(lgeos, geos_version):
249
249
  lgeos.GEOSOverlaps.restype = c_byte
250
250
  lgeos.GEOSOverlaps.argtypes = [c_void_p, c_void_p]
251
251
 
252
+ lgeos.GEOSCovers.restype = c_byte
253
+ lgeos.GEOSCovers.argtypes = [c_void_p, c_void_p]
254
+
252
255
  lgeos.GEOSEquals.restype = c_byte
253
256
  lgeos.GEOSEquals.argtypes = [c_void_p, c_void_p]
254
257
 
@@ -306,17 +309,33 @@ def prototype(lgeos, geos_version):
306
309
  lgeos.GEOSPreparedGeom_destroy.restype = None
307
310
  lgeos.GEOSPreparedGeom_destroy.argtypes = [c_void_p]
308
311
 
309
- lgeos.GEOSPreparedContains.restype = c_int
312
+ lgeos.GEOSPreparedDisjoint.restype = c_byte
313
+ lgeos.GEOSPreparedDisjoint.argtypes = [c_void_p, c_void_p]
314
+
315
+ lgeos.GEOSPreparedTouches.restype = c_byte
316
+ lgeos.GEOSPreparedTouches.argtypes = [c_void_p, c_void_p]
317
+
318
+ lgeos.GEOSPreparedIntersects.restype = c_byte
319
+ lgeos.GEOSPreparedIntersects.argtypes = [c_void_p, c_void_p]
320
+
321
+ lgeos.GEOSPreparedCrosses.restype = c_byte
322
+ lgeos.GEOSPreparedCrosses.argtypes = [c_void_p, c_void_p]
323
+
324
+ lgeos.GEOSPreparedWithin.restype = c_byte
325
+ lgeos.GEOSPreparedWithin.argtypes = [c_void_p, c_void_p]
326
+
327
+ lgeos.GEOSPreparedContains.restype = c_byte
310
328
  lgeos.GEOSPreparedContains.argtypes = [c_void_p, c_void_p]
311
329
 
312
- lgeos.GEOSPreparedContainsProperly.restype = c_int
330
+ lgeos.GEOSPreparedContainsProperly.restype = c_byte
313
331
  lgeos.GEOSPreparedContainsProperly.argtypes = [c_void_p, c_void_p]
314
332
 
315
- lgeos.GEOSPreparedCovers.restype = c_int
333
+ lgeos.GEOSPreparedOverlaps.restype = c_byte
334
+ lgeos.GEOSPreparedOverlaps.argtypes = [c_void_p, c_void_p]
335
+
336
+ lgeos.GEOSPreparedCovers.restype = c_byte
316
337
  lgeos.GEOSPreparedCovers.argtypes = [c_void_p, c_void_p]
317
338
 
318
- lgeos.GEOSPreparedIntersects.restype = c_int
319
- lgeos.GEOSPreparedIntersects.argtypes = [c_void_p, c_void_p]
320
339
 
321
340
  '''
322
341
  Geometry info
@@ -616,6 +616,10 @@ class BaseGeometry(object):
616
616
  (string)"""
617
617
  return self.impl['relate'](self, other)
618
618
 
619
+ def covers(self, other):
620
+ """Returns True if the geometry covers the other, else False"""
621
+ return bool(self.impl['covers'](self, other))
622
+
619
623
  def contains(self, other):
620
624
  """Returns True if the geometry contains the other, else False"""
621
625
  return bool(self.impl['contains'](self, other))
@@ -68,9 +68,13 @@ elif sys.platform == 'darwin':
68
68
  _lgeos = CDLL(geos_whl_dylib)
69
69
  else:
70
70
  if hasattr(sys, 'frozen'):
71
- # .app file from py2app
72
- alt_paths = [os.path.join(os.environ['RESOURCEPATH'],
73
- '..', 'Frameworks', 'libgeos_c.dylib')]
71
+ try:
72
+ # .app file from py2app
73
+ alt_paths = [os.path.join(os.environ['RESOURCEPATH'],
74
+ '..', 'Frameworks', 'libgeos_c.dylib')]
75
+ except KeyError:
76
+ # binary from pyinstaller
77
+ alt_paths = [os.path.join(sys.executable, 'libgeos_c.dylib')]
74
78
  else:
75
79
  alt_paths = [
76
80
  # The Framework build from Kyng Chaos
@@ -642,8 +646,18 @@ class LGEOS310(LGEOSBase):
642
646
  self.GEOSWithin,
643
647
  self.GEOSContains,
644
648
  self.GEOSOverlaps,
649
+ self.GEOSCovers,
645
650
  self.GEOSEquals,
646
651
  self.GEOSEqualsExact,
652
+ self.GEOSPreparedDisjoint,
653
+ self.GEOSPreparedTouches,
654
+ self.GEOSPreparedCrosses,
655
+ self.GEOSPreparedWithin,
656
+ self.GEOSPreparedOverlaps,
657
+ self.GEOSPreparedContains,
658
+ self.GEOSPreparedContainsProperly,
659
+ self.GEOSPreparedCovers,
660
+ self.GEOSPreparedIntersects,
647
661
  self.GEOSisEmpty,
648
662
  self.GEOSisValid,
649
663
  self.GEOSisSimple,
@@ -674,6 +688,7 @@ class LGEOS310(LGEOSBase):
674
688
  self.methods['within'] = self.GEOSWithin
675
689
  self.methods['contains'] = self.GEOSContains
676
690
  self.methods['overlaps'] = self.GEOSOverlaps
691
+ self.methods['covers'] = self.GEOSCovers
677
692
  self.methods['equals'] = self.GEOSEquals
678
693
  self.methods['equals_exact'] = self.GEOSEqualsExact
679
694
  self.methods['relate'] = self.GEOSRelate
@@ -681,10 +696,15 @@ class LGEOS310(LGEOSBase):
681
696
  self.methods['symmetric_difference'] = self.GEOSSymDifference
682
697
  self.methods['union'] = self.GEOSUnion
683
698
  self.methods['intersection'] = self.GEOSIntersection
699
+ self.methods['prepared_disjoint'] = self.GEOSPreparedDisjoint
700
+ self.methods['prepared_touches'] = self.GEOSPreparedTouches
684
701
  self.methods['prepared_intersects'] = self.GEOSPreparedIntersects
702
+ self.methods['prepared_crosses'] = self.GEOSPreparedCrosses
703
+ self.methods['prepared_within'] = self.GEOSPreparedWithin
685
704
  self.methods['prepared_contains'] = self.GEOSPreparedContains
686
705
  self.methods['prepared_contains_properly'] = \
687
706
  self.GEOSPreparedContainsProperly
707
+ self.methods['prepared_overlaps'] = self.GEOSPreparedOverlaps
688
708
  self.methods['prepared_covers'] = self.GEOSPreparedCovers
689
709
  self.methods['simplify'] = self.GEOSSimplify
690
710
  self.methods['topology_preserve_simplify'] = \
@@ -83,6 +83,7 @@ IMPL300 = {
83
83
  'overlaps': (BinaryPredicate, 'overlaps'),
84
84
  'touches': (BinaryPredicate, 'touches'),
85
85
  'within': (BinaryPredicate, 'within'),
86
+ 'covers': (BinaryPredicate, 'covers'),
86
87
  'equals_exact': (BinaryPredicate, 'equals_exact'),
87
88
 
88
89
  # First pure Python implementation
@@ -93,6 +94,11 @@ IMPL310 = {
93
94
  'simplify': (UnaryTopologicalOp, 'simplify'),
94
95
  'topology_preserve_simplify':
95
96
  (UnaryTopologicalOp, 'topology_preserve_simplify'),
97
+ 'prepared_disjoint': (BinaryPredicate, 'prepared_disjoint'),
98
+ 'prepared_touches': (BinaryPredicate, 'prepared_touches'),
99
+ 'prepared_crosses': (BinaryPredicate, 'prepared_crosses'),
100
+ 'prepared_within': (BinaryPredicate, 'prepared_within'),
101
+ 'prepared_overlaps': (BinaryPredicate, 'prepared_overlaps'),
96
102
  'prepared_intersects': (BinaryPredicate, 'prepared_intersects'),
97
103
  'prepared_contains': (BinaryPredicate, 'prepared_contains'),
98
104
  'prepared_contains_properly':
@@ -37,23 +37,51 @@ class PreparedGeometry(object):
37
37
  @property
38
38
  def _geom(self):
39
39
  return self.__geom__
40
-
41
- @delegated
42
- def intersects(self, other):
43
- return bool(self.impl['prepared_intersects'](self, other))
44
40
 
45
41
  @delegated
46
42
  def contains(self, other):
43
+ """Returns True if the geometry contains the other, else False"""
47
44
  return bool(self.impl['prepared_contains'](self, other))
48
45
 
49
46
  @delegated
50
47
  def contains_properly(self, other):
48
+ """Returns True if the geometry properly contains the other, else False"""
51
49
  return bool(self.impl['prepared_contains_properly'](self, other))
52
50
 
53
51
  @delegated
54
52
  def covers(self, other):
53
+ """Returns True if the geometry covers the other, else False"""
55
54
  return bool(self.impl['prepared_covers'](self, other))
56
55
 
56
+ @delegated
57
+ def crosses(self, other):
58
+ """Returns True if the geometries cross, else False"""
59
+ return bool(self.impl['prepared_crosses'](self, other))
60
+
61
+ @delegated
62
+ def disjoint(self, other):
63
+ """Returns True if geometries are disjoint, else False"""
64
+ return bool(self.impl['prepared_disjoint'](self, other))
65
+
66
+ @delegated
67
+ def intersects(self, other):
68
+ """Returns True if geometries intersect, else False"""
69
+ return bool(self.impl['prepared_intersects'](self, other))
70
+
71
+ @delegated
72
+ def overlaps(self, other):
73
+ """Returns True if geometries overlap, else False"""
74
+ return bool(self.impl['prepared_overlaps'](self, other))
75
+
76
+ @delegated
77
+ def touches(self, other):
78
+ """Returns True if geometries touch, else False"""
79
+ return bool(self.impl['prepared_touches'](self, other))
80
+
81
+ @delegated
82
+ def within(self, other):
83
+ """Returns True if geometry is within the other, else False"""
84
+ return bool(self.impl['prepared_within'](self, other))
57
85
 
58
86
  def prep(ob):
59
87
  """Creates and returns a prepared geometric object."""
@@ -883,7 +883,7 @@ static char __pyx_k_geos_linestring_from_py[] = "geos_linestring_from_py";
883
883
  static char __pyx_k_shapely_speedups__speedups[] = "shapely.speedups._speedups";
884
884
  static char __pyx_k_geos_linestring_from_py_locals[] = "geos_linestring_from_py.<locals>._coords";
885
885
  static char __pyx_k_A_LinearRing_must_have_at_least[] = "A LinearRing must have at least 3 coordinate tuples";
886
- static char __pyx_k_Users_seang_code_frs_wheel_buil[] = "/Users/seang/code/frs-wheel-builds/src/Shapely/shapely/speedups/_speedups.pyx";
886
+ static char __pyx_k_Users_sean_code_frs_wheel_build[] = "/Users/sean/code/frs-wheel-builds/src/Shapely/shapely/speedups/_speedups.pyx";
887
887
  static char __pyx_k_matrix_expects_either_6_or_12_c[] = "'matrix' expects either 6 or 12 coefficients";
888
888
  static char __pyx_k_Inconsistent_coordinate_dimensio[] = "Inconsistent coordinate dimensionality";
889
889
  static char __pyx_k_Input_s_is_the_wrong_shape_for_a[] = "Input %s is the wrong shape for a LineString";
@@ -905,7 +905,7 @@ static PyObject *__pyx_n_s_Point;
905
905
  static PyObject *__pyx_n_s_Polygon;
906
906
  static PyObject *__pyx_n_s_TypeError;
907
907
  static PyObject *__pyx_kp_s_Type_r_not_recognized;
908
- static PyObject *__pyx_kp_s_Users_seang_code_frs_wheel_buil;
908
+ static PyObject *__pyx_kp_s_Users_sean_code_frs_wheel_build;
909
909
  static PyObject *__pyx_n_s_ValueError;
910
910
  static PyObject *__pyx_kp_s_Wrong_coordinate_dimensions_this;
911
911
  static PyObject *__pyx_n_s_addressof;
@@ -6847,7 +6847,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
6847
6847
  {&__pyx_n_s_Polygon, __pyx_k_Polygon, sizeof(__pyx_k_Polygon), 0, 0, 1, 1},
6848
6848
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
6849
6849
  {&__pyx_kp_s_Type_r_not_recognized, __pyx_k_Type_r_not_recognized, sizeof(__pyx_k_Type_r_not_recognized), 0, 0, 1, 0},
6850
- {&__pyx_kp_s_Users_seang_code_frs_wheel_buil, __pyx_k_Users_seang_code_frs_wheel_buil, sizeof(__pyx_k_Users_seang_code_frs_wheel_buil), 0, 0, 1, 0},
6850
+ {&__pyx_kp_s_Users_sean_code_frs_wheel_build, __pyx_k_Users_sean_code_frs_wheel_build, sizeof(__pyx_k_Users_sean_code_frs_wheel_build), 0, 0, 1, 0},
6851
6851
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
6852
6852
  {&__pyx_kp_s_Wrong_coordinate_dimensions_this, __pyx_k_Wrong_coordinate_dimensions_this, sizeof(__pyx_k_Wrong_coordinate_dimensions_this), 0, 0, 1, 0},
6853
6853
  {&__pyx_n_s_addressof, __pyx_k_addressof, sizeof(__pyx_k_addressof), 0, 0, 1, 1},
@@ -6987,7 +6987,7 @@ static int __Pyx_InitCachedConstants(void) {
6987
6987
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_o); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6988
6988
  __Pyx_GOTREF(__pyx_tuple__4);
6989
6989
  __Pyx_GIVEREF(__pyx_tuple__4);
6990
- __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_seang_code_frs_wheel_buil, __pyx_n_s_coords_2, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6990
+ __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_sean_code_frs_wheel_build, __pyx_n_s_coords_2, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6991
6991
 
6992
6992
  /* "shapely/speedups/_speedups.pyx":160
6993
6993
  * if n == 3:
@@ -7065,7 +7065,7 @@ static int __Pyx_InitCachedConstants(void) {
7065
7065
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_geom_2); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7066
7066
  __Pyx_GOTREF(__pyx_tuple__12);
7067
7067
  __Pyx_GIVEREF(__pyx_tuple__12);
7068
- __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_seang_code_frs_wheel_buil, __pyx_n_s_destroy, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7068
+ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_sean_code_frs_wheel_build, __pyx_n_s_destroy, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7069
7069
 
7070
7070
  /* "shapely/speedups/_speedups.pyx":34
7071
7071
  *
@@ -7077,7 +7077,7 @@ static int __Pyx_InitCachedConstants(void) {
7077
7077
  __pyx_tuple__14 = PyTuple_Pack(19, __pyx_n_s_ob, __pyx_n_s_update_geom, __pyx_n_s_update_ndim, __pyx_n_s_cp, __pyx_n_s_handle, __pyx_n_s_cs, __pyx_n_s_g, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_dz, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_sm, __pyx_n_s_sn, __pyx_n_s_array, __pyx_n_s_coords_2, __pyx_n_s_coords_2, __pyx_n_s_coords); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7078
7078
  __Pyx_GOTREF(__pyx_tuple__14);
7079
7079
  __Pyx_GIVEREF(__pyx_tuple__14);
7080
- __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_seang_code_frs_wheel_buil, __pyx_n_s_geos_linestring_from_py, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7080
+ __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_sean_code_frs_wheel_build, __pyx_n_s_geos_linestring_from_py, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7081
7081
 
7082
7082
  /* "shapely/speedups/_speedups.pyx":176
7083
7083
  *
@@ -7089,7 +7089,7 @@ static int __Pyx_InitCachedConstants(void) {
7089
7089
  __pyx_tuple__16 = PyTuple_Pack(18, __pyx_n_s_ob, __pyx_n_s_update_geom, __pyx_n_s_update_ndim, __pyx_n_s_cp, __pyx_n_s_handle, __pyx_n_s_g, __pyx_n_s_cs, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_dz, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_M, __pyx_n_s_sm, __pyx_n_s_sn, __pyx_n_s_array, __pyx_n_s_coords); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7090
7090
  __Pyx_GOTREF(__pyx_tuple__16);
7091
7091
  __Pyx_GIVEREF(__pyx_tuple__16);
7092
- __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(3, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_seang_code_frs_wheel_buil, __pyx_n_s_geos_linearring_from_py, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7092
+ __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(3, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_sean_code_frs_wheel_build, __pyx_n_s_geos_linearring_from_py, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7093
7093
 
7094
7094
  /* "shapely/speedups/_speedups.pyx":348
7095
7095
  *
@@ -7101,7 +7101,7 @@ static int __Pyx_InitCachedConstants(void) {
7101
7101
  __pyx_tuple__18 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_temp, __pyx_n_s_handle, __pyx_n_s_cs, __pyx_n_s_data_p, __pyx_n_s_array_type, __pyx_n_s_data); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7102
7102
  __Pyx_GOTREF(__pyx_tuple__18);
7103
7103
  __Pyx_GIVEREF(__pyx_tuple__18);
7104
- __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_seang_code_frs_wheel_buil, __pyx_n_s_coordseq_ctypes, 348, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7104
+ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_sean_code_frs_wheel_build, __pyx_n_s_coordseq_ctypes, 348, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7105
7105
 
7106
7106
  /* "shapely/speedups/_speedups.pyx":373
7107
7107
  * return data
@@ -7113,7 +7113,7 @@ static int __Pyx_InitCachedConstants(void) {
7113
7113
  __pyx_tuple__20 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_i, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_dz, __pyx_n_s_has_z, __pyx_n_s_handle, __pyx_n_s_cs); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7114
7114
  __Pyx_GOTREF(__pyx_tuple__20);
7115
7115
  __Pyx_GIVEREF(__pyx_tuple__20);
7116
- __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_seang_code_frs_wheel_buil, __pyx_n_s_coordseq_iter, 373, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7116
+ __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_sean_code_frs_wheel_build, __pyx_n_s_coordseq_iter, 373, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7117
7117
  __Pyx_RefNannyFinishContext();
7118
7118
  return 0;
7119
7119
  __pyx_L1_error:;
@@ -19,6 +19,8 @@ class PredicatesTestCase(unittest.TestCase):
19
19
  self.assertFalse(point.equals(Point(-1.0, -1.0)))
20
20
  self.assertFalse(point.touches(Point(-1.0, -1.0)))
21
21
  self.assertTrue(point.equals(Point(0.0, 0.0)))
22
+ self.assertTrue(point.covers(Point(0.0, 0.0)))
23
+ self.assertFalse(point.covers(Point(-1.0, -1.0)))
22
24
 
23
25
  def test_unary_predicates(self):
24
26
 
@@ -0,0 +1,51 @@
1
+ from . import unittest
2
+ from shapely.geos import geos_version
3
+ from shapely import prepared
4
+ from shapely import geometry
5
+
6
+
7
+ class PreparedGeometryTestCase(unittest.TestCase):
8
+
9
+ @unittest.skipIf(geos_version < (3, 1, 0), 'GEOS 3.1.0 required')
10
+ def test_prepared(self):
11
+ polygon = geometry.Polygon([
12
+ (0, 0), (1, 0), (1, 1), (0, 1)
13
+ ])
14
+ p = prepared.PreparedGeometry(polygon)
15
+ self.assertTrue(p.contains(geometry.Point(0.5, 0.5)))
16
+ self.assertFalse(p.contains(geometry.Point(0.5, 1.5)))
17
+
18
+ @unittest.skipIf(geos_version < (3, 1, 0), 'GEOS 3.1.0 required')
19
+ def test_op_not_allowed(self):
20
+ p = prepared.PreparedGeometry(geometry.Point(0.0, 0.0).buffer(1.0))
21
+ self.assertRaises(ValueError, geometry.Point(0.0, 0.0).union, p)
22
+
23
+ @unittest.skipIf(geos_version < (3, 1, 0), 'GEOS 3.1.0 required')
24
+ def test_predicate_not_allowed(self):
25
+ p = prepared.PreparedGeometry(geometry.Point(0.0, 0.0).buffer(1.0))
26
+ self.assertRaises(ValueError, geometry.Point(0.0, 0.0).contains, p)
27
+
28
+ @unittest.skipIf(geos_version < (3, 1, 0), 'GEOS 3.1.0 required')
29
+ def test_prepared_predicates(self):
30
+ # check prepared predicates give the same result as regular predicates
31
+ polygon1 = geometry.Polygon([
32
+ (0, 0), (0, 1), (1, 1), (1, 0), (0, 0)
33
+ ])
34
+ polygon2 = geometry.Polygon([
35
+ (0.5, 0.5), (1.5, 0.5), (1.0, 1.0), (0.5, 0.5)
36
+ ])
37
+ point2 = geometry.Point(0.5, 0.5)
38
+ polygon_empty = geometry.Polygon()
39
+ prepared_polygon1 = prepared.PreparedGeometry(polygon1)
40
+ for geom2 in (polygon2, point2, polygon_empty):
41
+ self.assertTrue(polygon1.disjoint(geom2) == prepared_polygon1.disjoint(geom2))
42
+ self.assertTrue(polygon1.touches(geom2) == prepared_polygon1.touches(geom2))
43
+ self.assertTrue(polygon1.intersects(geom2) == prepared_polygon1.intersects(geom2))
44
+ self.assertTrue(polygon1.crosses(geom2) == prepared_polygon1.crosses(geom2))
45
+ self.assertTrue(polygon1.within(geom2) == prepared_polygon1.within(geom2))
46
+ self.assertTrue(polygon1.contains(geom2) == prepared_polygon1.contains(geom2))
47
+ self.assertTrue(polygon1.overlaps(geom2) == prepared_polygon1.overlaps(geom2))
48
+
49
+ def test_suite():
50
+ loader = unittest.TestLoader()
51
+ return loader.loadTestsFromTestCase(PreparedGeometryTestCase)
Shapely-1.5.7/VERSION.txt DELETED
@@ -1 +0,0 @@
1
- 1.5.7
@@ -1 +0,0 @@
1
- __version__ = "1.5.7"
@@ -1,31 +0,0 @@
1
- from . import unittest
2
- from shapely.geos import geos_version
3
- from shapely import prepared
4
- from shapely import geometry
5
-
6
-
7
- class PreparedGeometryTestCase(unittest.TestCase):
8
-
9
- @unittest.skipIf(geos_version < (3, 1, 0), 'GEOS 3.1.0 required')
10
- def test_prepared(self):
11
- polygon = geometry.Polygon([
12
- (0, 0), (1, 0), (1, 1), (0, 1)
13
- ])
14
- p = prepared.PreparedGeometry(polygon)
15
- self.assertTrue(p.contains(geometry.Point(0.5, 0.5)))
16
- self.assertFalse(p.contains(geometry.Point(0.5, 1.5)))
17
-
18
- @unittest.skipIf(geos_version < (3, 1, 0), 'GEOS 3.1.0 required')
19
- def test_op_not_allowed(self):
20
- p = prepared.PreparedGeometry(geometry.Point(0.0, 0.0).buffer(1.0))
21
- self.assertRaises(ValueError, geometry.Point(0.0, 0.0).union, p)
22
-
23
- @unittest.skipIf(geos_version < (3, 1, 0), 'GEOS 3.1.0 required')
24
- def test_predicate_not_allowed(self):
25
- p = prepared.PreparedGeometry(geometry.Point(0.0, 0.0).buffer(1.0))
26
- self.assertRaises(ValueError, geometry.Point(0.0, 0.0).contains, p)
27
-
28
-
29
- def test_suite():
30
- loader = unittest.TestLoader()
31
- return loader.loadTestsFromTestCase(PreparedGeometryTestCase)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes