shapely 2.1.1__tar.gz → 2.2.0rc1__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 (286) hide show
  1. {shapely-2.1.1 → shapely-2.2.0rc1}/CHANGES.txt +23 -0
  2. shapely-2.2.0rc1/CODE_OF_CONDUCT.md +22 -0
  3. shapely-2.2.0rc1/CONTRIBUTING.md +17 -0
  4. {shapely-2.1.1 → shapely-2.2.0rc1}/PKG-INFO +21 -26
  5. {shapely-2.1.1 → shapely-2.2.0rc1}/README.rst +11 -5
  6. shapely-2.2.0rc1/_version.py +4 -0
  7. shapely-2.2.0rc1/docs/Makefile +89 -0
  8. shapely-2.2.0rc1/docs/_templates/autosummary/class.rst +7 -0
  9. shapely-2.2.0rc1/docs/code/buffer.py +35 -0
  10. shapely-2.2.0rc1/docs/code/buffer_single_side.py +35 -0
  11. shapely-2.2.0rc1/docs/code/convex_hull.py +35 -0
  12. shapely-2.2.0rc1/docs/code/coverage_simplify.py +53 -0
  13. shapely-2.2.0rc1/docs/code/difference.py +38 -0
  14. shapely-2.2.0rc1/docs/code/figures.py +30 -0
  15. shapely-2.2.0rc1/docs/code/geometrycollection.py +39 -0
  16. shapely-2.2.0rc1/docs/code/intersection-sym-difference.py +38 -0
  17. shapely-2.2.0rc1/docs/code/linearring.py +31 -0
  18. shapely-2.2.0rc1/docs/code/linestring.py +33 -0
  19. shapely-2.2.0rc1/docs/code/make_valid_geometrycollection.py +28 -0
  20. shapely-2.2.0rc1/docs/code/make_valid_methods.py +57 -0
  21. shapely-2.2.0rc1/docs/code/make_valid_multipolygon.py +27 -0
  22. shapely-2.2.0rc1/docs/code/minimum_rotated_rectangle.py +33 -0
  23. shapely-2.2.0rc1/docs/code/multilinestring.py +36 -0
  24. shapely-2.2.0rc1/docs/code/multipolygon.py +39 -0
  25. shapely-2.2.0rc1/docs/code/parallel_offset.py +58 -0
  26. shapely-2.2.0rc1/docs/code/parallel_offset_mitre.py +58 -0
  27. shapely-2.2.0rc1/docs/code/polygon.py +36 -0
  28. shapely-2.2.0rc1/docs/code/polygon2.py +37 -0
  29. shapely-2.2.0rc1/docs/code/rotate.py +34 -0
  30. shapely-2.2.0rc1/docs/code/scale.py +38 -0
  31. shapely-2.2.0rc1/docs/code/simplify.py +35 -0
  32. shapely-2.2.0rc1/docs/code/skew.py +51 -0
  33. shapely-2.2.0rc1/docs/code/triangulate.py +22 -0
  34. shapely-2.2.0rc1/docs/code/unary_union.py +32 -0
  35. shapely-2.2.0rc1/docs/code/union.py +38 -0
  36. shapely-2.2.0rc1/docs/code/voronoi_diagram.py +22 -0
  37. shapely-2.2.0rc1/docs/conf.py +143 -0
  38. shapely-2.2.0rc1/docs/environment.yml +16 -0
  39. shapely-2.2.0rc1/docs/faq.rst +42 -0
  40. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/index.rst +1 -2
  41. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/installation.rst +93 -40
  42. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/manual.rst +45 -13
  43. shapely-2.2.0rc1/docs/release/1.x.rst +927 -0
  44. shapely-2.2.0rc1/docs/release/2.x.rst +1009 -0
  45. shapely-2.2.0rc1/generate_version.py +79 -0
  46. shapely-2.2.0rc1/meson.build +151 -0
  47. {shapely-2.1.1 → shapely-2.2.0rc1}/pyproject.toml +53 -42
  48. shapely-2.2.0rc1/setup.cfg +7 -0
  49. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/__init__.py +21 -3
  50. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/_coverage.py +112 -5
  51. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/_enum.py +9 -0
  52. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/_geometry.py +131 -37
  53. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/_geometry_helpers.pyx +1 -1
  54. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/_geos.pxd +0 -1
  55. shapely-2.2.0rc1/src/shapely/_geos.pyx +23 -0
  56. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/_pygeos_api.pxd +2 -0
  57. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/_ragged_array.py +2 -2
  58. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/affinity.py +1 -1
  59. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/algorithms/_oriented_envelope.py +1 -1
  60. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/algorithms/cga.py +1 -1
  61. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/algorithms/polylabel.py +2 -2
  62. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/constructive.py +114 -52
  63. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/coordinates.py +134 -6
  64. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/coords.py +1 -1
  65. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/creation.py +58 -35
  66. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/decorators.py +12 -1
  67. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/errors.py +3 -3
  68. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/geometry/base.py +157 -43
  69. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/geometry/collection.py +6 -1
  70. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/geometry/geo.py +11 -0
  71. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/geometry/linestring.py +6 -1
  72. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/geometry/multilinestring.py +6 -1
  73. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/geometry/multipoint.py +6 -1
  74. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/geometry/multipolygon.py +12 -2
  75. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/geometry/point.py +11 -6
  76. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/geometry/polygon.py +30 -11
  77. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/io.py +12 -7
  78. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/c_api.c +8 -0
  79. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/c_api.h +19 -1
  80. shapely-2.2.0rc1/src/shapely/lib/geom_arr.c +38 -0
  81. shapely-2.2.0rc1/src/shapely/lib/geom_arr.h +14 -0
  82. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/geos.c +76 -40
  83. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/geos.h +78 -53
  84. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_O_b.c +284 -0
  85. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_O_b.h +6 -0
  86. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_YYO_b.c +201 -0
  87. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_YYO_b.h +8 -0
  88. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_YY_O.c +155 -0
  89. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_YY_O.h +8 -0
  90. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_YY_Y.c +334 -0
  91. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_YY_Y.h +8 -0
  92. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_YY_b.c +304 -0
  93. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_YY_b.h +8 -0
  94. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_YY_d.c +292 -0
  95. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_YY_d.h +8 -0
  96. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_YYd_Y.c +269 -0
  97. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_YYd_Y.h +8 -0
  98. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_YYd_b.c +269 -0
  99. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_YYd_b.h +8 -0
  100. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_YYd_d.c +265 -0
  101. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_YYd_d.h +8 -0
  102. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Y_O.c +151 -0
  103. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Y_O.h +8 -0
  104. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Y_Y.c +370 -0
  105. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Y_Y.h +8 -0
  106. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Y_b.c +315 -0
  107. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Y_b.h +8 -0
  108. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Y_d.c +340 -0
  109. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Y_d.h +8 -0
  110. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Y_i.c +285 -0
  111. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Y_i.h +8 -0
  112. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Yd_Y.c +369 -0
  113. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Yd_Y.h +8 -0
  114. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Ydb_Y.c +346 -0
  115. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Ydb_Y.h +8 -0
  116. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Ydd_b.c +291 -0
  117. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Ydd_b.h +8 -0
  118. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Ydddd_Y.c +246 -0
  119. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Ydddd_Y.h +8 -0
  120. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Ydi_Y.c +279 -0
  121. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Ydi_Y.h +8 -0
  122. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Yi_Y.c +405 -0
  123. shapely-2.2.0rc1/src/shapely/lib/geos_funcs_Yi_Y.h +8 -0
  124. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/lib.c +103 -1
  125. shapely-2.2.0rc1/src/shapely/lib/meson.build +39 -0
  126. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/pygeom.c +35 -3
  127. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/pygeom.h +4 -2
  128. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/pygeos.c +0 -6
  129. shapely-2.2.0rc1/src/shapely/lib/signal_checks.c +17 -0
  130. shapely-2.2.0rc1/src/shapely/lib/signal_checks.h +53 -0
  131. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/strtree.c +0 -6
  132. shapely-2.2.0rc1/src/shapely/lib/ufuncs.c +1997 -0
  133. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/linear.py +4 -7
  134. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/measurement.py +9 -14
  135. shapely-2.2.0rc1/src/shapely/meson.build +68 -0
  136. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/ops.py +74 -82
  137. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/predicates.py +90 -49
  138. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/set_operations.py +3 -12
  139. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/strtree.py +0 -8
  140. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/testing.py +1 -1
  141. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/common.py +2 -4
  142. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/geometry/test_collection.py +1 -6
  143. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/geometry/test_decimal.py +1 -1
  144. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/geometry/test_equality.py +1 -12
  145. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/geometry/test_format.py +11 -31
  146. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/geometry/test_geometry_base.py +87 -25
  147. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/geometry/test_multipoint.py +8 -4
  148. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/geometry/test_multipolygon.py +34 -1
  149. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/geometry/test_polygon.py +13 -6
  150. shapely-2.2.0rc1/src/shapely/tests/legacy/data/emptypoint_1.8.5.post1.pickle +0 -0
  151. shapely-2.2.0rc1/src/shapely/tests/legacy/data/emptypolygon_1.8.5.post1.pickle +0 -0
  152. shapely-2.2.0rc1/src/shapely/tests/legacy/data/geometrycollection_1.8.5.post1.pickle +0 -0
  153. shapely-2.2.0rc1/src/shapely/tests/legacy/data/linearring_1.8.5.post1.pickle +0 -0
  154. shapely-2.2.0rc1/src/shapely/tests/legacy/data/linestring_1.8.5.post1.pickle +0 -0
  155. shapely-2.2.0rc1/src/shapely/tests/legacy/data/multilinestring_1.8.5.post1.pickle +0 -0
  156. shapely-2.2.0rc1/src/shapely/tests/legacy/data/multipoint_1.8.5.post1.pickle +0 -0
  157. shapely-2.2.0rc1/src/shapely/tests/legacy/data/multipolygon_1.8.5.post1.pickle +0 -0
  158. shapely-2.2.0rc1/src/shapely/tests/legacy/data/point2d_1.8.5.post1.pickle +0 -0
  159. shapely-2.2.0rc1/src/shapely/tests/legacy/data/point3d_1.8.5.post1.pickle +0 -0
  160. shapely-2.2.0rc1/src/shapely/tests/legacy/data/polygon_1.8.5.post1.pickle +0 -0
  161. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_affinity.py +13 -13
  162. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_locale.py +5 -7
  163. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_pickle.py +2 -2
  164. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_split.py +57 -11
  165. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_svg.py +1 -1
  166. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_transform.py +46 -10
  167. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_union.py +4 -3
  168. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_wkb.py +8 -13
  169. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_wkt.py +4 -4
  170. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/test_constructive.py +536 -57
  171. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/test_coordinates.py +85 -19
  172. shapely-2.2.0rc1/src/shapely/tests/test_coverage.py +520 -0
  173. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/test_creation.py +38 -9
  174. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/test_creation_indices.py +2 -2
  175. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/test_geometry.py +163 -57
  176. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/test_io.py +12 -16
  177. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/test_linear.py +24 -11
  178. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/test_measurement.py +40 -16
  179. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/test_misc.py +49 -14
  180. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/test_predicates.py +87 -11
  181. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/test_ragged_array.py +6 -4
  182. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/test_set_operations.py +37 -11
  183. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/test_strtree.py +16 -30
  184. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/test_testing.py +2 -2
  185. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/wkb.py +1 -1
  186. shapely-2.1.1/setup.cfg +0 -16
  187. shapely-2.1.1/setup.py +0 -204
  188. shapely-2.1.1/shapely/_geos.pyx +0 -45
  189. shapely-2.1.1/shapely/_version.py +0 -21
  190. shapely-2.1.1/shapely/tests/test_coverage.py +0 -249
  191. shapely-2.1.1/shapely.egg-info/PKG-INFO +0 -205
  192. shapely-2.1.1/shapely.egg-info/SOURCES.txt +0 -184
  193. shapely-2.1.1/shapely.egg-info/dependency_links.txt +0 -1
  194. shapely-2.1.1/shapely.egg-info/requires.txt +0 -13
  195. shapely-2.1.1/shapely.egg-info/top_level.txt +0 -1
  196. shapely-2.1.1/src/ufuncs.c +0 -4113
  197. {shapely-2.1.1 → shapely-2.2.0rc1}/CITATION.cff +0 -0
  198. {shapely-2.1.1 → shapely-2.2.0rc1}/CREDITS.txt +0 -0
  199. {shapely-2.1.1 → shapely-2.2.0rc1}/LICENSE.txt +0 -0
  200. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/constructive.rst +0 -0
  201. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/coordinates.rst +0 -0
  202. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/coverage.rst +0 -0
  203. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/creation.rst +0 -0
  204. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/design.rst +0 -0
  205. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/geometry.rst +0 -0
  206. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/io.rst +0 -0
  207. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/linear.rst +0 -0
  208. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/measurement.rst +0 -0
  209. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/migration.rst +0 -0
  210. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/migration_pygeos.rst +0 -0
  211. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/plotting.rst +0 -0
  212. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/predicates.rst +0 -0
  213. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/properties.rst +0 -0
  214. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/release.rst +0 -0
  215. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/set_operations.rst +0 -0
  216. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/strtree.rst +0 -0
  217. {shapely-2.1.1 → shapely-2.2.0rc1}/docs/testing.rst +0 -0
  218. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/algorithms/__init__.py +0 -0
  219. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/conftest.py +0 -0
  220. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/geometry/__init__.py +0 -0
  221. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/geos.py +0 -0
  222. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/coords.c +0 -0
  223. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/coords.h +0 -0
  224. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/fast_loop_macros.h +0 -0
  225. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/kvec.h +0 -0
  226. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/pygeos.h +0 -0
  227. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/strtree.h +0 -0
  228. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/ufuncs.h +0 -0
  229. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/vector.c +0 -0
  230. {shapely-2.1.1/src → shapely-2.2.0rc1/src/shapely/lib}/vector.h +0 -0
  231. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/plotting.py +0 -0
  232. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/prepared.py +0 -0
  233. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/speedups.py +0 -0
  234. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/__init__.py +0 -0
  235. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/geometry/__init__.py +0 -0
  236. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/geometry/test_coords.py +0 -0
  237. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/geometry/test_emptiness.py +0 -0
  238. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/geometry/test_hash.py +0 -0
  239. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/geometry/test_linestring.py +0 -0
  240. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/geometry/test_multi.py +0 -0
  241. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/geometry/test_multilinestring.py +0 -0
  242. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/geometry/test_point.py +0 -0
  243. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/__init__.py +0 -0
  244. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/conftest.py +0 -0
  245. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_box.py +0 -0
  246. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_buffer.py +0 -0
  247. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_cga.py +0 -0
  248. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_clip_by_rect.py +0 -0
  249. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_create_inconsistent_dimensionality.py +0 -0
  250. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_delaunay.py +0 -0
  251. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_empty_polygons.py +0 -0
  252. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_equality.py +0 -0
  253. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_geointerface.py +0 -0
  254. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_invalid_geometries.py +0 -0
  255. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_linear_referencing.py +0 -0
  256. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_linemerge.py +0 -0
  257. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_make_valid.py +0 -0
  258. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_mapping.py +0 -0
  259. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_minimum_clearance.py +0 -0
  260. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_ndarrays.py +0 -0
  261. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_nearest.py +0 -0
  262. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_operations.py +0 -0
  263. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_operators.py +0 -0
  264. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_orient.py +0 -0
  265. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_parallel_offset.py +0 -0
  266. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_persist.py +0 -0
  267. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_polygonize.py +0 -0
  268. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_polylabel.py +0 -0
  269. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_predicates.py +0 -0
  270. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_prepared.py +0 -0
  271. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_products_z.py +0 -0
  272. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_shape.py +0 -0
  273. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_shared_paths.py +0 -0
  274. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_singularity.py +0 -0
  275. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_snap.py +0 -0
  276. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_substring.py +0 -0
  277. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_validation.py +0 -0
  278. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_vectorized.py +0 -0
  279. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/test_voronoi_diagram.py +0 -0
  280. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/legacy/threading_test.py +0 -0
  281. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/test_decorators.py +0 -0
  282. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/tests/test_plotting.py +0 -0
  283. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/validation.py +0 -0
  284. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/vectorized/__init__.py +0 -0
  285. {shapely-2.1.1 → shapely-2.2.0rc1/src}/shapely/wkt.py +0 -0
  286. {shapely-2.1.1 → shapely-2.2.0rc1}/versioneer.py +0 -0
@@ -1,6 +1,29 @@
1
1
  Changes
2
2
  =======
3
3
 
4
+ 2.2.0 (unreleased)
5
+ ------------------
6
+
7
+ Shapely 2.2.0 is a feature release with various new functions,
8
+ improvements and bug fixes. Highlights include performance improvements for
9
+ scalar attribute and method calls, and the new ``minimum_width``,
10
+ ``coverage_clean``, ``split``, ``transform_coordseq``, and ``get_segments``
11
+ top-level functions.
12
+
13
+ Shapely 2.2 supports Python >= 3.11, and binary wheels on PyPI include GEOS 3.14
14
+ and are now also provided for the Windows ARM64 platform.
15
+ Wheels are available for Python 3.15.
16
+
17
+ For a full changelog, see
18
+ https://shapely.readthedocs.io/en/latest/release/2.x.html#version-2-2-0
19
+
20
+
21
+ 2.1.2 (2025-09-24)
22
+ ------------------
23
+
24
+ Wheels are available for Python 3.14 (and still include GEOS 3.13.1).
25
+
26
+
4
27
  2.1.1 (2025-05-19)
5
28
  ------------------
6
29
 
@@ -0,0 +1,22 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
6
+
7
+ Examples of unacceptable behavior by participants include:
8
+
9
+ * The use of sexualized language or imagery
10
+ * Personal attacks
11
+ * Trolling or insulting/derogatory comments
12
+ * Public or private harassment
13
+ * Publishing other's private information, such as physical or electronic addresses, without explicit permission
14
+ * Other unethical or unprofessional conduct.
15
+
16
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
17
+
18
+ This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
19
+
20
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
21
+
22
+ This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org), version 1.2.0, available at [https://contributor-covenant.org/version/1/2/0/](https://contributor-covenant.org/version/1/2/0/)
@@ -0,0 +1,17 @@
1
+ Contributing to Shapely
2
+ =======================
3
+
4
+ All contributions are subject to the [Code of
5
+ Conduct](https://github.com/shapely/shapely/blob/main/CODE_OF_CONDUCT.md).
6
+
7
+ If you spot a bug or have an idea for a feature, please [create an
8
+ issue](https://github.com/shapely/shapely/issues). For simple fixes or
9
+ features, you can [create a pull
10
+ request](https://github.com/shapely/shapely/pulls), but it is a good idea to
11
+ have discussion on an issue before sinking a lot of time into a pull request.
12
+
13
+ Shapely is a mature project and its primary needs are bug fixes and
14
+ documentation. New features and major refactoring will be welcomed cautiously
15
+ and slowly because the work of maintaining a new feature over the lifetime of
16
+ the project can be several times larger than the work of the initial
17
+ contribution. Please open a discussion about such work before starting.
@@ -1,41 +1,30 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shapely
3
- Version: 2.1.1
3
+ Version: 2.2.0rc1
4
4
  Summary: Manipulation and analysis of geometric objects
5
+ Keywords: geometry,topology,gis
5
6
  Author: Sean Gillies
6
7
  Maintainer: Shapely contributors
7
- License: BSD 3-Clause
8
- Project-URL: Documentation, https://shapely.readthedocs.io/
9
- Project-URL: Repository, https://github.com/shapely/shapely
10
- Keywords: geometry,topology,gis
8
+ License-Expression: BSD-3-Clause
9
+ License-File: LICENSE.txt
11
10
  Classifier: Development Status :: 5 - Production/Stable
12
11
  Classifier: Intended Audience :: Developers
13
12
  Classifier: Intended Audience :: Science/Research
14
- Classifier: License :: OSI Approved :: BSD License
15
13
  Classifier: Operating System :: Unix
16
14
  Classifier: Operating System :: MacOS
17
15
  Classifier: Operating System :: Microsoft :: Windows
18
16
  Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.10
20
17
  Classifier: Programming Language :: Python :: 3.11
21
18
  Classifier: Programming Language :: Python :: 3.12
22
19
  Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Programming Language :: Python :: 3.15
23
22
  Classifier: Topic :: Scientific/Engineering :: GIS
24
- Requires-Python: >=3.10
23
+ Project-URL: Documentation, https://shapely.readthedocs.io/
24
+ Project-URL: Repository, https://github.com/shapely/shapely
25
+ Requires-Python: >=3.11
26
+ Requires-Dist: numpy>=1.26
25
27
  Description-Content-Type: text/x-rst
26
- License-File: LICENSE.txt
27
- Requires-Dist: numpy>=1.21
28
- Provides-Extra: test
29
- Requires-Dist: pytest; extra == "test"
30
- Requires-Dist: pytest-cov; extra == "test"
31
- Requires-Dist: scipy-doctest; extra == "test"
32
- Provides-Extra: docs
33
- Requires-Dist: numpydoc==1.1.*; extra == "docs"
34
- Requires-Dist: matplotlib; extra == "docs"
35
- Requires-Dist: sphinx; extra == "docs"
36
- Requires-Dist: sphinx-book-theme; extra == "docs"
37
- Requires-Dist: sphinx-remove-toctrees; extra == "docs"
38
- Dynamic: license-file
39
28
 
40
29
  =======
41
30
  Shapely
@@ -107,7 +96,13 @@ Shapely functions generally support multithreading by releasing the Global
107
96
  Interpreter Lock (GIL) during execution. Normally in Python, the GIL prevents
108
97
  multiple threads from computing at the same time. Shapely functions
109
98
  internally release this constraint so that the heavy lifting done by GEOS can
110
- be done in parallel, from a single Python process.
99
+ be done concurrently from a single Python process.
100
+
101
+ When sharing NumPy array of geometries between threads, extreme care
102
+ must be taken to avoid creating thread safety issues when mutating arrays. This
103
+ holds for any NumPy array, but even more so for arrays of Shapely geometries.
104
+ When overwriting a geometry in an array, the old geometry is deallocated. If at the
105
+ same time another thread operates on that geometry, interpreter crashes will occur.
111
106
 
112
107
  Usage
113
108
  =====
@@ -142,11 +137,11 @@ See the documentation for more examples and guidance: https://shapely.readthedoc
142
137
  Requirements
143
138
  ============
144
139
 
145
- Shapely 2.1 requires
140
+ Shapely 2.2 requires
146
141
 
147
- * Python >=3.10
148
- * GEOS >=3.9
149
- * NumPy >=1.21
142
+ * Python >=3.11
143
+ * GEOS >=3.10
144
+ * NumPy >=1.26
150
145
 
151
146
  Installing Shapely
152
147
  ==================
@@ -68,7 +68,13 @@ Shapely functions generally support multithreading by releasing the Global
68
68
  Interpreter Lock (GIL) during execution. Normally in Python, the GIL prevents
69
69
  multiple threads from computing at the same time. Shapely functions
70
70
  internally release this constraint so that the heavy lifting done by GEOS can
71
- be done in parallel, from a single Python process.
71
+ be done concurrently from a single Python process.
72
+
73
+ When sharing NumPy array of geometries between threads, extreme care
74
+ must be taken to avoid creating thread safety issues when mutating arrays. This
75
+ holds for any NumPy array, but even more so for arrays of Shapely geometries.
76
+ When overwriting a geometry in an array, the old geometry is deallocated. If at the
77
+ same time another thread operates on that geometry, interpreter crashes will occur.
72
78
 
73
79
  Usage
74
80
  =====
@@ -103,11 +109,11 @@ See the documentation for more examples and guidance: https://shapely.readthedoc
103
109
  Requirements
104
110
  ============
105
111
 
106
- Shapely 2.1 requires
112
+ Shapely 2.2 requires
107
113
 
108
- * Python >=3.10
109
- * GEOS >=3.9
110
- * NumPy >=1.21
114
+ * Python >=3.11
115
+ * GEOS >=3.10
116
+ * NumPy >=1.26
111
117
 
112
118
  Installing Shapely
113
119
  ==================
@@ -0,0 +1,4 @@
1
+ """Module to show version information for the installed package."""
2
+
3
+ __version__ = "2.2.0rc1"
4
+ __git_version__ = "4b1850b3292f681a91d3826c5ea9bd32bebe302f"
@@ -0,0 +1,89 @@
1
+ # Makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line.
5
+ SPHINXOPTS =
6
+ SPHINXBUILD = sphinx-build
7
+ PAPER =
8
+ BUILDDIR = _build
9
+
10
+ # Internal variables.
11
+ PAPEROPT_a4 = -D latex_paper_size=a4
12
+ PAPEROPT_letter = -D latex_paper_size=letter
13
+ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
14
+
15
+ .PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
16
+
17
+ help:
18
+ @echo "Please use \`make <target>' where <target> is one of"
19
+ @echo " html to make standalone HTML files"
20
+ @echo " dirhtml to make HTML files named index.html in directories"
21
+ @echo " pickle to make pickle files"
22
+ @echo " json to make JSON files"
23
+ @echo " htmlhelp to make HTML files and a HTML help project"
24
+ @echo " qthelp to make HTML files and a qthelp project"
25
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
26
+ @echo " changes to make an overview of all changed/added/deprecated items"
27
+ @echo " linkcheck to check all external links for integrity"
28
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
29
+
30
+ clean:
31
+ -rm -rf $(BUILDDIR)/* build/plot_directive/* reference/* _reference.rst
32
+
33
+ html:
34
+ $(SPHINXBUILD) -n -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
35
+ @echo
36
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
37
+
38
+ dirhtml:
39
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
40
+ @echo
41
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
42
+
43
+ pickle:
44
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
45
+ @echo
46
+ @echo "Build finished; now you can process the pickle files."
47
+
48
+ json:
49
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
50
+ @echo
51
+ @echo "Build finished; now you can process the JSON files."
52
+
53
+ htmlhelp:
54
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
55
+ @echo
56
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
57
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
58
+
59
+ qthelp:
60
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
61
+ @echo
62
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
63
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
64
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Shapely.qhcp"
65
+ @echo "To view the help file:"
66
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Shapely.qhc"
67
+
68
+ latex:
69
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
70
+ @echo
71
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
72
+ @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
73
+ "run these through (pdf)latex."
74
+
75
+ changes:
76
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
77
+ @echo
78
+ @echo "The overview file is in $(BUILDDIR)/changes."
79
+
80
+ linkcheck:
81
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
82
+ @echo
83
+ @echo "Link check complete; look for any errors in the above output " \
84
+ "or in $(BUILDDIR)/linkcheck/output.txt."
85
+
86
+ doctest:
87
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
88
+ @echo "Testing of doctests in the sources finished, look at the " \
89
+ "results in $(BUILDDIR)/doctest/output.txt."
@@ -0,0 +1,7 @@
1
+ {{ fullname | escape | underline}}
2
+
3
+ .. currentmodule:: {{ module }}
4
+
5
+ .. autoclass:: {{ objname }}
6
+ :members:
7
+ :inherited-members:
@@ -0,0 +1,35 @@
1
+ import matplotlib.pyplot as plt
2
+ from shapely.geometry import LineString
3
+ from shapely.plotting import plot_polygon, plot_line
4
+
5
+ from figures import SIZE, BLUE, GRAY, set_limits
6
+
7
+ line = LineString([(0, 0), (1, 1), (0, 2), (2, 2), (3, 1), (1, 0)])
8
+
9
+ fig = plt.figure(1, figsize=SIZE, dpi=90)
10
+
11
+ # 1
12
+ ax = fig.add_subplot(121)
13
+
14
+ plot_line(line, ax=ax, add_points=False, color=GRAY, linewidth=3)
15
+
16
+ dilated = line.buffer(0.5, cap_style=3)
17
+ plot_polygon(dilated, ax=ax, add_points=False, color=BLUE, alpha=0.5)
18
+
19
+ ax.set_title('a) dilation, cap_style=3')
20
+
21
+ set_limits(ax, -1, 4, -1, 3)
22
+
23
+ #2
24
+ ax = fig.add_subplot(122)
25
+
26
+ plot_polygon(dilated, ax=ax, add_points=False, color=GRAY, alpha=0.5)
27
+
28
+ eroded = dilated.buffer(-0.3)
29
+ plot_polygon(eroded, ax=ax, add_points=False, color=BLUE, alpha=0.5)
30
+
31
+ ax.set_title('b) erosion, join_style=1')
32
+
33
+ set_limits(ax, -1, 4, -1, 3)
34
+
35
+ plt.show()
@@ -0,0 +1,35 @@
1
+ import matplotlib.pyplot as plt
2
+ from shapely.geometry import LineString
3
+ from shapely.plotting import plot_polygon, plot_line
4
+
5
+ from figures import SIZE, BLUE, GRAY, set_limits
6
+
7
+ line = LineString([(0, 0), (1, 1), (0, 2), (2, 2), (3, 1), (1, 0)])
8
+
9
+ fig = plt.figure(1, figsize=SIZE, dpi=90)
10
+
11
+ # 1
12
+ ax = fig.add_subplot(121)
13
+
14
+ plot_line(line, ax=ax, add_points=False, color=GRAY, linewidth=3)
15
+
16
+ left_hand_side = line.buffer(0.5, single_sided=True)
17
+ plot_polygon(left_hand_side, ax=ax, add_points=False, color=BLUE, alpha=0.5)
18
+
19
+ ax.set_title('a) left hand buffer')
20
+
21
+ set_limits(ax, -1, 4, -1, 3)
22
+
23
+ #2
24
+ ax = fig.add_subplot(122)
25
+
26
+ plot_line(line, ax=ax, add_points=False, color=GRAY, linewidth=3)
27
+
28
+ right_hand_side = line.buffer(-0.3, single_sided=True)
29
+ plot_polygon(right_hand_side, ax=ax, add_points=False, color=GRAY, alpha=0.5)
30
+
31
+ ax.set_title('b) right hand buffer')
32
+
33
+ set_limits(ax, -1, 4, -1, 3)
34
+
35
+ plt.show()
@@ -0,0 +1,35 @@
1
+ import matplotlib.pyplot as plt
2
+ from shapely.geometry import MultiPoint
3
+ from shapely.plotting import plot_polygon, plot_line, plot_points
4
+
5
+ from figures import GRAY, BLUE, SIZE, set_limits
6
+
7
+ fig = plt.figure(1, figsize=SIZE, dpi=90)
8
+
9
+ # 1
10
+ ax = fig.add_subplot(121)
11
+
12
+ points2 = MultiPoint([(0, 0), (2, 2)])
13
+ plot_points(points2, ax=ax, color=GRAY)
14
+
15
+ hull2 = points2.convex_hull
16
+ plot_line(hull2, ax=ax, add_points=False, color=BLUE, zorder=3)
17
+
18
+ ax.set_title('a) N = 2')
19
+
20
+ set_limits(ax, -1, 4, -1, 3)
21
+
22
+ #2
23
+ ax = fig.add_subplot(122)
24
+
25
+ points1 = MultiPoint([(0, 0), (1, 1), (0, 2), (2, 2), (3, 1), (1, 0)])
26
+ plot_points(points1, ax=ax, color=GRAY)
27
+
28
+ hull1 = points1.convex_hull
29
+ plot_polygon(hull1, ax=ax, add_points=False, color=BLUE, zorder=3, alpha=0.5)
30
+
31
+ ax.set_title('b) N > 2')
32
+
33
+ set_limits(ax, -1, 4, -1, 3)
34
+
35
+ plt.show()
@@ -0,0 +1,53 @@
1
+ import urllib.request
2
+
3
+ import numpy as np
4
+ import matplotlib.pyplot as plt
5
+
6
+ import shapely
7
+ from shapely.plotting import plot_polygon
8
+
9
+ from figures import SIZE, BLUE
10
+
11
+ ## Downloading and preprocessing data
12
+
13
+ # download countries geojson from https://datahub.io/core/geo-countries
14
+ with urllib.request.urlopen("https://datahub.io/core/geo-countries/_r/-/data/countries.geojson") as f:
15
+ geojson = f.read().decode("utf-8")
16
+
17
+ geoms = np.asarray(shapely.from_geojson(geojson).geoms)
18
+
19
+ # select countries of Africa
20
+ clip_polygon = shapely.from_wkt("POLYGON ((-23.714863 14.983714, 0.434636 -51.130505, 52.292267 -50.120681, 60.184885 -22.43548, 57.448957 14.358282, 44.596307 11.524365, 33.72577 34.648769, 7.226985 39.73104, -16.429284 33.649053, -23.714863 14.983714))")
21
+ geoms_africa = geoms[shapely.within(geoms, clip_polygon)]
22
+
23
+ # remove small islands for nicer illustration of coverage
24
+ temp = geoms_africa[shapely.area(geoms_africa) > 0.1]
25
+ parts, indices = shapely.get_parts(temp, return_index=True)
26
+ mask = shapely.area(parts) > 0.08
27
+ temp = shapely.multipolygons(parts[mask], indices=indices[mask])
28
+
29
+ # set precision to improve coverage validity
30
+ geoms_africa2 = shapely.set_precision(temp, 0.001)
31
+
32
+ ## Coverage simplify
33
+
34
+ geoms_africa_simplified = shapely.coverage_simplify(geoms_africa2, tolerance=5.0)
35
+
36
+ # plot
37
+ fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=SIZE, dpi=90)
38
+
39
+ for geom in geoms_africa2:
40
+ plot_polygon(geom, ax=ax1, add_points=False, color=BLUE)
41
+
42
+ ax1.set_title('a) original data')
43
+ ax1.axis("off")
44
+ ax1.set_aspect("equal")
45
+
46
+ for geom in geoms_africa_simplified:
47
+ plot_polygon(geom, ax=ax2, add_points=False, color=BLUE)
48
+
49
+ ax2.set_title('b) coverage simplified')
50
+ ax2.axis("off")
51
+ ax2.set_aspect("equal")
52
+
53
+ plt.show()
@@ -0,0 +1,38 @@
1
+ import matplotlib.pyplot as plt
2
+ from shapely.geometry import Point
3
+ from shapely.plotting import plot_polygon
4
+
5
+ from figures import SIZE, BLUE, GRAY, set_limits
6
+
7
+ fig = plt.figure(1, figsize=SIZE, dpi=90)
8
+
9
+ a = Point(1, 1).buffer(1.5)
10
+ b = Point(2, 1).buffer(1.5)
11
+
12
+ # 1
13
+ ax = fig.add_subplot(121)
14
+
15
+ plot_polygon(a, ax=ax, add_points=False, color=GRAY, alpha=0.2)
16
+ plot_polygon(b, ax=ax, add_points=False, color=GRAY, alpha=0.2)
17
+
18
+ c = a.difference(b)
19
+ plot_polygon(c, ax=ax, add_points=False, color=BLUE, alpha=0.5)
20
+
21
+ ax.set_title('a.difference(b)')
22
+
23
+ set_limits(ax, -1, 4, -1, 3)
24
+
25
+ #2
26
+ ax = fig.add_subplot(122)
27
+
28
+ plot_polygon(a, ax=ax, add_points=False, color=GRAY, alpha=0.2)
29
+ plot_polygon(b, ax=ax, add_points=False, color=GRAY, alpha=0.2)
30
+
31
+ c = b.difference(a)
32
+ plot_polygon(c, ax=ax, add_points=False, color=BLUE, alpha=0.5)
33
+
34
+ ax.set_title('b.difference(a)')
35
+
36
+ set_limits(ax, -1, 4, -1, 3)
37
+
38
+ plt.show()
@@ -0,0 +1,30 @@
1
+ from math import sqrt
2
+ from shapely import affinity
3
+
4
+ GM = (sqrt(5)-1.0)/2.0
5
+ W = 8.0
6
+ H = W*GM
7
+ SIZE = (W, H)
8
+
9
+ BLUE = '#6699cc'
10
+ GRAY = '#999999'
11
+ DARKGRAY = '#333333'
12
+ YELLOW = '#ffcc33'
13
+ GREEN = '#339933'
14
+ RED = '#ff3333'
15
+ BLACK = '#000000'
16
+
17
+
18
+ def add_origin(ax, geom, origin):
19
+ x, y = xy = affinity.interpret_origin(geom, origin, 2)
20
+ ax.plot(x, y, 'o', color=GRAY, zorder=1)
21
+ ax.annotate(str(xy), xy=xy, ha='center',
22
+ textcoords='offset points', xytext=(0, 8))
23
+
24
+
25
+ def set_limits(ax, x0, xN, y0, yN):
26
+ ax.set_xlim(x0, xN)
27
+ ax.set_xticks(range(x0, xN+1))
28
+ ax.set_ylim(y0, yN)
29
+ ax.set_yticks(range(y0, yN+1))
30
+ ax.set_aspect("equal")
@@ -0,0 +1,39 @@
1
+ import matplotlib.pyplot as plt
2
+ from shapely.geometry import LineString
3
+ from shapely.plotting import plot_line, plot_points
4
+
5
+ from figures import BLUE, GRAY, YELLOW, GREEN, SIZE, set_limits
6
+
7
+ fig = plt.figure(1, figsize=SIZE, dpi=90)
8
+
9
+ a = LineString([(0, 0), (1, 1), (1,2), (2,2)])
10
+ b = LineString([(0, 0), (1, 1), (2,1), (2,2)])
11
+
12
+ # 1: disconnected multilinestring
13
+ ax = fig.add_subplot(121)
14
+
15
+ plot_line(a, ax, add_points=False, color=YELLOW, alpha=0.5)
16
+ plot_line(b, ax, add_points=False, color=GREEN, alpha=0.5)
17
+ plot_points(a, ax=ax, color=GRAY)
18
+ plot_points(b, ax=ax, color=GRAY)
19
+
20
+ ax.set_title('a) lines')
21
+
22
+ set_limits(ax, -1, 3, -1, 3)
23
+
24
+ #2: invalid self-touching ring
25
+ ax = fig.add_subplot(122)
26
+
27
+ x = a.intersection(b)
28
+
29
+ plot_line(a, ax=ax, color=GRAY, add_points=False)
30
+ plot_line(b, ax=ax, color=GRAY, add_points=False)
31
+
32
+ plot_line(x.geoms[0], ax=ax, color=BLUE)
33
+ plot_points(x.geoms[1], ax=ax, color=BLUE)
34
+
35
+ ax.set_title('b) collection')
36
+
37
+ set_limits(ax, -1, 3, -1, 3)
38
+
39
+ plt.show()
@@ -0,0 +1,38 @@
1
+ import matplotlib.pyplot as plt
2
+ from shapely.geometry import Point
3
+ from shapely.plotting import plot_polygon
4
+
5
+ from figures import SIZE, BLUE, GRAY, set_limits
6
+
7
+ fig = plt.figure(1, figsize=SIZE, dpi=90)
8
+
9
+ a = Point(1, 1).buffer(1.5)
10
+ b = Point(2, 1).buffer(1.5)
11
+
12
+ # 1
13
+ ax = fig.add_subplot(121)
14
+
15
+ plot_polygon(a, ax=ax, add_points=False, color=GRAY, alpha=0.2)
16
+ plot_polygon(b, ax=ax, add_points=False, color=GRAY, alpha=0.2)
17
+
18
+ c = a.intersection(b)
19
+ plot_polygon(c, ax=ax, add_points=False, color=BLUE, alpha=0.5)
20
+
21
+ ax.set_title('a.intersection(b)')
22
+
23
+ set_limits(ax, -1, 4, -1, 3)
24
+
25
+ #2
26
+ ax = fig.add_subplot(122)
27
+
28
+ plot_polygon(a, ax=ax, add_points=False, color=GRAY, alpha=0.2)
29
+ plot_polygon(b, ax=ax, add_points=False, color=GRAY, alpha=0.2)
30
+
31
+ c = a.symmetric_difference(b)
32
+ plot_polygon(c, ax=ax, add_points=False, color=BLUE, alpha=0.5)
33
+
34
+ ax.set_title('a.symmetric_difference(b)')
35
+
36
+ set_limits(ax, -1, 4, -1, 3)
37
+
38
+ plt.show()
@@ -0,0 +1,31 @@
1
+ import matplotlib.pyplot as plt
2
+ from shapely.geometry import LinearRing
3
+ from shapely.plotting import plot_line, plot_points
4
+
5
+ from figures import SIZE, BLUE, GRAY, RED, set_limits
6
+
7
+ fig = plt.figure(1, figsize=SIZE, dpi=90)
8
+
9
+ # 1: valid ring
10
+ ax = fig.add_subplot(121)
11
+ ring = LinearRing([(0, 0), (0, 2), (1, 1), (2, 2), (2, 0), (1, 0.8), (0, 0)])
12
+
13
+ plot_line(ring, ax=ax, add_points=False, color=BLUE, alpha=0.7)
14
+ plot_points(ring, ax=ax, color=GRAY, alpha=0.7)
15
+
16
+ ax.set_title('a) valid')
17
+
18
+ set_limits(ax, -1, 3, -1, 3)
19
+
20
+ #2: invalid self-touching ring
21
+ ax = fig.add_subplot(122)
22
+ ring2 = LinearRing([(0, 0), (0, 2), (1, 1), (2, 2), (2, 0), (1, 1), (0, 0)])
23
+
24
+ plot_line(ring2, ax=ax, add_points=False, color=RED, alpha=0.7)
25
+ plot_points(ring2, ax=ax, color=GRAY, alpha=0.7)
26
+
27
+ ax.set_title('b) invalid')
28
+
29
+ set_limits(ax, -1, 3, -1, 3)
30
+
31
+ plt.show()
@@ -0,0 +1,33 @@
1
+ import matplotlib.pyplot as plt
2
+ from shapely.geometry import LineString
3
+ from shapely.plotting import plot_line, plot_points
4
+
5
+ from figures import SIZE, BLACK, BLUE, GRAY, YELLOW, set_limits
6
+
7
+ fig = plt.figure(1, figsize=SIZE, dpi=90)
8
+
9
+ # 1: simple line
10
+ ax = fig.add_subplot(121)
11
+ line = LineString([(0, 0), (1, 1), (0, 2), (2, 2), (3, 1), (1, 0)])
12
+
13
+ plot_line(line, ax=ax, add_points=False, color=BLUE, alpha=0.7)
14
+ plot_points(line, ax=ax, color=GRAY, alpha=0.7)
15
+ plot_points(line.boundary, ax=ax, color=BLACK)
16
+
17
+ ax.set_title('a) simple')
18
+
19
+ set_limits(ax, -1, 4, -1, 3)
20
+
21
+ # 2: complex line
22
+ ax = fig.add_subplot(122)
23
+ line2 = LineString([(0, 0), (1, 1), (0, 2), (2, 2), (-1, 1), (1, 0)])
24
+
25
+ plot_line(line2, ax=ax, add_points=False, color=YELLOW, alpha=0.7)
26
+ plot_points(line2, ax=ax, color=GRAY, alpha=0.7)
27
+ plot_points(line2.boundary, ax=ax, color=BLACK)
28
+
29
+ ax.set_title('b) complex')
30
+
31
+ set_limits(ax, -2, 3, -1, 3)
32
+
33
+ plt.show()