shapely 2.1.2__tar.gz → 2.2.0__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.
- {shapely-2.1.2 → shapely-2.2.0}/CHANGES.txt +17 -0
- {shapely-2.1.2 → shapely-2.2.0}/CITATION.cff +2 -2
- shapely-2.2.0/CODE_OF_CONDUCT.md +22 -0
- shapely-2.2.0/CONTRIBUTING.md +17 -0
- {shapely-2.1.2 → shapely-2.2.0}/PKG-INFO +20 -26
- {shapely-2.1.2 → shapely-2.2.0}/README.rst +11 -5
- shapely-2.2.0/_version.py +4 -0
- shapely-2.2.0/docs/Makefile +89 -0
- shapely-2.2.0/docs/_templates/autosummary/class.rst +7 -0
- shapely-2.2.0/docs/code/buffer.py +35 -0
- shapely-2.2.0/docs/code/buffer_single_side.py +35 -0
- shapely-2.2.0/docs/code/convex_hull.py +35 -0
- shapely-2.2.0/docs/code/coverage_simplify.py +53 -0
- shapely-2.2.0/docs/code/difference.py +38 -0
- shapely-2.2.0/docs/code/figures.py +30 -0
- shapely-2.2.0/docs/code/geometrycollection.py +39 -0
- shapely-2.2.0/docs/code/intersection-sym-difference.py +38 -0
- shapely-2.2.0/docs/code/linearring.py +31 -0
- shapely-2.2.0/docs/code/linestring.py +33 -0
- shapely-2.2.0/docs/code/make_valid_geometrycollection.py +28 -0
- shapely-2.2.0/docs/code/make_valid_methods.py +57 -0
- shapely-2.2.0/docs/code/make_valid_multipolygon.py +27 -0
- shapely-2.2.0/docs/code/minimum_rotated_rectangle.py +33 -0
- shapely-2.2.0/docs/code/multilinestring.py +36 -0
- shapely-2.2.0/docs/code/multipolygon.py +39 -0
- shapely-2.2.0/docs/code/parallel_offset.py +58 -0
- shapely-2.2.0/docs/code/parallel_offset_mitre.py +58 -0
- shapely-2.2.0/docs/code/polygon.py +36 -0
- shapely-2.2.0/docs/code/polygon2.py +37 -0
- shapely-2.2.0/docs/code/rotate.py +34 -0
- shapely-2.2.0/docs/code/scale.py +38 -0
- shapely-2.2.0/docs/code/simplify.py +35 -0
- shapely-2.2.0/docs/code/skew.py +51 -0
- shapely-2.2.0/docs/code/triangulate.py +22 -0
- shapely-2.2.0/docs/code/unary_union.py +32 -0
- shapely-2.2.0/docs/code/union.py +38 -0
- shapely-2.2.0/docs/code/voronoi_diagram.py +22 -0
- shapely-2.2.0/docs/conf.py +143 -0
- shapely-2.2.0/docs/environment.yml +13 -0
- shapely-2.2.0/docs/faq.rst +42 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/index.rst +1 -2
- {shapely-2.1.2 → shapely-2.2.0}/docs/installation.rst +93 -40
- {shapely-2.1.2 → shapely-2.2.0}/docs/manual.rst +160 -83
- shapely-2.2.0/docs/release/1.x.rst +927 -0
- shapely-2.2.0/docs/release/2.x.rst +1022 -0
- shapely-2.2.0/generate_version.py +79 -0
- shapely-2.2.0/meson.build +151 -0
- {shapely-2.1.2 → shapely-2.2.0}/pyproject.toml +60 -43
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/__init__.py +21 -3
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/_coverage.py +112 -5
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/_enum.py +9 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/_geometry.py +131 -37
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/_geometry_helpers.pyx +1 -1
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/_geos.pxd +0 -1
- shapely-2.2.0/src/shapely/_geos.pyx +23 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/_pygeos_api.pxd +2 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/_ragged_array.py +2 -2
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/affinity.py +1 -1
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/algorithms/_oriented_envelope.py +1 -1
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/algorithms/cga.py +1 -1
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/algorithms/polylabel.py +2 -2
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/constructive.py +114 -52
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/coordinates.py +156 -20
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/coords.py +1 -1
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/creation.py +58 -35
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/decorators.py +12 -1
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/errors.py +3 -3
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/geometry/base.py +157 -43
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/geometry/collection.py +6 -1
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/geometry/geo.py +11 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/geometry/linestring.py +6 -1
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/geometry/multilinestring.py +6 -1
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/geometry/multipoint.py +6 -1
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/geometry/multipolygon.py +12 -2
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/geometry/point.py +11 -6
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/geometry/polygon.py +30 -11
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/io.py +12 -7
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/c_api.c +8 -0
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/c_api.h +19 -1
- shapely-2.2.0/src/shapely/lib/geom_arr.c +38 -0
- shapely-2.2.0/src/shapely/lib/geom_arr.h +14 -0
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/geos.c +77 -41
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/geos.h +79 -54
- shapely-2.2.0/src/shapely/lib/geos_funcs_O_b.c +284 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_O_b.h +6 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_YYO_b.c +201 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_YYO_b.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_YY_O.c +155 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_YY_O.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_YY_Y.c +334 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_YY_Y.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_YY_b.c +304 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_YY_b.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_YY_d.c +292 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_YY_d.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_YYd_Y.c +269 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_YYd_Y.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_YYd_b.c +269 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_YYd_b.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_YYd_d.c +265 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_YYd_d.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Y_O.c +151 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Y_O.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Y_Y.c +370 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Y_Y.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Y_b.c +315 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Y_b.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Y_d.c +340 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Y_d.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Y_i.c +285 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Y_i.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Yd_Y.c +369 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Yd_Y.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Ydb_Y.c +346 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Ydb_Y.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Ydd_b.c +291 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Ydd_b.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Ydddd_Y.c +246 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Ydddd_Y.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Ydi_Y.c +279 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Ydi_Y.h +8 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Yi_Y.c +405 -0
- shapely-2.2.0/src/shapely/lib/geos_funcs_Yi_Y.h +8 -0
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/lib.c +103 -1
- shapely-2.2.0/src/shapely/lib/meson.build +39 -0
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/pygeom.c +35 -3
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/pygeom.h +4 -2
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/pygeos.c +0 -6
- shapely-2.2.0/src/shapely/lib/signal_checks.c +17 -0
- shapely-2.2.0/src/shapely/lib/signal_checks.h +53 -0
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/strtree.c +0 -6
- shapely-2.2.0/src/shapely/lib/ufuncs.c +1997 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/linear.py +8 -11
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/measurement.py +9 -14
- shapely-2.2.0/src/shapely/meson.build +68 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/ops.py +77 -80
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/predicates.py +90 -49
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/set_operations.py +0 -12
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/strtree.py +0 -8
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/testing.py +1 -1
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/common.py +2 -4
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/geometry/test_collection.py +1 -6
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/geometry/test_decimal.py +1 -1
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/geometry/test_equality.py +1 -12
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/geometry/test_format.py +11 -31
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/geometry/test_geometry_base.py +87 -25
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/geometry/test_multipoint.py +8 -4
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/geometry/test_multipolygon.py +34 -1
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/geometry/test_polygon.py +13 -6
- shapely-2.2.0/src/shapely/tests/legacy/data/emptypoint_1.8.5.post1.pickle +0 -0
- shapely-2.2.0/src/shapely/tests/legacy/data/emptypolygon_1.8.5.post1.pickle +0 -0
- shapely-2.2.0/src/shapely/tests/legacy/data/geometrycollection_1.8.5.post1.pickle +0 -0
- shapely-2.2.0/src/shapely/tests/legacy/data/linearring_1.8.5.post1.pickle +0 -0
- shapely-2.2.0/src/shapely/tests/legacy/data/linestring_1.8.5.post1.pickle +0 -0
- shapely-2.2.0/src/shapely/tests/legacy/data/multilinestring_1.8.5.post1.pickle +0 -0
- shapely-2.2.0/src/shapely/tests/legacy/data/multipoint_1.8.5.post1.pickle +0 -0
- shapely-2.2.0/src/shapely/tests/legacy/data/multipolygon_1.8.5.post1.pickle +0 -0
- shapely-2.2.0/src/shapely/tests/legacy/data/point2d_1.8.5.post1.pickle +0 -0
- shapely-2.2.0/src/shapely/tests/legacy/data/point3d_1.8.5.post1.pickle +0 -0
- shapely-2.2.0/src/shapely/tests/legacy/data/polygon_1.8.5.post1.pickle +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_affinity.py +13 -13
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_locale.py +5 -7
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_pickle.py +2 -2
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_split.py +57 -11
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_svg.py +1 -1
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_transform.py +45 -10
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_union.py +4 -3
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_wkb.py +8 -13
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_wkt.py +4 -4
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/test_constructive.py +536 -57
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/test_coordinates.py +133 -29
- shapely-2.2.0/src/shapely/tests/test_coverage.py +520 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/test_creation.py +38 -9
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/test_creation_indices.py +2 -2
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/test_geometry.py +163 -57
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/test_io.py +12 -16
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/test_linear.py +42 -11
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/test_measurement.py +40 -16
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/test_misc.py +53 -14
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/test_predicates.py +87 -11
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/test_ragged_array.py +6 -4
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/test_set_operations.py +32 -10
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/test_strtree.py +16 -30
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/test_testing.py +2 -2
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/wkb.py +1 -1
- shapely-2.1.2/setup.cfg +0 -16
- shapely-2.1.2/setup.py +0 -204
- shapely-2.1.2/shapely/_geos.pyx +0 -45
- shapely-2.1.2/shapely/_version.py +0 -21
- shapely-2.1.2/shapely/tests/test_coverage.py +0 -249
- shapely-2.1.2/shapely.egg-info/PKG-INFO +0 -206
- shapely-2.1.2/shapely.egg-info/SOURCES.txt +0 -184
- shapely-2.1.2/shapely.egg-info/dependency_links.txt +0 -1
- shapely-2.1.2/shapely.egg-info/requires.txt +0 -13
- shapely-2.1.2/shapely.egg-info/top_level.txt +0 -1
- shapely-2.1.2/src/ufuncs.c +0 -4113
- {shapely-2.1.2 → shapely-2.2.0}/CREDITS.txt +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/LICENSE.txt +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/constructive.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/coordinates.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/coverage.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/creation.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/design.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/geometry.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/io.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/linear.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/measurement.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/migration.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/migration_pygeos.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/plotting.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/predicates.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/properties.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/release.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/set_operations.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/strtree.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/docs/testing.rst +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/algorithms/__init__.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/conftest.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/geometry/__init__.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/geos.py +0 -0
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/coords.c +0 -0
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/coords.h +0 -0
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/fast_loop_macros.h +0 -0
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/kvec.h +0 -0
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/pygeos.h +0 -0
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/strtree.h +0 -0
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/ufuncs.h +0 -0
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/vector.c +0 -0
- {shapely-2.1.2/src → shapely-2.2.0/src/shapely/lib}/vector.h +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/plotting.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/prepared.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/speedups.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/__init__.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/geometry/__init__.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/geometry/test_coords.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/geometry/test_emptiness.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/geometry/test_hash.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/geometry/test_linestring.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/geometry/test_multi.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/geometry/test_multilinestring.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/geometry/test_point.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/__init__.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/conftest.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_box.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_buffer.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_cga.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_clip_by_rect.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_create_inconsistent_dimensionality.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_delaunay.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_empty_polygons.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_equality.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_geointerface.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_invalid_geometries.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_linear_referencing.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_linemerge.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_make_valid.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_mapping.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_minimum_clearance.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_ndarrays.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_nearest.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_operations.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_operators.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_orient.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_parallel_offset.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_persist.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_polygonize.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_polylabel.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_predicates.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_prepared.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_products_z.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_shape.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_shared_paths.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_singularity.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_snap.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_substring.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_validation.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_vectorized.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/test_voronoi_diagram.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/legacy/threading_test.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/test_decorators.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/tests/test_plotting.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/validation.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/vectorized/__init__.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0/src}/shapely/wkt.py +0 -0
- {shapely-2.1.2 → shapely-2.2.0}/versioneer.py +0 -0
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
Changes
|
|
2
2
|
=======
|
|
3
3
|
|
|
4
|
+
2.2.0 (2026-10-07)
|
|
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
|
+
|
|
4
21
|
2.1.2 (2025-09-24)
|
|
5
22
|
------------------
|
|
6
23
|
|
|
@@ -2,8 +2,8 @@ cff-version: 1.2.0
|
|
|
2
2
|
message: "Please cite this software using these metadata."
|
|
3
3
|
type: software
|
|
4
4
|
title: Shapely
|
|
5
|
-
version: "2.
|
|
6
|
-
date-released: "
|
|
5
|
+
version: "2.2.0"
|
|
6
|
+
date-released: "2026-10-07"
|
|
7
7
|
doi: 10.5281/zenodo.5597138
|
|
8
8
|
abstract: "Manipulation and analysis of geometric objects in the Cartesian plane."
|
|
9
9
|
repository-artifact: https://pypi.org/project/Shapely
|
|
@@ -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,42 +1,30 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: shapely
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
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
|
|
8
|
-
|
|
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
|
|
23
20
|
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
24
22
|
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
25
|
-
|
|
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
|
|
26
27
|
Description-Content-Type: text/x-rst
|
|
27
|
-
License-File: LICENSE.txt
|
|
28
|
-
Requires-Dist: numpy>=1.21
|
|
29
|
-
Provides-Extra: test
|
|
30
|
-
Requires-Dist: pytest; extra == "test"
|
|
31
|
-
Requires-Dist: pytest-cov; extra == "test"
|
|
32
|
-
Requires-Dist: scipy-doctest; extra == "test"
|
|
33
|
-
Provides-Extra: docs
|
|
34
|
-
Requires-Dist: numpydoc==1.1.*; extra == "docs"
|
|
35
|
-
Requires-Dist: matplotlib; extra == "docs"
|
|
36
|
-
Requires-Dist: sphinx; extra == "docs"
|
|
37
|
-
Requires-Dist: sphinx-book-theme; extra == "docs"
|
|
38
|
-
Requires-Dist: sphinx-remove-toctrees; extra == "docs"
|
|
39
|
-
Dynamic: license-file
|
|
40
28
|
|
|
41
29
|
=======
|
|
42
30
|
Shapely
|
|
@@ -108,7 +96,13 @@ Shapely functions generally support multithreading by releasing the Global
|
|
|
108
96
|
Interpreter Lock (GIL) during execution. Normally in Python, the GIL prevents
|
|
109
97
|
multiple threads from computing at the same time. Shapely functions
|
|
110
98
|
internally release this constraint so that the heavy lifting done by GEOS can
|
|
111
|
-
be done
|
|
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.
|
|
112
106
|
|
|
113
107
|
Usage
|
|
114
108
|
=====
|
|
@@ -143,11 +137,11 @@ See the documentation for more examples and guidance: https://shapely.readthedoc
|
|
|
143
137
|
Requirements
|
|
144
138
|
============
|
|
145
139
|
|
|
146
|
-
Shapely 2.
|
|
140
|
+
Shapely 2.2 requires
|
|
147
141
|
|
|
148
|
-
* Python >=3.
|
|
149
|
-
* GEOS >=3.
|
|
150
|
-
* NumPy >=1.
|
|
142
|
+
* Python >=3.11
|
|
143
|
+
* GEOS >=3.10
|
|
144
|
+
* NumPy >=1.26
|
|
151
145
|
|
|
152
146
|
Installing Shapely
|
|
153
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
|
|
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.
|
|
112
|
+
Shapely 2.2 requires
|
|
107
113
|
|
|
108
|
-
* Python >=3.
|
|
109
|
-
* GEOS >=3.
|
|
110
|
-
* NumPy >=1.
|
|
114
|
+
* Python >=3.11
|
|
115
|
+
* GEOS >=3.10
|
|
116
|
+
* NumPy >=1.26
|
|
111
117
|
|
|
112
118
|
Installing Shapely
|
|
113
119
|
==================
|
|
@@ -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,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()
|