shapely 1.6.2.post1__tar.gz → 1.6.4__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 (134) hide show
  1. {Shapely-1.6.2.post1 → Shapely-1.6.4}/CHANGES.txt +18 -2
  2. {Shapely-1.6.2.post1/Shapely.egg-info → Shapely-1.6.4}/PKG-INFO +19 -3
  3. {Shapely-1.6.2.post1 → Shapely-1.6.4/Shapely.egg-info}/PKG-INFO +19 -3
  4. Shapely-1.6.4/VERSION.txt +1 -0
  5. {Shapely-1.6.2.post1 → Shapely-1.6.4}/docs/manual.rst +17 -5
  6. Shapely-1.6.4/shapely/__init__.py +1 -0
  7. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/geometry/base.py +1 -1
  8. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/geometry/polygon.py +16 -5
  9. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/geometry/proxy.py +2 -1
  10. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/ops.py +1 -2
  11. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/speedups/_speedups.c +809 -730
  12. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/speedups/_speedups.pyx +3 -0
  13. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/strtree.py +3 -1
  14. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_emptiness.py +10 -0
  15. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_geointerface.py +17 -1
  16. Shapely-1.6.4/tests/test_pickle.py +28 -0
  17. Shapely-1.6.2.post1/VERSION.txt +0 -1
  18. Shapely-1.6.2.post1/shapely/__init__.py +0 -1
  19. Shapely-1.6.2.post1/tests/test_pickle.py +0 -22
  20. {Shapely-1.6.2.post1 → Shapely-1.6.4}/CREDITS.txt +0 -0
  21. {Shapely-1.6.2.post1 → Shapely-1.6.4}/LICENSE.txt +0 -0
  22. {Shapely-1.6.2.post1 → Shapely-1.6.4}/README.rst +0 -0
  23. {Shapely-1.6.2.post1 → Shapely-1.6.4}/Shapely.egg-info/SOURCES.txt +0 -0
  24. {Shapely-1.6.2.post1 → Shapely-1.6.4}/Shapely.egg-info/dependency_links.txt +0 -0
  25. {Shapely-1.6.2.post1 → Shapely-1.6.4}/Shapely.egg-info/requires.txt +0 -0
  26. {Shapely-1.6.2.post1 → Shapely-1.6.4}/Shapely.egg-info/top_level.txt +0 -0
  27. {Shapely-1.6.2.post1 → Shapely-1.6.4}/_vendor/__init__.py +0 -0
  28. {Shapely-1.6.2.post1 → Shapely-1.6.4}/_vendor/packaging/__about__.py +0 -0
  29. {Shapely-1.6.2.post1 → Shapely-1.6.4}/_vendor/packaging/__init__.py +0 -0
  30. {Shapely-1.6.2.post1 → Shapely-1.6.4}/_vendor/packaging/_compat.py +0 -0
  31. {Shapely-1.6.2.post1 → Shapely-1.6.4}/_vendor/packaging/_structures.py +0 -0
  32. {Shapely-1.6.2.post1 → Shapely-1.6.4}/_vendor/packaging/markers.py +0 -0
  33. {Shapely-1.6.2.post1 → Shapely-1.6.4}/_vendor/packaging/requirements.py +0 -0
  34. {Shapely-1.6.2.post1 → Shapely-1.6.4}/_vendor/packaging/specifiers.py +0 -0
  35. {Shapely-1.6.2.post1 → Shapely-1.6.4}/_vendor/packaging/utils.py +0 -0
  36. {Shapely-1.6.2.post1 → Shapely-1.6.4}/_vendor/packaging/version.py +0 -0
  37. {Shapely-1.6.2.post1 → Shapely-1.6.4}/docs/design.rst +0 -0
  38. {Shapely-1.6.2.post1 → Shapely-1.6.4}/docs/index.rst +0 -0
  39. {Shapely-1.6.2.post1 → Shapely-1.6.4}/docs/project.rst +0 -0
  40. {Shapely-1.6.2.post1 → Shapely-1.6.4}/setup.cfg +0 -0
  41. {Shapely-1.6.2.post1 → Shapely-1.6.4}/setup.py +0 -0
  42. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/_buildcfg.py +0 -0
  43. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/_geos.pxi +0 -0
  44. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/affinity.py +0 -0
  45. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/algorithms/__init__.py +0 -0
  46. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/algorithms/cga.py +0 -0
  47. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/algorithms/polylabel.py +0 -0
  48. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/coords.py +0 -0
  49. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/ctypes_declarations.py +0 -0
  50. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/errors.py +0 -0
  51. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/examples/__init__.py +0 -0
  52. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/examples/dissolve.py +0 -0
  53. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/examples/geoms.py +0 -0
  54. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/examples/intersect.py +0 -0
  55. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/ftools.py +0 -0
  56. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/geometry/__init__.py +0 -0
  57. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/geometry/collection.py +0 -0
  58. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/geometry/geo.py +0 -0
  59. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/geometry/linestring.py +0 -0
  60. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/geometry/multilinestring.py +0 -0
  61. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/geometry/multipoint.py +0 -0
  62. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/geometry/multipolygon.py +0 -0
  63. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/geometry/point.py +0 -0
  64. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/geos.py +0 -0
  65. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/impl.py +0 -0
  66. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/iterops.py +0 -0
  67. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/linref.py +0 -0
  68. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/predicates.py +0 -0
  69. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/prepared.py +0 -0
  70. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/speedups/__init__.py +0 -0
  71. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/topology.py +0 -0
  72. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/validation.py +0 -0
  73. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/vectorized/__init__.py +0 -0
  74. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/vectorized/_vectorized.pyx +0 -0
  75. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/wkb.py +0 -0
  76. {Shapely-1.6.2.post1 → Shapely-1.6.4}/shapely/wkt.py +0 -0
  77. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/__init__.py +0 -0
  78. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/binascii_hex.txt +0 -0
  79. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/conftest.py +0 -0
  80. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_affinity.py +0 -0
  81. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_box.py +0 -0
  82. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_cga.py +0 -0
  83. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_collection.py +0 -0
  84. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_coords.py +0 -0
  85. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_default_impl.py +0 -0
  86. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_delaunay.py +0 -0
  87. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_delegated.py +0 -0
  88. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_dlls.py +0 -0
  89. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_doctests.py +0 -0
  90. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_empty_polygons.py +0 -0
  91. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_equality.py +0 -0
  92. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_geomseq.py +0 -0
  93. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_geos_err_handler.py +0 -0
  94. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_getitem.py +0 -0
  95. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_hash.py +0 -0
  96. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_invalid_geometries.py +0 -0
  97. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_iterops.py +0 -0
  98. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_linear_referencing.py +0 -0
  99. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_linemerge.py +0 -0
  100. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_linestring.py +0 -0
  101. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_locale.py +0 -0
  102. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_mapping.py +0 -0
  103. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_minimum_rotated_rectangle.py +0 -0
  104. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_multi.py +0 -0
  105. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_multilinestring.py +0 -0
  106. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_multipoint.py +0 -0
  107. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_multipolygon.py +0 -0
  108. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_ndarrays.py +0 -0
  109. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_nearest.py +0 -0
  110. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_operations.py +0 -0
  111. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_operators.py +0 -0
  112. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_parallel_offset.py +0 -0
  113. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_persist.py +0 -0
  114. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_point.py +0 -0
  115. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_polygon.py +0 -0
  116. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_polygonize.py +0 -0
  117. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_polylabel.py +0 -0
  118. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_predicates.py +0 -0
  119. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_prepared.py +0 -0
  120. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_products_z.py +0 -0
  121. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_shared_paths.py +0 -0
  122. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_singularity.py +0 -0
  123. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_snap.py +0 -0
  124. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_split.py +0 -0
  125. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_strtree.py +0 -0
  126. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_styles.py +0 -0
  127. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_svg.py +0 -0
  128. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_transform.py +0 -0
  129. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_union.py +0 -0
  130. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_validation.py +0 -0
  131. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_vectorized.py +0 -0
  132. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_wkt.py +0 -0
  133. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/test_xy.py +0 -0
  134. {Shapely-1.6.2.post1 → Shapely-1.6.4}/tests/threading_test.py +0 -0
@@ -1,6 +1,24 @@
1
1
  Changes
2
2
  =======
3
3
 
4
+ 1.6.4 (2017-01-24)
5
+ ------------------
6
+
7
+ - Handle a ``TypeError`` that can occur when geometries are torn down (#473,
8
+ #528).
9
+
10
+ -
11
+ 1.6.3 (2017-12-09)
12
+ ------------------
13
+
14
+ - AttributeError is no longer raised when accessing __geo_interface__ of an
15
+ empty polygon (#450).
16
+ - ``asShape`` now handles empty coordinates in mappings as ``shape`` does
17
+ (#542). Please note that ``asShape`` is likely to be deprecated in a future
18
+ version of Shapely.
19
+ - Check for length of LineString coordinates in speed mode, preventing crashes
20
+ when using LineStrings with only one coordinate (#546).
21
+
4
22
  1.6.2 (2017-10-30)
5
23
  ------------------
6
24
 
@@ -10,8 +28,6 @@ Changes
10
28
  1.6.2 (2017-10-26)
11
29
  ------------------
12
30
 
13
- - Handle a ``TypeError`` that can occur when geometries are torn down (#473,
14
- #528).
15
31
  - Splitting a linestring by one of its end points will now succeed instead of
16
32
  failing with a ``ValueError`` (#524, #533).
17
33
  - Missing documentation of a geometry's ``overlaps`` predicate has been added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: Shapely
3
- Version: 1.6.2.post1
3
+ Version: 1.6.4
4
4
  Summary: Geometric objects, predicates, and operations
5
5
  Home-page: https://github.com/Toblerity/Shapely
6
6
  Author: Sean Gillies
@@ -242,6 +242,24 @@ Description: =======
242
242
  Changes
243
243
  =======
244
244
 
245
+ 1.6.4 (2017-01-24)
246
+ ------------------
247
+
248
+ - Handle a ``TypeError`` that can occur when geometries are torn down (#473,
249
+ #528).
250
+
251
+ -
252
+ 1.6.3 (2017-12-09)
253
+ ------------------
254
+
255
+ - AttributeError is no longer raised when accessing __geo_interface__ of an
256
+ empty polygon (#450).
257
+ - ``asShape`` now handles empty coordinates in mappings as ``shape`` does
258
+ (#542). Please note that ``asShape`` is likely to be deprecated in a future
259
+ version of Shapely.
260
+ - Check for length of LineString coordinates in speed mode, preventing crashes
261
+ when using LineStrings with only one coordinate (#546).
262
+
245
263
  1.6.2 (2017-10-30)
246
264
  ------------------
247
265
 
@@ -251,8 +269,6 @@ Description: =======
251
269
  1.6.2 (2017-10-26)
252
270
  ------------------
253
271
 
254
- - Handle a ``TypeError`` that can occur when geometries are torn down (#473,
255
- #528).
256
272
  - Splitting a linestring by one of its end points will now succeed instead of
257
273
  failing with a ``ValueError`` (#524, #533).
258
274
  - Missing documentation of a geometry's ``overlaps`` predicate has been added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: Shapely
3
- Version: 1.6.2.post1
3
+ Version: 1.6.4
4
4
  Summary: Geometric objects, predicates, and operations
5
5
  Home-page: https://github.com/Toblerity/Shapely
6
6
  Author: Sean Gillies
@@ -242,6 +242,24 @@ Description: =======
242
242
  Changes
243
243
  =======
244
244
 
245
+ 1.6.4 (2017-01-24)
246
+ ------------------
247
+
248
+ - Handle a ``TypeError`` that can occur when geometries are torn down (#473,
249
+ #528).
250
+
251
+ -
252
+ 1.6.3 (2017-12-09)
253
+ ------------------
254
+
255
+ - AttributeError is no longer raised when accessing __geo_interface__ of an
256
+ empty polygon (#450).
257
+ - ``asShape`` now handles empty coordinates in mappings as ``shape`` does
258
+ (#542). Please note that ``asShape`` is likely to be deprecated in a future
259
+ version of Shapely.
260
+ - Check for length of LineString coordinates in speed mode, preventing crashes
261
+ when using LineStrings with only one coordinate (#546).
262
+
245
263
  1.6.2 (2017-10-30)
246
264
  ------------------
247
265
 
@@ -251,8 +269,6 @@ Description: =======
251
269
  1.6.2 (2017-10-26)
252
270
  ------------------
253
271
 
254
- - Handle a ``TypeError`` that can occur when geometries are torn down (#473,
255
- #528).
256
272
  - Splitting a linestring by one of its end points will now succeed instead of
257
273
  failing with a ``ValueError`` (#524, #533).
258
274
  - Missing documentation of a geometry's ``overlaps`` predicate has been added
@@ -0,0 +1 @@
1
+ 1.6.4
@@ -157,7 +157,7 @@ themselves as instance factories. A few of their intrinsic properties will be
157
157
  discussed in this sections, others in the following sections on operations and
158
158
  serializations.
159
159
 
160
- Instances of `Point`, `LineString`, and `LinearRing` have as their most
160
+ Instances of ``Point``, ``LineString``, and ``LinearRing`` have as their most
161
161
  important attribute a finite sequence of coordinates that determines their
162
162
  interior, boundary, and exterior point sets. A line string can be determined by
163
163
  as few as 2 points, but contains an infinite number of points. Coordinate
@@ -169,8 +169,20 @@ In all constructors, numeric values are converted to type ``float``. In other
169
169
  words, ``Point(0, 0)`` and ``Point(0.0, 0.0)`` produce geometrically equivalent
170
170
  instances. Shapely does not check the topological simplicity or validity of
171
171
  instances when they are constructed as the cost is unwarranted in most cases.
172
- Validating factories are trivially implemented, using the :attr:`is_valid`
173
- predicate, by users that require them.
172
+ Validating factories are easily implemented using the :attr:``is_valid``
173
+ predicate by users that require them.
174
+
175
+ .. note::
176
+
177
+ Shapely is a planar geometry library and `z`, the height
178
+ above or below the plane, is ignored in geometric analysis. There is
179
+ a potential pitfall for users here: coordinate tuples that differ only in
180
+ `z` are not distinguished from each other and their application can result
181
+ in suprisingly invalid geometry objects. For example, ``LineString([(0, 0,
182
+ 0), (0, 0, 1)])`` does not return a vertical line of unit length, but an invalid line
183
+ in the plane with zero length. Similarly, ``Polygon([(0, 0, 0), (0, 0, 1),
184
+ (1, 1, 1)])`` is not bounded by a closed ring and is invalid.
185
+
174
186
 
175
187
  General Attributes and Methods
176
188
  ------------------------------
@@ -2541,8 +2553,8 @@ References
2541
2553
 
2542
2554
 
2543
2555
  .. _GEOS: http://trac.osgeo.org/geos/
2544
- .. _Java Topology Suite: http://www.vividsolutions.com/jts/jtshome.htm
2545
- .. _JTS: http://www.vividsolutions.com/jts/jtshome.htm
2556
+ .. _Java Topology Suite: https://www.locationtech.org/projects/technology.jts
2557
+ .. _JTS: https://www.locationtech.org/projects/technology.jts
2546
2558
  .. _PostGIS: http://postgis.refractions.net
2547
2559
  .. _record: http://pypi.python.org/pypi/Shapely
2548
2560
  .. _wiki: http://trac.gispython.org/lab/wiki/Shapely
@@ -0,0 +1 @@
1
+ __version__ = "1.6.4"
@@ -225,7 +225,7 @@ class BaseGeometry(object):
225
225
  if not self._is_empty and not self._other_owned and self.__geom__:
226
226
  try:
227
227
  self._lgeos.GEOSGeom_destroy(self.__geom__)
228
- except AttributeError:
228
+ except (AttributeError, TypeError):
229
229
  pass # _lgeos might be empty on shutdown
230
230
  self._is_empty = True
231
231
  self.__geom__ = val
@@ -71,6 +71,15 @@ class LinearRing(LineString):
71
71
 
72
72
  coords = property(_get_coords, _set_coords)
73
73
 
74
+ def __setstate__(self, state):
75
+ """WKB doesn't differentiate between LineString and LinearRing so we
76
+ need to move the coordinate sequence into the correct geometry type"""
77
+ super(LinearRing, self).__setstate__(state)
78
+ cs = lgeos.GEOSGeom_getCoordSeq(self.__geom__)
79
+ cs_clone = lgeos.GEOSCoordSeq_clone(cs)
80
+ lgeos.GEOSGeom_destroy(self.__geom__)
81
+ self.__geom__ = lgeos.GEOSGeom_createLinearRing(cs_clone)
82
+
74
83
  @property
75
84
  def is_ccw(self):
76
85
  """True is the ring is oriented counter clock-wise"""
@@ -303,13 +312,15 @@ class Polygon(BaseGeometry):
303
312
 
304
313
  @property
305
314
  def __geo_interface__(self):
306
- coords = [tuple(self.exterior.coords)]
307
- for hole in self.interiors:
308
- coords.append(tuple(hole.coords))
315
+ if not self.exterior:
316
+ coords = []
317
+ else:
318
+ coords = [tuple(self.exterior.coords)]
319
+ for hole in self.interiors:
320
+ coords.append(tuple(hole.coords))
309
321
  return {
310
322
  'type': 'Polygon',
311
- 'coordinates': tuple(coords)
312
- }
323
+ 'coordinates': tuple(coords)}
313
324
 
314
325
  def svg(self, scale_factor=1., fill_color=None):
315
326
  """Returns SVG path element for the Polygon geometry.
@@ -30,7 +30,8 @@ class CachingGeometryProxy(object):
30
30
  gtag = self.gtag()
31
31
  if gtag != self._gtag or self._is_empty:
32
32
  self.empty()
33
- self.__geom__, n = self.factory(self.context)
33
+ if len(self.context) > 0:
34
+ self.__geom__, n = self.factory(self.context)
34
35
  self._gtag = gtag
35
36
  return self.__geom__
36
37
 
@@ -13,8 +13,7 @@ from ctypes import byref, c_void_p, c_double
13
13
  from shapely.geos import lgeos
14
14
  from shapely.geometry.base import geom_factory, BaseGeometry
15
15
  from shapely.geometry import asShape, asLineString, asMultiLineString, Point, MultiPoint,\
16
- LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection
17
- from shapely.algorithms.polylabel import polylabel
16
+ LineString, MultiLineString, Polygon, GeometryCollection
18
17
 
19
18
  __all__ = ['cascaded_union', 'linemerge', 'operator', 'polygonize',
20
19
  'polygonize_full', 'transform', 'unary_union', 'triangulate', 'split']