shapely 1.8a2__tar.gz → 1.8rc1__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 (148) hide show
  1. {Shapely-1.8a2 → Shapely-1.8rc1}/CHANGES.txt +41 -4
  2. {Shapely-1.8a2/Shapely.egg-info → Shapely-1.8rc1}/PKG-INFO +42 -5
  3. {Shapely-1.8a2 → Shapely-1.8rc1/Shapely.egg-info}/PKG-INFO +42 -5
  4. {Shapely-1.8a2 → Shapely-1.8rc1}/Shapely.egg-info/SOURCES.txt +2 -0
  5. Shapely-1.8rc1/VERSION.txt +1 -0
  6. {Shapely-1.8a2 → Shapely-1.8rc1}/docs/index.rst +1 -0
  7. {Shapely-1.8a2 → Shapely-1.8rc1}/docs/manual.rst +2 -0
  8. Shapely-1.8rc1/docs/migration.rst +348 -0
  9. Shapely-1.8rc1/shapely/__init__.py +1 -0
  10. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/_buildcfg.py +3 -1
  11. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/coords.py +4 -1
  12. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/geometry/base.py +104 -15
  13. Shapely-1.8rc1/shapely/geometry/conftest.py +10 -0
  14. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/geometry/geo.py +3 -1
  15. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/geometry/polygon.py +1 -1
  16. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/geometry/proxy.py +5 -0
  17. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/geos.py +7 -3
  18. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/speedups/_speedups.c +425 -369
  19. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/speedups/_speedups.pyx +4 -1
  20. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/strtree.py +84 -95
  21. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/vectorized/__init__.py +2 -0
  22. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/conftest.py +2 -0
  23. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_affinity.py +16 -16
  24. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_collection.py +11 -0
  25. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_dlls.py +3 -2
  26. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_emptiness.py +10 -0
  27. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_equality.py +12 -4
  28. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_geointerface.py +12 -1
  29. Shapely-1.8rc1/tests/test_geometry_base.py +36 -0
  30. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_linestring.py +12 -0
  31. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_multilinestring.py +11 -0
  32. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_multipoint.py +11 -0
  33. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_multipolygon.py +13 -0
  34. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_point.py +12 -0
  35. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_polygon.py +11 -0
  36. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_polylabel.py +1 -1
  37. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_strtree.py +50 -28
  38. Shapely-1.8a2/VERSION.txt +0 -1
  39. Shapely-1.8a2/shapely/__init__.py +0 -1
  40. Shapely-1.8a2/tests/test_geometry_base.py +0 -17
  41. {Shapely-1.8a2 → Shapely-1.8rc1}/CREDITS.txt +0 -0
  42. {Shapely-1.8a2 → Shapely-1.8rc1}/LICENSE.txt +0 -0
  43. {Shapely-1.8a2 → Shapely-1.8rc1}/README.rst +0 -0
  44. {Shapely-1.8a2 → Shapely-1.8rc1}/Shapely.egg-info/dependency_links.txt +0 -0
  45. {Shapely-1.8a2 → Shapely-1.8rc1}/Shapely.egg-info/requires.txt +0 -0
  46. {Shapely-1.8a2 → Shapely-1.8rc1}/Shapely.egg-info/top_level.txt +0 -0
  47. {Shapely-1.8a2 → Shapely-1.8rc1}/_vendor/__init__.py +0 -0
  48. {Shapely-1.8a2 → Shapely-1.8rc1}/_vendor/packaging/__about__.py +0 -0
  49. {Shapely-1.8a2 → Shapely-1.8rc1}/_vendor/packaging/__init__.py +0 -0
  50. {Shapely-1.8a2 → Shapely-1.8rc1}/_vendor/packaging/_compat.py +0 -0
  51. {Shapely-1.8a2 → Shapely-1.8rc1}/_vendor/packaging/_structures.py +0 -0
  52. {Shapely-1.8a2 → Shapely-1.8rc1}/_vendor/packaging/markers.py +0 -0
  53. {Shapely-1.8a2 → Shapely-1.8rc1}/_vendor/packaging/requirements.py +0 -0
  54. {Shapely-1.8a2 → Shapely-1.8rc1}/_vendor/packaging/specifiers.py +0 -0
  55. {Shapely-1.8a2 → Shapely-1.8rc1}/_vendor/packaging/utils.py +0 -0
  56. {Shapely-1.8a2 → Shapely-1.8rc1}/_vendor/packaging/version.py +0 -0
  57. {Shapely-1.8a2 → Shapely-1.8rc1}/docs/design.rst +0 -0
  58. {Shapely-1.8a2 → Shapely-1.8rc1}/docs/project.rst +0 -0
  59. {Shapely-1.8a2 → Shapely-1.8rc1}/setup.cfg +0 -0
  60. {Shapely-1.8a2 → Shapely-1.8rc1}/setup.py +0 -0
  61. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/_geos.pxi +0 -0
  62. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/affinity.py +0 -0
  63. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/algorithms/__init__.py +0 -0
  64. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/algorithms/cga.py +0 -0
  65. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/algorithms/polylabel.py +0 -0
  66. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/ctypes_declarations.py +0 -0
  67. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/errors.py +0 -0
  68. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/examples/__init__.py +0 -0
  69. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/examples/dissolve.py +0 -0
  70. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/examples/geoms.py +0 -0
  71. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/examples/intersect.py +0 -0
  72. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/geometry/__init__.py +0 -0
  73. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/geometry/collection.py +0 -0
  74. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/geometry/linestring.py +0 -0
  75. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/geometry/multilinestring.py +0 -0
  76. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/geometry/multipoint.py +0 -0
  77. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/geometry/multipolygon.py +0 -0
  78. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/geometry/point.py +0 -0
  79. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/impl.py +0 -0
  80. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/iterops.py +0 -0
  81. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/linref.py +0 -0
  82. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/ops.py +0 -0
  83. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/predicates.py +0 -0
  84. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/prepared.py +0 -0
  85. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/speedups/__init__.py +0 -0
  86. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/topology.py +0 -0
  87. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/validation.py +0 -0
  88. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/vectorized/_vectorized.pyx +0 -0
  89. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/wkb.py +0 -0
  90. {Shapely-1.8a2 → Shapely-1.8rc1}/shapely/wkt.py +0 -0
  91. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/__init__.py +0 -0
  92. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_binascii_hex.txt +0 -0
  93. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_box.py +0 -0
  94. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_buffer.py +0 -0
  95. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_cga.py +0 -0
  96. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_clip_by_rect.py +0 -0
  97. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_coords.py +0 -0
  98. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_create_inconsistent_dimensionality.py +0 -0
  99. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_default_impl.py +0 -0
  100. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_delaunay.py +0 -0
  101. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_delegated.py +0 -0
  102. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_doctests.py +0 -0
  103. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_empty_polygons.py +0 -0
  104. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_geometry_geo.py +0 -0
  105. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_geomseq.py +0 -0
  106. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_geos_err_handler.py +0 -0
  107. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_getitem.py +0 -0
  108. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_hash.py +0 -0
  109. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_invalid_geometries.py +0 -0
  110. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_iterops.py +0 -0
  111. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_linear_referencing.py +0 -0
  112. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_linemerge.py +0 -0
  113. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_locale.py +0 -0
  114. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_make_valid.py +0 -0
  115. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_mapping.py +0 -0
  116. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_minimum_clearance.py +0 -0
  117. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_minimum_rotated_rectangle.py +0 -0
  118. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_multi.py +0 -0
  119. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_ndarrays.py +0 -0
  120. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_nearest.py +0 -0
  121. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_operations.py +0 -0
  122. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_operators.py +0 -0
  123. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_orient.py +0 -0
  124. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_parallel_offset.py +0 -0
  125. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_persist.py +0 -0
  126. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_pickle.py +0 -0
  127. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_polygonize.py +0 -0
  128. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_predicates.py +0 -0
  129. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_prepared.py +0 -0
  130. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_products_z.py +0 -0
  131. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_shape.py +0 -0
  132. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_shared_paths.py +0 -0
  133. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_singularity.py +0 -0
  134. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_snap.py +0 -0
  135. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_split.py +0 -0
  136. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_styles.py +0 -0
  137. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_substring.py +0 -0
  138. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_svg.py +0 -0
  139. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_transform.py +0 -0
  140. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_union.py +0 -0
  141. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_validation.py +0 -0
  142. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_vectorized.py +0 -0
  143. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_voronoi_diagram.py +0 -0
  144. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_wkb.py +0 -0
  145. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_wkt.py +0 -0
  146. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/test_xy.py +0 -0
  147. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/threading_test.py +0 -0
  148. {Shapely-1.8a2 → Shapely-1.8rc1}/tests/unpickle-strtree.py +0 -0
@@ -1,8 +1,37 @@
1
1
  Changes
2
2
  =======
3
3
 
4
- 1.8a2 (TBD)
5
- -----------
4
+ 1.8rc1 (2021-10-04)
5
+ -------------------
6
+
7
+ Deprecations:
8
+
9
+ The almost_exact() method of BaseGeometry has been deprecated. It is confusing
10
+ and will be removed in 2.0.0. The equals_exact() method is to be used instead.
11
+
12
+ Bug fixes:
13
+
14
+ - We ensure that the _speedups module is always imported before _vectorized to
15
+ avoid an unexplained condition on Windows with Python 3.8 and 3.9 (#1184).
16
+
17
+ 1.8a3 (2021-08-24)
18
+ ------------------
19
+
20
+ Deprecations:
21
+
22
+ The STRtree class deprecation warnings have been removed. The class in 2.0.0
23
+ will be backwards compatible with the class in 1.8.0.
24
+
25
+ Bug fixes:
26
+
27
+ - The __array_interface__ raises only AttributeError, all other exceptions are
28
+ deprecated starting with Numpy 1.21 (#1173).
29
+ - The STRtree class now uses a pair of item, geom sequences internally instead
30
+ of a dict (#1177).
31
+
32
+
33
+ 1.8a2 (2021-07-15)
34
+ ------------------
6
35
 
7
36
  Python version support:
8
37
 
@@ -31,13 +60,18 @@ Bug fixes:
31
60
  geometry are avoided by never passing an empty geometry (#1134).
32
61
  - Python's builtin super() is now used only as described in PEP 3135 (#1109).
33
62
  - Only load conda GEOS dll if it exists (on Windows) (#1108).
63
+ - Add /opt/homebrew/lib to the list of directories to be searched for the GEOS
64
+ shared library.
65
+ - Added new library search path to assist app creation with cx_Freeze.
34
66
 
35
67
  1.8a1 (2021-03-03)
36
68
  ------------------
37
69
 
38
70
  Shapely 1.8.0 will be a transitional version. There are a few bug fixes and new
39
71
  features, but it is mainly about warning of the upcoming changes in 2.0.0.
40
- Several more pre-releases before 1.8.0 are expected.
72
+ Several more pre-releases before 1.8.0 are expected. See the migration guide
73
+ to Shapely 1.8 / 2.0 for more details on how to update your code
74
+ (https://shapely.readthedocs.io/en/latest/migration.html).
41
75
 
42
76
  Python version support:
43
77
 
@@ -50,9 +84,9 @@ version 2.0.0.
50
84
 
51
85
  - ops.cascaded_union
52
86
  - geometry .empty()
53
- - geometry .to_wkb() and .to_wkt()
54
87
  - geometry .ctypes and .__array_interface__
55
88
  - multi-part geometry .__len__
89
+ - setting custom attributes on geometry objects
56
90
 
57
91
  Geometry objects will become immutable in version 2.0.0.
58
92
 
@@ -62,6 +96,9 @@ not yet decided, but will be decided before 1.8.0 is released.
62
96
  Deprecation warnings will be emitted in 1.8a1 when any of these features are
63
97
  used.
64
98
 
99
+ The deprecated .to_wkb() and .to_wkt() methods on the geometry objects have
100
+ been removed.
101
+
65
102
  New features:
66
103
 
67
104
  - Add a normalize() method to geometry classes, exposing the GEOSNormalize
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Shapely
3
- Version: 1.8a2
3
+ Version: 1.8rc1
4
4
  Summary: Geometric objects, predicates, and operations
5
5
  Home-page: https://github.com/Toblerity/Shapely
6
6
  Author: Sean Gillies
@@ -296,8 +296,37 @@ Description: =======
296
296
  Changes
297
297
  =======
298
298
 
299
- 1.8a2 (TBD)
300
- -----------
299
+ 1.8rc1 (2021-10-04)
300
+ -------------------
301
+
302
+ Deprecations:
303
+
304
+ The almost_exact() method of BaseGeometry has been deprecated. It is confusing
305
+ and will be removed in 2.0.0. The equals_exact() method is to be used instead.
306
+
307
+ Bug fixes:
308
+
309
+ - We ensure that the _speedups module is always imported before _vectorized to
310
+ avoid an unexplained condition on Windows with Python 3.8 and 3.9 (#1184).
311
+
312
+ 1.8a3 (2021-08-24)
313
+ ------------------
314
+
315
+ Deprecations:
316
+
317
+ The STRtree class deprecation warnings have been removed. The class in 2.0.0
318
+ will be backwards compatible with the class in 1.8.0.
319
+
320
+ Bug fixes:
321
+
322
+ - The __array_interface__ raises only AttributeError, all other exceptions are
323
+ deprecated starting with Numpy 1.21 (#1173).
324
+ - The STRtree class now uses a pair of item, geom sequences internally instead
325
+ of a dict (#1177).
326
+
327
+
328
+ 1.8a2 (2021-07-15)
329
+ ------------------
301
330
 
302
331
  Python version support:
303
332
 
@@ -326,13 +355,18 @@ Description: =======
326
355
  geometry are avoided by never passing an empty geometry (#1134).
327
356
  - Python's builtin super() is now used only as described in PEP 3135 (#1109).
328
357
  - Only load conda GEOS dll if it exists (on Windows) (#1108).
358
+ - Add /opt/homebrew/lib to the list of directories to be searched for the GEOS
359
+ shared library.
360
+ - Added new library search path to assist app creation with cx_Freeze.
329
361
 
330
362
  1.8a1 (2021-03-03)
331
363
  ------------------
332
364
 
333
365
  Shapely 1.8.0 will be a transitional version. There are a few bug fixes and new
334
366
  features, but it is mainly about warning of the upcoming changes in 2.0.0.
335
- Several more pre-releases before 1.8.0 are expected.
367
+ Several more pre-releases before 1.8.0 are expected. See the migration guide
368
+ to Shapely 1.8 / 2.0 for more details on how to update your code
369
+ (https://shapely.readthedocs.io/en/latest/migration.html).
336
370
 
337
371
  Python version support:
338
372
 
@@ -345,9 +379,9 @@ Description: =======
345
379
 
346
380
  - ops.cascaded_union
347
381
  - geometry .empty()
348
- - geometry .to_wkb() and .to_wkt()
349
382
  - geometry .ctypes and .__array_interface__
350
383
  - multi-part geometry .__len__
384
+ - setting custom attributes on geometry objects
351
385
 
352
386
  Geometry objects will become immutable in version 2.0.0.
353
387
 
@@ -357,6 +391,9 @@ Description: =======
357
391
  Deprecation warnings will be emitted in 1.8a1 when any of these features are
358
392
  used.
359
393
 
394
+ The deprecated .to_wkb() and .to_wkt() methods on the geometry objects have
395
+ been removed.
396
+
360
397
  New features:
361
398
 
362
399
  - Add a normalize() method to geometry classes, exposing the GEOSNormalize
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Shapely
3
- Version: 1.8a2
3
+ Version: 1.8rc1
4
4
  Summary: Geometric objects, predicates, and operations
5
5
  Home-page: https://github.com/Toblerity/Shapely
6
6
  Author: Sean Gillies
@@ -296,8 +296,37 @@ Description: =======
296
296
  Changes
297
297
  =======
298
298
 
299
- 1.8a2 (TBD)
300
- -----------
299
+ 1.8rc1 (2021-10-04)
300
+ -------------------
301
+
302
+ Deprecations:
303
+
304
+ The almost_exact() method of BaseGeometry has been deprecated. It is confusing
305
+ and will be removed in 2.0.0. The equals_exact() method is to be used instead.
306
+
307
+ Bug fixes:
308
+
309
+ - We ensure that the _speedups module is always imported before _vectorized to
310
+ avoid an unexplained condition on Windows with Python 3.8 and 3.9 (#1184).
311
+
312
+ 1.8a3 (2021-08-24)
313
+ ------------------
314
+
315
+ Deprecations:
316
+
317
+ The STRtree class deprecation warnings have been removed. The class in 2.0.0
318
+ will be backwards compatible with the class in 1.8.0.
319
+
320
+ Bug fixes:
321
+
322
+ - The __array_interface__ raises only AttributeError, all other exceptions are
323
+ deprecated starting with Numpy 1.21 (#1173).
324
+ - The STRtree class now uses a pair of item, geom sequences internally instead
325
+ of a dict (#1177).
326
+
327
+
328
+ 1.8a2 (2021-07-15)
329
+ ------------------
301
330
 
302
331
  Python version support:
303
332
 
@@ -326,13 +355,18 @@ Description: =======
326
355
  geometry are avoided by never passing an empty geometry (#1134).
327
356
  - Python's builtin super() is now used only as described in PEP 3135 (#1109).
328
357
  - Only load conda GEOS dll if it exists (on Windows) (#1108).
358
+ - Add /opt/homebrew/lib to the list of directories to be searched for the GEOS
359
+ shared library.
360
+ - Added new library search path to assist app creation with cx_Freeze.
329
361
 
330
362
  1.8a1 (2021-03-03)
331
363
  ------------------
332
364
 
333
365
  Shapely 1.8.0 will be a transitional version. There are a few bug fixes and new
334
366
  features, but it is mainly about warning of the upcoming changes in 2.0.0.
335
- Several more pre-releases before 1.8.0 are expected.
367
+ Several more pre-releases before 1.8.0 are expected. See the migration guide
368
+ to Shapely 1.8 / 2.0 for more details on how to update your code
369
+ (https://shapely.readthedocs.io/en/latest/migration.html).
336
370
 
337
371
  Python version support:
338
372
 
@@ -345,9 +379,9 @@ Description: =======
345
379
 
346
380
  - ops.cascaded_union
347
381
  - geometry .empty()
348
- - geometry .to_wkb() and .to_wkt()
349
382
  - geometry .ctypes and .__array_interface__
350
383
  - multi-part geometry .__len__
384
+ - setting custom attributes on geometry objects
351
385
 
352
386
  Geometry objects will become immutable in version 2.0.0.
353
387
 
@@ -357,6 +391,9 @@ Description: =======
357
391
  Deprecation warnings will be emitted in 1.8a1 when any of these features are
358
392
  used.
359
393
 
394
+ The deprecated .to_wkb() and .to_wkt() methods on the geometry objects have
395
+ been removed.
396
+
360
397
  New features:
361
398
 
362
399
  - Add a normalize() method to geometry classes, exposing the GEOSNormalize
@@ -23,6 +23,7 @@ _vendor/packaging/version.py
23
23
  docs/design.rst
24
24
  docs/index.rst
25
25
  docs/manual.rst
26
+ docs/migration.rst
26
27
  docs/project.rst
27
28
  shapely/__init__.py
28
29
  shapely/_buildcfg.py
@@ -53,6 +54,7 @@ shapely/examples/intersect.py
53
54
  shapely/geometry/__init__.py
54
55
  shapely/geometry/base.py
55
56
  shapely/geometry/collection.py
57
+ shapely/geometry/conftest.py
56
58
  shapely/geometry/geo.py
57
59
  shapely/geometry/linestring.py
58
60
  shapely/geometry/multilinestring.py
@@ -0,0 +1 @@
1
+ 1.8rc1
@@ -11,6 +11,7 @@ Documentation Contents
11
11
  The Project <project>
12
12
  User Manual <manual>
13
13
  API Documentation <modules>
14
+ migration
14
15
 
15
16
  Indices and tables
16
17
  ==================
@@ -2787,6 +2787,8 @@ All of Shapely's geometry types are supported by these functions.
2787
2787
  >>> wkt.dumps(pt, trim=True)
2788
2788
  'POINT (0 0)'
2789
2789
 
2790
+ .. _array-interface:
2791
+
2790
2792
  Numpy and Python Arrays
2791
2793
  -----------------------
2792
2794
 
@@ -0,0 +1,348 @@
1
+ .. _migration:
2
+
3
+ ==============================
4
+ Migrating to Shapely 1.8 / 2.0
5
+ ==============================
6
+
7
+ Shapely 1.8.0 is a transitional version introducing several warnings in
8
+ preparation of the upcoming changes in 2.0.0.
9
+
10
+ Shapely 2.0.0 will be a major release with a refactor of the internals with
11
+ considerable performance improvements (based on the developments in the
12
+ `PyGEOS <https://github.com/pygeos/pygeos>`__ package), along with several
13
+ breaking changes.
14
+
15
+ This guide gives an overview of the most important changes with details
16
+ on what will change in 2.0.0, how we warn for this in 1.8.0, and how
17
+ you can update your code to be future-proof.
18
+
19
+ For more background, see
20
+ `RFC 1: Roadmap for Shapely 2.0 <https://github.com/shapely/shapely-rfc/pull/1>`__.
21
+
22
+ .. contents:: Table of Contents
23
+ :backlinks: none
24
+ :local:
25
+
26
+
27
+ Geometry objects will become immutable
28
+ ======================================
29
+
30
+ Geometry objects will become immutable in version 2.0.0.
31
+
32
+ In Shapely 1.x, some of the geometry classes are mutable, meaning that you
33
+ can change their coordinates in-place. Illustrative code::
34
+
35
+ >>> from shapely.geometry import LineString
36
+ >>> line = LineString([(0,0), (2, 2)])
37
+ >>> print(line)
38
+ LINESTRING (0 0, 2 2)
39
+
40
+ >>> line.coords = [(0, 0), (10, 0), (10, 10)]
41
+ >>> print(line)
42
+ LINESTRING (0 0, 10 0, 10 10)
43
+
44
+ In Shapely 1.8, this will start raising a warning::
45
+
46
+ >>> line.coords = [(0, 0), (10, 0), (10, 10)]
47
+ ShapelyDeprecationWarning: Setting the 'coords' to mutate a Geometry
48
+ in place is deprecated, and will not be possible any more in Shapely 2.0
49
+
50
+ and starting with version 2.0.0, all geometry objects will become immutable.
51
+ As a consequence, they will also become hashable and therefore usable as, for
52
+ example, dictionary keys.
53
+
54
+ **How do I update my code?** There is no direct alternative for mutating the
55
+ coordinates of an existing geometry, except for creating a new geometry
56
+ object with the new coordinates.
57
+
58
+
59
+ Setting custom attributes
60
+ -------------------------
61
+
62
+ Another consequence of the geometry objects becoming immutable is that
63
+ assigning custom attributes, which currently works, will no longer be possible.
64
+
65
+ Currently you can do::
66
+
67
+ >>> line.name = "my_geometry"
68
+ >>> line.name
69
+ 'my_geometry'
70
+
71
+ In Shapely 1.8, this will start raising a warning, and will raise an
72
+ AttributeError in Shapely 2.0.
73
+
74
+ **How do I update my code?** There is no direct alternative for adding custom
75
+ attributes to geometry objects. You can use other Python data structures such as
76
+ (GeoJSON-like) dictionaries or GeoPandas' GeoDataFrames to store attributes
77
+ alongside geometry features.
78
+
79
+ Multi-part geometries will no longer be "sequences" (length, iterable, indexable)
80
+ =================================================================================
81
+
82
+ In Shapely 1.x, multi-part geometries (MultiPoint, MultiLineString,
83
+ MultiPolygon and GeometryCollection) implement a part of the "sequence"
84
+ python interface (making them list-like). This means you can iterate through
85
+ the object to get the parts, index into the object to get a specific part,
86
+ and ask for the number of parts with the ``len()`` method.
87
+
88
+ Some examples of this with Shapely 1.x:
89
+
90
+ >>> from shapely.geometry import Point, MultiPoint
91
+ >>> mp = MultiPoint([(1, 1), (2, 2), (3, 3)])
92
+ >>> print(mp)
93
+ MULTIPOINT (1 1, 2 2, 3 3)
94
+ >>> for part in mp:
95
+ ... print(part)
96
+ POINT (1 1)
97
+ POINT (2 2)
98
+ POINT (3 3)
99
+ >>> print(mp[1])
100
+ POINT (2 2)
101
+ >>> len(mp)
102
+ 3
103
+ >>> list(mp)
104
+ [<shapely.geometry.point.Point at 0x7f2e0912bf10>,
105
+ <shapely.geometry.point.Point at 0x7f2e09fed820>,
106
+ <shapely.geometry.point.Point at 0x7f2e09fed4c0>]
107
+
108
+ Starting with Shapely 1.8, all the examples above will start raising a
109
+ deprecation warning. For example:
110
+
111
+ >>> for part in mp:
112
+ ... print(part)
113
+ ShapelyDeprecationWarning: Iteration over multi-part geometries is deprecated
114
+ and will be removed in Shapely 2.0. Use the `geoms` property to access the
115
+ constituent parts of a multi-part geometry.
116
+ POINT (1 1)
117
+ POINT (2 2)
118
+ POINT (3 3)
119
+
120
+ In Shapely 2.0, all those examples will raise an error.
121
+
122
+ **How do I update my code?** To access the geometry parts of a multi-part
123
+ geometry, you can use the ``.geoms`` attribute, as the warning indicates.
124
+
125
+ The examples above can be updated to::
126
+
127
+ >>> for part in mp.geoms:
128
+ ... print(part)
129
+ POINT (1 1)
130
+ POINT (2 2)
131
+ POINT (3 3)
132
+ >>> print(mp.geoms[1])
133
+ POINT (2 2)
134
+ >>> len(mp.geoms)
135
+ 3
136
+ >>> list(mp.geoms)
137
+ [<shapely.geometry.point.Point at 0x7f2e0912bf10>,
138
+ <shapely.geometry.point.Point at 0x7f2e09fed820>,
139
+ <shapely.geometry.point.Point at 0x7f2e09fed4c0>]
140
+
141
+ The single-part geometries (Point, LineString, Polygon) already didn't
142
+ support those features, and for those classes there is no change in behaviour
143
+ for this aspect.
144
+
145
+
146
+ Interopability with NumPy and the array interface
147
+ =================================================
148
+
149
+ Conversion of the coordinates to (NumPy) arrays
150
+ -----------------------------------------------
151
+
152
+ Shapely provides an array interface to have easy access to the coordinates as,
153
+ for example, NumPy arrays (:ref:`manual section <array-interface>`).
154
+
155
+ A small example::
156
+
157
+ >>> line = LineString([(0, 0), (1, 1), (2, 2)])
158
+ >>> import numpy as np
159
+ >>> np.asarray(line)
160
+ array([[0., 0.],
161
+ [1., 1.],
162
+ [2., 2.]])
163
+
164
+ In addition, there are also the explicit ``array_interface()`` method and
165
+ ``ctypes`` attribute to get access to the coordinates as array data:
166
+
167
+ >>> line.ctypes
168
+ <shapely.geometry.linestring.c_double_Array_6 at 0x7f75261eb740>
169
+ >>> line.array_interface()
170
+ {'version': 3,
171
+ 'typestr': '<f8',
172
+ 'data': <shapely.geometry.linestring.c_double_Array_6 at 0x7f752664ae40>,
173
+ 'shape': (3, 2)}
174
+
175
+ This functionality is available for Point, LineString, LinearRing and MultiPoint.
176
+
177
+ For more robust interoperability with NumPy, this array interface will be removed
178
+ from those geometry classes, and limited to the ``coords``.
179
+
180
+ Starting with Shapely 1.8, converting a geometry object to a NumPy array
181
+ directly will start raising a warning::
182
+
183
+ >>> np.asarray(line)
184
+ ShapelyDeprecationWarning: The array interface is deprecated and will no longer
185
+ work in Shapely 2.0. Convert the '.coords' to a NumPy array instead.
186
+ array([[0., 0.],
187
+ [1., 1.],
188
+ [2., 2.]])
189
+
190
+ **How do I update my code?** To convert a geometry to a NumPy array, you can
191
+ convert the ``.coords`` attribute instead::
192
+
193
+ >>> line.coords
194
+ <shapely.coords.CoordinateSequence at 0x7f2e09e88d60>
195
+ >>> np.array(line.coords)
196
+ array([[0., 0.],
197
+ [1., 1.],
198
+ [2., 2.]])
199
+
200
+ The ``array_interface()`` method and ``ctypes`` attribute will be removed in
201
+ Shapely 2.0, but since Shapely will start requiring NumPy as a dependency,
202
+ you can use NumPy or its array interface directly. Check the NumPy docs on
203
+ the :py:attr:`ctypes <numpy:numpy.ndarray.ctypes>` attribute
204
+ or the :ref:`array interface <numpy:arrays.interface>` for more details.
205
+
206
+ Creating NumPy arrays of geometry objects
207
+ -----------------------------------------
208
+
209
+ Shapely geometry objects can be stored in NumPy arrays using the ``object``
210
+ dtype. In general, one could create such an array from a list of geometries
211
+ as follows::
212
+
213
+ >>> from shapely.geometry import Point
214
+ >>> arr = np.array([Point(0, 0), Point(1, 1), Point(2, 2)])
215
+ >>> arr
216
+ array([<shapely.geometry.point.Point object at 0x7fb798407cd0>,
217
+ <shapely.geometry.point.Point object at 0x7fb7982831c0>,
218
+ <shapely.geometry.point.Point object at 0x7fb798283b80>],
219
+ dtype=object)
220
+
221
+ The above works for point geometries, but because in Shapely 1.x, some
222
+ geometry types are sequence-like (see above), NumPy can try to "unpack" them
223
+ when creating an array. Therefore, for more robust creation of a NumPy array
224
+ from a list of geometries, it's generally recommended to this in a two-step
225
+ way (first creating an empty array and then filling it)::
226
+
227
+ geoms = [Point(0, 0), Point(1, 1), Point(2, 2)]
228
+ arr = np.empty(len(geoms), dtype="object")
229
+ arr[:] = geoms
230
+
231
+ This code snippet results in the same array as the example above, and works
232
+ for all geometry types and Shapely/NumPy versions.
233
+
234
+ However, starting with Shapely 1.8, the above code will show deprecation
235
+ warnings that cannot be avoided (depending on the geometry type, NumPy tries
236
+ to access the array interface of the objects or check if an object is
237
+ iterable or has a length, and those operations are all deprecated now. The
238
+ end result is still correct, but the warnings appear nonetheless).
239
+ Specifically in this case, it is fine to ignore those warnings (and the only
240
+ way to make them go away)::
241
+
242
+ import warnings
243
+ from shapely.errors import ShapelyDeprecationWarning
244
+
245
+ geoms = [Point(0, 0), Point(1, 1), Point(2, 2)]
246
+ arr = np.empty(len(geoms), dtype="object")
247
+
248
+ with warnings.catch_warnings():
249
+ warnings.filterwarnings("ignore", category=ShapelyDeprecationWarning)
250
+ arr[:] = geoms
251
+
252
+ In Shapely 2.0, the geometry objects will no longer be sequence like and
253
+ those deprecation warnings will be removed (and thus the ``filterwarnings``
254
+ will no longer be necessary), and creation of NumPy arrays will generally be
255
+ more robust.
256
+
257
+ If you maintain code that depends on Shapely, and you want to have it work
258
+ with multiple versions of Shapely, the above code snippet provides a context
259
+ manager that can be copied into your project::
260
+
261
+ import contextlib
262
+ import shapely
263
+ import warnings
264
+ from distutils.version import LooseVersion
265
+
266
+ SHAPELY_GE_20 = str(shapely.__version__) >= LooseVersion("2.0")
267
+
268
+ try:
269
+ from shapely.errors import ShapelyDeprecationWarning as shapely_warning
270
+ except ImportError:
271
+ shapely_warning = None
272
+
273
+ if shapely_warning is not None and not SHAPELY_GE_20:
274
+ @contextlib.contextmanager
275
+ def ignore_shapely2_warnings():
276
+ with warnings.catch_warnings():
277
+ warnings.filterwarnings("ignore", category=shapely_warning)
278
+ yield
279
+ else:
280
+ @contextlib.contextmanager
281
+ def ignore_shapely2_warnings():
282
+ yield
283
+
284
+ This can then be used when creating NumPy arrays (be careful to *only* use it
285
+ for this specific purpose, and not generally suppress those warnings)::
286
+
287
+ geoms = [...]
288
+ arr = np.empty(len(geoms), dtype="object")
289
+ with ignore_shapely2_warnings():
290
+ arr[:] = geoms
291
+
292
+
293
+ Consistent creation of empty geometries
294
+ =======================================
295
+
296
+ Shapely 1.x is inconsistent in creating empty geometries between various
297
+ creation methods. A small example for an empty Polygon geometry:
298
+
299
+ .. code-block:: python
300
+
301
+ # Using an empty constructor results in a GeometryCollection
302
+ >>> from shapely.geometry import Polygon
303
+ >>> g1 = Polygon()
304
+ >>> type(g1)
305
+ <class 'shapely.geometry.polygon.Polygon'>
306
+ >>> g1.wkt
307
+ GEOMETRYCOLLECTION EMPTY
308
+
309
+ # Converting from WKT gives a correct empty polygon
310
+ >>> from shapely import wkt
311
+ >>> g2 = wkt.loads("POLYGON EMPTY")
312
+ >>> type(g2)
313
+ <class 'shapely.geometry.polygon.Polygon'>
314
+ >>> g2.wkt
315
+ POLYGON EMPTY
316
+
317
+ Shapely 1.8 does not yet change this inconsistent behaviour, but starting
318
+ with Shapely 2.0, the different methods will always consistently give an
319
+ empty geometry object of the correct type, instead of using an empty
320
+ GeometryCollection as "generic" empty geometry object.
321
+
322
+ **How do I update my code?** Those cases that will change don't raise a
323
+ warning, but you will need to update your code if you rely on the fact that
324
+ empty geometry objects are of the GeometryCollection type. Use the
325
+ ``.is_empty`` attribute for robustly checking if a geometry object is an
326
+ empty geometry.
327
+
328
+ In addition, the WKB serialization methods will start supporting empty
329
+ Points (using ``"POINT (NaN NaN)"`` to represent an empty point).
330
+
331
+
332
+ Other deprecated functionality
333
+ ==============================
334
+
335
+ There are some other various functions and methods deprecated in Shapely 1.8
336
+ as well:
337
+
338
+ - The adapters to create geometry-like proxy objects with coordinates stored
339
+ outside Shapely geometries are deprecated and will be removed in Shapely
340
+ 2.0 (e.g. created using ``asShape()``). They have little to no benefit
341
+ compared to the normal geometry classes, as thus you can convert to your
342
+ data to a normal geometry object instead. Use the ``shape()`` function
343
+ instead to convert a GeoJSON-like dict to a Shapely geometry.
344
+
345
+ - The ``empty()`` method on a geometry object is deprecated.
346
+
347
+ - The ``shapely.ops.cascaded_union`` function is deprecated. Use
348
+ ``shapely.ops.unary_union`` instead, which internally already uses a cascaded union operation for better performance.
@@ -0,0 +1 @@
1
+ __version__ = "1.8rc1"
@@ -181,8 +181,10 @@ elif sys.platform == 'darwin':
181
181
  "/Library/Frameworks/GEOS.framework/Versions/Current/GEOS",
182
182
  # macports
183
183
  '/opt/local/lib/libgeos_c.dylib',
184
- # homebrew
184
+ # homebrew Intel
185
185
  '/usr/local/lib/libgeos_c.dylib',
186
+ # homebrew Apple Silicon
187
+ '/opt/homebrew/lib/libgeos_c.dylib',
186
188
  ]
187
189
  lgeos = load_dll('geos_c', fallbacks=alt_paths)
188
190
 
@@ -116,7 +116,10 @@ class CoordinateSequence:
116
116
  def _ctypes(self):
117
117
  self._update()
118
118
  has_z = self._ndim == 3
119
- n = self._ndim
119
+ n = self._ndim or 0
120
+ if n == 0:
121
+ # ignore with NumPy 1.21 __array_interface__
122
+ raise AttributeError("empty geometry sequence")
120
123
  m = self.__len__()
121
124
  array_type = c_double * (m * n)
122
125
  data = array_type()