shapely 1.2.13__py2.7-win-amd64.egg → 1.2.18__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 (125) hide show
  1. EGG-INFO/PKG-INFO +452 -377
  2. EGG-INFO/SOURCES.txt +96 -0
  3. EGG-INFO/dependency_links.txt +1 -0
  4. EGG-INFO/native_libs.txt +2 -0
  5. EGG-INFO/not-zip-safe +1 -1
  6. EGG-INFO/top_level.txt +1 -0
  7. shapely/DLLs/geos.dll +0 -0
  8. shapely/DLLs/geos_c.dll +0 -0
  9. shapely/__init__.py +1 -2
  10. shapely/__init__.pyc +0 -0
  11. shapely/affinity.py +252 -0
  12. shapely/affinity.pyc +0 -0
  13. shapely/algorithms/__init__.pyc +0 -0
  14. shapely/algorithms/cga.pyc +0 -0
  15. shapely/coords.py +53 -21
  16. shapely/coords.pyc +0 -0
  17. shapely/ctypes_declarations.py +16 -3
  18. shapely/ctypes_declarations.pyc +0 -0
  19. shapely/examples/__init__.pyc +0 -0
  20. shapely/examples/dissolve.pyc +0 -0
  21. shapely/examples/geoms.pyc +0 -0
  22. shapely/examples/intersect.pyc +0 -0
  23. shapely/examples/world.pyc +0 -0
  24. shapely/ftools.pyc +0 -0
  25. shapely/geometry/__init__.py +4 -4
  26. shapely/geometry/__init__.pyc +0 -0
  27. shapely/geometry/base.py +155 -54
  28. shapely/geometry/base.pyc +0 -0
  29. shapely/geometry/collection.pyc +0 -0
  30. shapely/geometry/geo.py +2 -2
  31. shapely/geometry/geo.pyc +0 -0
  32. shapely/geometry/linestring.py +24 -19
  33. shapely/geometry/linestring.pyc +0 -0
  34. shapely/geometry/multilinestring.py +2 -2
  35. shapely/geometry/multilinestring.pyc +0 -0
  36. shapely/geometry/multipoint.py +4 -0
  37. shapely/geometry/multipoint.pyc +0 -0
  38. shapely/geometry/multipolygon.py +8 -5
  39. shapely/geometry/multipolygon.pyc +0 -0
  40. shapely/geometry/point.py +7 -0
  41. shapely/geometry/point.pyc +0 -0
  42. shapely/geometry/polygon.py +28 -9
  43. shapely/geometry/polygon.pyc +0 -0
  44. shapely/geometry/proxy.py +1 -3
  45. shapely/geometry/proxy.pyc +0 -0
  46. shapely/geos.py +45 -14
  47. shapely/geos.pyc +0 -0
  48. shapely/impl.py +8 -5
  49. shapely/impl.pyc +0 -0
  50. shapely/iterops.pyc +0 -0
  51. shapely/linref.pyc +0 -0
  52. shapely/ops.py +125 -3
  53. shapely/ops.pyc +0 -0
  54. shapely/predicates.pyc +0 -0
  55. shapely/prepared.pyc +0 -0
  56. shapely/speedups/__init__.pyc +0 -0
  57. shapely/speedups/_speedups.c +5201 -0
  58. shapely/speedups/_speedups.pyc +0 -0
  59. shapely/speedups/_speedups.pyd +0 -0
  60. shapely/tests/Array.txt +86 -0
  61. shapely/tests/GeoInterface.txt +69 -0
  62. shapely/tests/IterOps.txt +31 -0
  63. shapely/tests/LineString.txt +134 -0
  64. shapely/tests/MultiLineString.txt +81 -0
  65. shapely/tests/MultiPoint.txt +101 -0
  66. shapely/tests/MultiPolygon.txt +71 -0
  67. shapely/tests/Operations.txt +89 -0
  68. shapely/tests/Operators.txt +18 -0
  69. shapely/tests/Persist.txt +35 -0
  70. shapely/tests/Point.txt +148 -0
  71. shapely/tests/Polygon.txt +143 -0
  72. shapely/tests/Predicates.txt +51 -0
  73. shapely/tests/__init__.py +10 -1
  74. shapely/tests/__init__.pyc +0 -0
  75. shapely/tests/attribute-chains.txt +38 -0
  76. shapely/tests/binascii_hex.txt +47 -0
  77. shapely/tests/cascaded_union.txt +26 -0
  78. shapely/tests/dimensions.txt +17 -0
  79. shapely/tests/invalid_intersection.txt +29 -0
  80. shapely/tests/linemerge.txt +61 -0
  81. shapely/tests/polygonize.txt +40 -0
  82. shapely/tests/test_affinity.py +239 -0
  83. shapely/tests/test_affinity.pyc +0 -0
  84. shapely/tests/test_box.pyc +0 -0
  85. shapely/tests/test_cga.pyc +0 -0
  86. shapely/tests/test_collection.py +15 -0
  87. shapely/tests/test_collection.pyc +0 -0
  88. shapely/tests/test_delegated.pyc +0 -0
  89. shapely/tests/test_dlls.py +1 -1
  90. shapely/tests/test_dlls.pyc +0 -0
  91. shapely/tests/test_doctests.pyc +0 -0
  92. shapely/tests/test_emptiness.py +41 -8
  93. shapely/tests/test_emptiness.pyc +0 -0
  94. shapely/tests/test_equality.pyc +0 -0
  95. shapely/tests/test_geomseq.pyc +0 -0
  96. shapely/tests/test_getitem.py +113 -0
  97. shapely/tests/test_getitem.pyc +0 -0
  98. shapely/tests/test_linear_referencing.pyc +0 -0
  99. shapely/tests/test_mapping.pyc +0 -0
  100. shapely/tests/test_ndarrays.py +35 -0
  101. shapely/tests/test_ndarrays.pyc +0 -0
  102. shapely/tests/test_pickle.py +15 -0
  103. shapely/tests/test_pickle.pyc +0 -0
  104. shapely/tests/test_prepared.pyc +0 -0
  105. shapely/tests/test_products_z.pyc +0 -0
  106. shapely/tests/test_singularity.pyc +0 -0
  107. shapely/tests/test_speedups.pyc +0 -0
  108. shapely/tests/test_styles.py +17 -0
  109. shapely/tests/test_styles.pyc +0 -0
  110. shapely/tests/test_transform.py +61 -0
  111. shapely/tests/test_transform.pyc +0 -0
  112. shapely/tests/test_unary_union.py +40 -0
  113. shapely/tests/test_unary_union.pyc +0 -0
  114. shapely/tests/test_validation.pyc +0 -0
  115. shapely/tests/test_xy.pyc +0 -0
  116. shapely/tests/threading_test.pyc +0 -0
  117. shapely/tests/wkt_locale.txt +28 -0
  118. shapely/topology.pyc +0 -0
  119. shapely/validation.pyc +0 -0
  120. shapely/wkb.py +3 -17
  121. shapely/wkb.pyc +0 -0
  122. shapely/wkt.py +3 -13
  123. shapely/wkt.pyc +0 -0
  124. DLLs/geos.dll +0 -0
  125. DLLs/geos_c.dll +0 -0
@@ -0,0 +1,40 @@
1
+ from itertools import islice
2
+ import unittest
3
+ from shapely.geometry import Point
4
+ from shapely.ops import unary_union
5
+
6
+ def halton(base):
7
+ """Returns an iterator over an infinite Halton sequence"""
8
+ def value(index):
9
+ result = 0.0
10
+ f = 1.0/base
11
+ i = index
12
+ while i > 0:
13
+ result += f * (i % base)
14
+ i = i/base
15
+ f = f/base
16
+ return result
17
+ i = 1
18
+ while i > 0:
19
+ yield value(i)
20
+ i += 1
21
+
22
+ class UnionTestCase(unittest.TestCase):
23
+ def test_1(self):
24
+ # Instead of random points, use deterministic, pseudo-random Halton
25
+ # sequences for repeatability sake.
26
+ coords = zip(
27
+ list(islice(halton(5), 20, 120)),
28
+ list(islice(halton(7), 20, 120)) )
29
+ patches = [Point(xy).buffer(0.05) for xy in coords]
30
+ u = unary_union(patches)
31
+ self.failUnlessEqual(u.geom_type, 'MultiPolygon')
32
+ self.failUnlessAlmostEqual(u.area, 0.71857254056)
33
+
34
+ def test_suite():
35
+ try:
36
+ patches = [Point((0, 0)).buffer(0.05)]
37
+ unary_union(patches)
38
+ except KeyError:
39
+ return lambda x: None
40
+ return unittest.TestLoader().loadTestsFromTestCase(UnionTestCase)
Binary file
Binary file
shapely/tests/test_xy.pyc CHANGED
Binary file
Binary file
@@ -0,0 +1,28 @@
1
+ Test locale independence of WKT
2
+ ===============================
3
+
4
+ Set locale to one that uses a comma as decimal seperator`
5
+
6
+ >>> import locale, sys
7
+ >>> if sys.platform == 'win32':
8
+ ... _ = locale.setlocale(locale.LC_ALL, 'portuguese_brazil')
9
+ ... else:
10
+ ... _ = locale.setlocale(locale.LC_ALL, 'pt_BR.UTF-8')
11
+
12
+ Test reading and writing`
13
+
14
+ >>> from shapely.wkt import loads
15
+ >>> p = loads('POINT (0.0 0.0)')
16
+ >>> p.x == 0.0
17
+ True
18
+ >>> p.y == 0.0
19
+ True
20
+ >>> p.wkt
21
+ 'POINT (0.0...)'
22
+ >>> from shapely.wkt import dumps
23
+ >>> dumps(p)
24
+ 'POINT (0.0...)'
25
+
26
+ Reset locale
27
+
28
+ >>> _ = locale.setlocale(locale.LC_ALL, '')
shapely/topology.pyc CHANGED
Binary file
shapely/validation.pyc CHANGED
Binary file
shapely/wkb.py CHANGED
@@ -1,24 +1,13 @@
1
1
  """Load/dump geometries using the well-known binary (WKB) format
2
2
  """
3
3
 
4
- from ctypes import pointer, c_size_t, c_char_p, c_void_p
5
-
6
- from shapely.geos import lgeos, ReadingError
7
-
4
+ from shapely.geometry.base import geom_from_wkb, geom_to_wkb
8
5
 
9
6
  # Pickle-like convenience functions
10
7
 
11
- def deserialize(data):
12
- geom = lgeos.GEOSGeomFromWKB_buf(c_char_p(data), c_size_t(len(data)));
13
- if not geom:
14
- raise ReadingError(
15
- "Could not create geometry because of errors while reading input.")
16
- return geom
17
-
18
8
  def loads(data):
19
9
  """Load a geometry from a WKB string."""
20
- from shapely.geometry.base import geom_factory
21
- return geom_factory(deserialize(data))
10
+ return geom_from_wkb(data)
22
11
 
23
12
  def load(fp):
24
13
  """Load a geometry from an open file."""
@@ -27,10 +16,7 @@ def load(fp):
27
16
 
28
17
  def dumps(ob):
29
18
  """Dump a WKB representation of a geometry to a byte string."""
30
- if ob is None or ob._geom is None:
31
- raise ValueError("Null geometry supports no operations")
32
- size = c_size_t()
33
- return lgeos.GEOSGeomToWKB_buf(c_void_p(ob._geom), pointer(size))
19
+ return geom_to_wkb(ob)
34
20
 
35
21
  def dump(ob, fp):
36
22
  """Dump a geometry to an open file."""
shapely/wkb.pyc CHANGED
Binary file
shapely/wkt.py CHANGED
@@ -1,21 +1,13 @@
1
1
  """Load/dump geometries using the well-known text (WKT) format
2
2
  """
3
3
 
4
- from ctypes import c_char_p
5
-
6
- from shapely.geos import lgeos, ReadingError
7
-
4
+ from shapely.geometry.base import geom_from_wkt, geom_to_wkt
8
5
 
9
6
  # Pickle-like convenience functions
10
7
 
11
8
  def loads(data):
12
9
  """Load a geometry from a WKT string."""
13
- from shapely.geometry.base import geom_factory
14
- geom = lgeos.GEOSGeomFromWKT(c_char_p(data))
15
- if not geom:
16
- raise ReadingError, \
17
- "Could not create geometry because of errors while reading input."
18
- return geom_factory(geom)
10
+ return geom_from_wkt(data) #factory(geom)
19
11
 
20
12
  def load(fp):
21
13
  """Load a geometry from an open file."""
@@ -24,9 +16,7 @@ def load(fp):
24
16
 
25
17
  def dumps(ob):
26
18
  """Dump a WKB representation of a geometry to a byte string."""
27
- if ob is None or ob._geom is None:
28
- raise ValueError("Null geometry supports no operations")
29
- return lgeos.GEOSGeomToWKT(ob._geom)
19
+ return geom_to_wkt(ob)
30
20
 
31
21
  def dump(ob, fp):
32
22
  """Dump a geometry to an open file."""
shapely/wkt.pyc CHANGED
Binary file
DLLs/geos.dll DELETED
Binary file
DLLs/geos_c.dll DELETED
Binary file