shapely 1.2.10__py2.7-win-amd64.egg → 1.2.13__py2.7-win-amd64.egg

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 (79) hide show
  1. EGG-INFO/PKG-INFO +48 -29
  2. EGG-INFO/native_libs.txt +1 -0
  3. shapely/__init__.py +2 -1
  4. shapely/__init__.pyc +0 -0
  5. shapely/ctypes_declarations.py +5 -0
  6. shapely/ctypes_declarations.pyc +0 -0
  7. shapely/examples/__init__.py +1 -0
  8. shapely/examples/__init__.pyc +0 -0
  9. shapely/examples/dissolve.py +53 -0
  10. shapely/examples/dissolve.pyc +0 -0
  11. shapely/examples/geoms.py +51 -0
  12. shapely/examples/geoms.pyc +0 -0
  13. shapely/examples/intersect.py +81 -0
  14. shapely/examples/intersect.pyc +0 -0
  15. shapely/examples/world.py +21 -0
  16. shapely/examples/world.pyc +0 -0
  17. shapely/geometry/base.py +4 -1
  18. shapely/geometry/base.pyc +0 -0
  19. shapely/geometry/linestring.py +8 -13
  20. shapely/geometry/linestring.pyc +0 -0
  21. shapely/geometry/multilinestring.py +0 -3
  22. shapely/geometry/multilinestring.pyc +0 -0
  23. shapely/geometry/multipoint.py +3 -2
  24. shapely/geometry/multipoint.pyc +0 -0
  25. shapely/geometry/polygon.py +19 -39
  26. shapely/geometry/polygon.pyc +0 -0
  27. shapely/geos.py +8 -7
  28. shapely/geos.pyc +0 -0
  29. shapely/predicates.py +2 -2
  30. shapely/predicates.pyc +0 -0
  31. shapely/prepared.py +4 -1
  32. shapely/prepared.pyc +0 -0
  33. shapely/speedups/__init__.py +42 -0
  34. shapely/speedups/__init__.pyc +0 -0
  35. shapely/speedups/_speedups.py +7 -0
  36. shapely/speedups/_speedups.pyc +0 -0
  37. shapely/speedups/_speedups.pyd +0 -0
  38. shapely/tests/__init__.py +28 -0
  39. shapely/tests/__init__.pyc +0 -0
  40. shapely/tests/test_box.py +19 -0
  41. shapely/tests/test_box.pyc +0 -0
  42. shapely/tests/test_cga.py +33 -0
  43. shapely/tests/test_cga.pyc +0 -0
  44. shapely/tests/test_collection.py +11 -0
  45. shapely/tests/test_collection.pyc +0 -0
  46. shapely/tests/test_delegated.py +26 -0
  47. shapely/tests/test_delegated.pyc +0 -0
  48. shapely/tests/test_dlls.py +16 -0
  49. shapely/tests/test_dlls.pyc +0 -0
  50. shapely/tests/test_doctests.py +35 -0
  51. shapely/tests/test_doctests.pyc +0 -0
  52. shapely/tests/test_emptiness.py +19 -0
  53. shapely/tests/test_emptiness.pyc +0 -0
  54. shapely/tests/test_equality.py +30 -0
  55. shapely/tests/test_equality.pyc +0 -0
  56. shapely/tests/test_geomseq.py +11 -0
  57. shapely/tests/test_geomseq.pyc +0 -0
  58. shapely/tests/test_linear_referencing.py +67 -0
  59. shapely/tests/test_linear_referencing.pyc +0 -0
  60. shapely/tests/test_mapping.py +11 -0
  61. shapely/tests/test_mapping.pyc +0 -0
  62. shapely/tests/test_prepared.py +28 -0
  63. shapely/tests/test_prepared.pyc +0 -0
  64. shapely/tests/test_products_z.py +14 -0
  65. shapely/tests/test_products_z.pyc +0 -0
  66. shapely/tests/test_singularity.py +15 -0
  67. shapely/tests/test_singularity.pyc +0 -0
  68. shapely/tests/test_speedups.py +38 -0
  69. shapely/tests/test_speedups.pyc +0 -0
  70. shapely/tests/test_validation.py +10 -0
  71. shapely/tests/test_validation.pyc +0 -0
  72. shapely/tests/test_xy.py +14 -0
  73. shapely/tests/test_xy.pyc +0 -0
  74. shapely/tests/threading_test.py +37 -0
  75. shapely/tests/threading_test.pyc +0 -0
  76. shapely/topology.py +6 -8
  77. shapely/topology.pyc +0 -0
  78. shapely/wkb.py +2 -2
  79. shapely/wkb.pyc +0 -0
shapely/topology.py CHANGED
@@ -10,14 +10,12 @@ These methods return ctypes objects that should be recast by the caller.
10
10
  from ctypes import byref, c_double
11
11
  from shapely.geos import TopologicalError, lgeos
12
12
 
13
-
14
13
  class Validating(object):
15
- def _validate(self, ob):
16
- try:
17
- assert ob is not None
18
- assert ob._geom is not None
19
- except AssertionError:
14
+ def _validate(self, ob, stop_prepared=False):
15
+ if ob is None or ob._geom is None:
20
16
  raise ValueError("Null geometry supports no operations")
17
+ if stop_prepared and not hasattr(ob, 'type'):
18
+ raise ValueError("Prepared geometries cannot be operated on")
21
19
 
22
20
  class Delegating(Validating):
23
21
  def __init__(self, name):
@@ -26,7 +24,7 @@ class Delegating(Validating):
26
24
  class BinaryRealProperty(Delegating):
27
25
  def __call__(self, this, other):
28
26
  self._validate(this)
29
- self._validate(other)
27
+ self._validate(other, stop_prepared=True)
30
28
  d = c_double()
31
29
  retval = self.fn(this._geom, other._geom, byref(d))
32
30
  return d.value
@@ -41,7 +39,7 @@ class UnaryRealProperty(Delegating):
41
39
  class BinaryTopologicalOp(Delegating):
42
40
  def __call__(self, this, other, *args):
43
41
  self._validate(this)
44
- self._validate(other)
42
+ self._validate(other, stop_prepared=True)
45
43
  product = self.fn(this._geom, other._geom, *args)
46
44
  if product is None:
47
45
  if not this.is_valid:
shapely/topology.pyc CHANGED
Binary file
shapely/wkb.py CHANGED
@@ -1,7 +1,7 @@
1
1
  """Load/dump geometries using the well-known binary (WKB) format
2
2
  """
3
3
 
4
- from ctypes import byref, c_size_t, c_char_p, c_void_p
4
+ from ctypes import pointer, c_size_t, c_char_p, c_void_p
5
5
 
6
6
  from shapely.geos import lgeos, ReadingError
7
7
 
@@ -30,7 +30,7 @@ def dumps(ob):
30
30
  if ob is None or ob._geom is None:
31
31
  raise ValueError("Null geometry supports no operations")
32
32
  size = c_size_t()
33
- return lgeos.GEOSGeomToWKB_buf(c_void_p(ob._geom), byref(size))
33
+ return lgeos.GEOSGeomToWKB_buf(c_void_p(ob._geom), pointer(size))
34
34
 
35
35
  def dump(ob, fp):
36
36
  """Dump a geometry to an open file."""
shapely/wkb.pyc CHANGED
Binary file