shapely 1.8.2__tar.gz → 1.8.3__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-1.8.2 → Shapely-1.8.3}/CHANGES.txt +26 -1
- {Shapely-1.8.2/Shapely.egg-info → Shapely-1.8.3}/PKG-INFO +27 -5
- {Shapely-1.8.2 → Shapely-1.8.3/Shapely.egg-info}/PKG-INFO +27 -5
- Shapely-1.8.3/VERSION.txt +1 -0
- Shapely-1.8.3/pyproject.toml +6 -0
- Shapely-1.8.3/shapely/__init__.py +1 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/ctypes_declarations.py +45 -20
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/geometry/base.py +15 -9
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/geometry/collection.py +2 -1
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/geometry/multilinestring.py +7 -6
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/geometry/multipoint.py +3 -2
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/geometry/multipolygon.py +5 -4
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/geometry/polygon.py +7 -5
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/geometry/proxy.py +5 -2
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/ops.py +29 -13
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/strtree.py +21 -2
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/topology.py +7 -3
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_geos_err_handler.py +8 -4
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_linear_referencing.py +6 -3
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_parallel_offset.py +4 -2
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_shared_paths.py +15 -10
- Shapely-1.8.3/tests/test_split.py +247 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_strtree.py +29 -14
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_substring.py +5 -2
- Shapely-1.8.2/VERSION.txt +0 -1
- Shapely-1.8.2/pyproject.toml +0 -2
- Shapely-1.8.2/shapely/__init__.py +0 -1
- Shapely-1.8.2/tests/test_split.py +0 -230
- {Shapely-1.8.2 → Shapely-1.8.3}/CREDITS.txt +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/LICENSE.txt +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/README.rst +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/Shapely.egg-info/SOURCES.txt +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/Shapely.egg-info/dependency_links.txt +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/Shapely.egg-info/requires.txt +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/Shapely.egg-info/top_level.txt +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/_vendor/__init__.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/_vendor/packaging/__about__.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/_vendor/packaging/__init__.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/_vendor/packaging/_compat.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/_vendor/packaging/_structures.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/_vendor/packaging/markers.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/_vendor/packaging/requirements.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/_vendor/packaging/specifiers.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/_vendor/packaging/utils.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/_vendor/packaging/version.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/docs/design.rst +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/docs/index.rst +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/docs/manual.rst +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/docs/migration.rst +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/docs/project.rst +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/setup.cfg +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/setup.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/_buildcfg.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/_geos.pxi +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/affinity.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/algorithms/__init__.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/algorithms/cga.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/algorithms/polylabel.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/coords.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/errors.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/examples/__init__.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/examples/dissolve.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/examples/geoms.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/examples/intersect.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/geometry/__init__.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/geometry/conftest.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/geometry/geo.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/geometry/linestring.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/geometry/point.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/geos.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/impl.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/iterops.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/linref.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/predicates.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/prepared.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/speedups/__init__.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/speedups/_speedups.pyx +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/validation.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/vectorized/__init__.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/vectorized/_vectorized.pyx +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/wkb.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/shapely/wkt.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/__init__.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/conftest.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_affinity.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_binascii_hex.txt +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_box.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_buffer.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_cga.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_clip_by_rect.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_collection.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_coords.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_create_inconsistent_dimensionality.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_default_impl.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_delaunay.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_delegated.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_dlls.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_doctests.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_emptiness.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_empty_polygons.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_equality.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_geointerface.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_geometry_base.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_geomseq.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_getitem.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_hash.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_invalid_geometries.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_iterops.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_linemerge.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_linestring.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_locale.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_make_valid.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_mapping.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_minimum_clearance.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_minimum_rotated_rectangle.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_multi.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_multilinestring.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_multipoint.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_multipolygon.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_ndarrays.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_nearest.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_operations.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_operators.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_orient.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_persist.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_pickle.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_point.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_polygon.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_polygonize.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_polylabel.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_predicates.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_prepared.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_products_z.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_shape.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_singularity.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_snap.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_styles.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_svg.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_transform.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_union.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_validation.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_vectorized.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_voronoi_diagram.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_wkb.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_wkt.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/test_xy.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/threading_test.py +0 -0
- {Shapely-1.8.2 → Shapely-1.8.3}/tests/unpickle-strtree.py +0 -0
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
Changes
|
|
2
2
|
=======
|
|
3
3
|
|
|
4
|
+
1.8.3 (2022-08-16)
|
|
5
|
+
------------------
|
|
6
|
+
|
|
7
|
+
Deprecations:
|
|
8
|
+
|
|
9
|
+
The STRtree class will be changed in 2.0.0 and will not be compatible with the
|
|
10
|
+
class in versions 1.8.x. This change obsoletes the deprecation announcement in
|
|
11
|
+
1.8a3 (below).
|
|
12
|
+
|
|
13
|
+
Packaging:
|
|
14
|
+
|
|
15
|
+
Wheels for 1.8.3 published on PyPI include GEOS 3.10.3.
|
|
16
|
+
|
|
17
|
+
Bug fixes:
|
|
18
|
+
|
|
19
|
+
- The signature for GEOSMinimumClearance has been corrected, fixing an issue
|
|
20
|
+
affecting aarch64-darwin (#1480)
|
|
21
|
+
- Return and arg types have been corrected and made more strict for area,
|
|
22
|
+
length, and distance properties.
|
|
23
|
+
- A new c_geom_p type has been created to replace c_void_p when calling GEOS
|
|
24
|
+
functions (#1479).
|
|
25
|
+
- An incorrect polygon-line intersection (#1427) has been fixed in GEOS 3.10.3,
|
|
26
|
+
which will be included in wheels published to PyPI.
|
|
27
|
+
- GEOS buffer parameters are now destroyed, fixing a memory leak (#1440).
|
|
28
|
+
|
|
4
29
|
1.8.2 (2022-05-03)
|
|
5
30
|
------------------
|
|
6
31
|
|
|
@@ -23,7 +48,7 @@ install from source.
|
|
|
23
48
|
Packaging:
|
|
24
49
|
|
|
25
50
|
Wheels for 1.8.1 published on PyPI include GEOS 3.10.2. This version is the
|
|
26
|
-
best version of
|
|
51
|
+
best version of GEOS yet. Discrepancies in behavior compared to previous
|
|
27
52
|
versions are considered to be improvements.
|
|
28
53
|
|
|
29
54
|
For the first time, we will publish wheels for macos_arm64 (see PR #1310).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: Shapely
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.3
|
|
4
4
|
Summary: Geometric objects, predicates, and operations
|
|
5
5
|
Home-page: https://github.com/shapely/shapely
|
|
6
6
|
Author: Sean Gillies
|
|
@@ -9,7 +9,6 @@ Maintainer: Sean Gillies
|
|
|
9
9
|
Maintainer-email: sean.gillies@gmail.com
|
|
10
10
|
License: BSD
|
|
11
11
|
Keywords: geometry topology gis
|
|
12
|
-
Platform: UNKNOWN
|
|
13
12
|
Classifier: Development Status :: 5 - Production/Stable
|
|
14
13
|
Classifier: Intended Audience :: Developers
|
|
15
14
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -332,6 +331,31 @@ U.S. National Endowment for the Humanities (https://www.neh.gov).
|
|
|
332
331
|
Changes
|
|
333
332
|
=======
|
|
334
333
|
|
|
334
|
+
1.8.3 (2022-08-16)
|
|
335
|
+
------------------
|
|
336
|
+
|
|
337
|
+
Deprecations:
|
|
338
|
+
|
|
339
|
+
The STRtree class will be changed in 2.0.0 and will not be compatible with the
|
|
340
|
+
class in versions 1.8.x. This change obsoletes the deprecation announcement in
|
|
341
|
+
1.8a3 (below).
|
|
342
|
+
|
|
343
|
+
Packaging:
|
|
344
|
+
|
|
345
|
+
Wheels for 1.8.3 published on PyPI include GEOS 3.10.3.
|
|
346
|
+
|
|
347
|
+
Bug fixes:
|
|
348
|
+
|
|
349
|
+
- The signature for GEOSMinimumClearance has been corrected, fixing an issue
|
|
350
|
+
affecting aarch64-darwin (#1480)
|
|
351
|
+
- Return and arg types have been corrected and made more strict for area,
|
|
352
|
+
length, and distance properties.
|
|
353
|
+
- A new c_geom_p type has been created to replace c_void_p when calling GEOS
|
|
354
|
+
functions (#1479).
|
|
355
|
+
- An incorrect polygon-line intersection (#1427) has been fixed in GEOS 3.10.3,
|
|
356
|
+
which will be included in wheels published to PyPI.
|
|
357
|
+
- GEOS buffer parameters are now destroyed, fixing a memory leak (#1440).
|
|
358
|
+
|
|
335
359
|
1.8.2 (2022-05-03)
|
|
336
360
|
------------------
|
|
337
361
|
|
|
@@ -354,7 +378,7 @@ install from source.
|
|
|
354
378
|
Packaging:
|
|
355
379
|
|
|
356
380
|
Wheels for 1.8.1 published on PyPI include GEOS 3.10.2. This version is the
|
|
357
|
-
best version of
|
|
381
|
+
best version of GEOS yet. Discrepancies in behavior compared to previous
|
|
358
382
|
versions are considered to be improvements.
|
|
359
383
|
|
|
360
384
|
For the first time, we will publish wheels for macos_arm64 (see PR #1310).
|
|
@@ -1224,5 +1248,3 @@ TODO: fill gap here
|
|
|
1224
1248
|
1.0 RC1 (2008-01-14)
|
|
1225
1249
|
--------------------
|
|
1226
1250
|
- First release candidate
|
|
1227
|
-
|
|
1228
|
-
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: Shapely
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.3
|
|
4
4
|
Summary: Geometric objects, predicates, and operations
|
|
5
5
|
Home-page: https://github.com/shapely/shapely
|
|
6
6
|
Author: Sean Gillies
|
|
@@ -9,7 +9,6 @@ Maintainer: Sean Gillies
|
|
|
9
9
|
Maintainer-email: sean.gillies@gmail.com
|
|
10
10
|
License: BSD
|
|
11
11
|
Keywords: geometry topology gis
|
|
12
|
-
Platform: UNKNOWN
|
|
13
12
|
Classifier: Development Status :: 5 - Production/Stable
|
|
14
13
|
Classifier: Intended Audience :: Developers
|
|
15
14
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -332,6 +331,31 @@ U.S. National Endowment for the Humanities (https://www.neh.gov).
|
|
|
332
331
|
Changes
|
|
333
332
|
=======
|
|
334
333
|
|
|
334
|
+
1.8.3 (2022-08-16)
|
|
335
|
+
------------------
|
|
336
|
+
|
|
337
|
+
Deprecations:
|
|
338
|
+
|
|
339
|
+
The STRtree class will be changed in 2.0.0 and will not be compatible with the
|
|
340
|
+
class in versions 1.8.x. This change obsoletes the deprecation announcement in
|
|
341
|
+
1.8a3 (below).
|
|
342
|
+
|
|
343
|
+
Packaging:
|
|
344
|
+
|
|
345
|
+
Wheels for 1.8.3 published on PyPI include GEOS 3.10.3.
|
|
346
|
+
|
|
347
|
+
Bug fixes:
|
|
348
|
+
|
|
349
|
+
- The signature for GEOSMinimumClearance has been corrected, fixing an issue
|
|
350
|
+
affecting aarch64-darwin (#1480)
|
|
351
|
+
- Return and arg types have been corrected and made more strict for area,
|
|
352
|
+
length, and distance properties.
|
|
353
|
+
- A new c_geom_p type has been created to replace c_void_p when calling GEOS
|
|
354
|
+
functions (#1479).
|
|
355
|
+
- An incorrect polygon-line intersection (#1427) has been fixed in GEOS 3.10.3,
|
|
356
|
+
which will be included in wheels published to PyPI.
|
|
357
|
+
- GEOS buffer parameters are now destroyed, fixing a memory leak (#1440).
|
|
358
|
+
|
|
335
359
|
1.8.2 (2022-05-03)
|
|
336
360
|
------------------
|
|
337
361
|
|
|
@@ -354,7 +378,7 @@ install from source.
|
|
|
354
378
|
Packaging:
|
|
355
379
|
|
|
356
380
|
Wheels for 1.8.1 published on PyPI include GEOS 3.10.2. This version is the
|
|
357
|
-
best version of
|
|
381
|
+
best version of GEOS yet. Discrepancies in behavior compared to previous
|
|
358
382
|
versions are considered to be improvements.
|
|
359
383
|
|
|
360
384
|
For the first time, we will publish wheels for macos_arm64 (see PR #1310).
|
|
@@ -1224,5 +1248,3 @@ TODO: fill gap here
|
|
|
1224
1248
|
1.0 RC1 (2008-01-14)
|
|
1225
1249
|
--------------------
|
|
1226
1250
|
- First release candidate
|
|
1227
|
-
|
|
1228
|
-
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.8.3
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.8.3"
|
|
@@ -3,8 +3,19 @@
|
|
|
3
3
|
See header file: geos-x.y.z/capi/geos_c.h
|
|
4
4
|
'''
|
|
5
5
|
|
|
6
|
-
from ctypes import
|
|
7
|
-
|
|
6
|
+
from ctypes import (
|
|
7
|
+
CFUNCTYPE,
|
|
8
|
+
POINTER,
|
|
9
|
+
Structure,
|
|
10
|
+
c_void_p,
|
|
11
|
+
c_char_p,
|
|
12
|
+
c_size_t,
|
|
13
|
+
c_byte,
|
|
14
|
+
c_uint,
|
|
15
|
+
c_int,
|
|
16
|
+
c_double,
|
|
17
|
+
py_object,
|
|
18
|
+
)
|
|
8
19
|
|
|
9
20
|
from .errors import UnsupportedGEOSVersionError
|
|
10
21
|
|
|
@@ -20,6 +31,13 @@ class allocated_c_char_p(c_char_p):
|
|
|
20
31
|
pass
|
|
21
32
|
|
|
22
33
|
|
|
34
|
+
class GEOSGeom_t(Structure):
|
|
35
|
+
pass
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
c_geom_p = POINTER(GEOSGeom_t)
|
|
39
|
+
|
|
40
|
+
|
|
23
41
|
def prototype(lgeos, geos_version):
|
|
24
42
|
"""Protype functions in geos_c.h for different version of GEOS
|
|
25
43
|
|
|
@@ -132,6 +150,9 @@ def prototype(lgeos, geos_version):
|
|
|
132
150
|
lgeos.GEOSBufferParams_create.restype = c_void_p
|
|
133
151
|
lgeos.GEOSBufferParams_create.argtypes = None
|
|
134
152
|
|
|
153
|
+
lgeos.GEOSBufferParams_destroy.restype = None
|
|
154
|
+
lgeos.GEOSBufferParams_destroy.argtypes = [c_void_p]
|
|
155
|
+
|
|
135
156
|
lgeos.GEOSBufferParams_setEndCapStyle.restype = c_int
|
|
136
157
|
lgeos.GEOSBufferParams_setEndCapStyle.argtypes = [c_void_p, c_int]
|
|
137
158
|
|
|
@@ -152,25 +173,25 @@ def prototype(lgeos, geos_version):
|
|
|
152
173
|
|
|
153
174
|
# Geometry constructors
|
|
154
175
|
|
|
155
|
-
lgeos.GEOSGeom_createPoint.restype =
|
|
176
|
+
lgeos.GEOSGeom_createPoint.restype = c_geom_p
|
|
156
177
|
lgeos.GEOSGeom_createPoint.argtypes = [c_void_p]
|
|
157
178
|
|
|
158
|
-
lgeos.GEOSGeom_createLinearRing.restype =
|
|
179
|
+
lgeos.GEOSGeom_createLinearRing.restype = c_geom_p
|
|
159
180
|
lgeos.GEOSGeom_createLinearRing.argtypes = [c_void_p]
|
|
160
181
|
|
|
161
|
-
lgeos.GEOSGeom_createLineString.restype =
|
|
182
|
+
lgeos.GEOSGeom_createLineString.restype = c_geom_p
|
|
162
183
|
lgeos.GEOSGeom_createLineString.argtypes = [c_void_p]
|
|
163
184
|
|
|
164
|
-
lgeos.GEOSGeom_createPolygon.restype =
|
|
165
|
-
lgeos.GEOSGeom_createPolygon.argtypes = [
|
|
185
|
+
lgeos.GEOSGeom_createPolygon.restype = c_geom_p
|
|
186
|
+
lgeos.GEOSGeom_createPolygon.argtypes = [c_geom_p, POINTER(c_geom_p), c_uint]
|
|
166
187
|
|
|
167
|
-
lgeos.GEOSGeom_createCollection.restype =
|
|
168
|
-
lgeos.GEOSGeom_createCollection.argtypes = [c_int,
|
|
188
|
+
lgeos.GEOSGeom_createCollection.restype = c_geom_p
|
|
189
|
+
lgeos.GEOSGeom_createCollection.argtypes = [c_int, POINTER(c_geom_p), c_uint]
|
|
169
190
|
|
|
170
|
-
lgeos.GEOSGeom_createEmptyCollection.restype =
|
|
191
|
+
lgeos.GEOSGeom_createEmptyCollection.restype = c_geom_p
|
|
171
192
|
lgeos.GEOSGeom_createEmptyCollection.argtypes = [c_int]
|
|
172
193
|
|
|
173
|
-
lgeos.GEOSGeom_clone.restype =
|
|
194
|
+
lgeos.GEOSGeom_clone.restype = c_geom_p
|
|
174
195
|
lgeos.GEOSGeom_clone.argtypes = [c_void_p]
|
|
175
196
|
|
|
176
197
|
# Memory management
|
|
@@ -222,9 +243,13 @@ def prototype(lgeos, geos_version):
|
|
|
222
243
|
lgeos.GEOSPolygonize.restype = c_void_p
|
|
223
244
|
lgeos.GEOSPolygonize.argtypes = [c_void_p, c_uint]
|
|
224
245
|
|
|
225
|
-
lgeos.GEOSPolygonize_full.restype =
|
|
246
|
+
lgeos.GEOSPolygonize_full.restype = c_geom_p
|
|
226
247
|
lgeos.GEOSPolygonize_full.argtypes = [
|
|
227
|
-
|
|
248
|
+
c_geom_p,
|
|
249
|
+
POINTER(c_geom_p),
|
|
250
|
+
POINTER(c_geom_p),
|
|
251
|
+
POINTER(c_geom_p),
|
|
252
|
+
]
|
|
228
253
|
|
|
229
254
|
if geos_version >= (3, 4, 0):
|
|
230
255
|
lgeos.GEOSDelaunayTriangulation.restype = c_void_p
|
|
@@ -393,17 +418,17 @@ def prototype(lgeos, geos_version):
|
|
|
393
418
|
|
|
394
419
|
# Misc functions
|
|
395
420
|
|
|
396
|
-
lgeos.GEOSArea.restype =
|
|
397
|
-
lgeos.GEOSArea.argtypes = [
|
|
421
|
+
lgeos.GEOSArea.restype = c_int
|
|
422
|
+
lgeos.GEOSArea.argtypes = [c_geom_p, POINTER(c_double)]
|
|
398
423
|
|
|
399
424
|
lgeos.GEOSLength.restype = c_int
|
|
400
|
-
lgeos.GEOSLength.argtypes = [
|
|
425
|
+
lgeos.GEOSLength.argtypes = [c_geom_p, POINTER(c_double)]
|
|
401
426
|
|
|
402
427
|
lgeos.GEOSDistance.restype = c_int
|
|
403
|
-
lgeos.GEOSDistance.argtypes = [
|
|
428
|
+
lgeos.GEOSDistance.argtypes = [c_geom_p, c_geom_p, POINTER(c_double)]
|
|
404
429
|
|
|
405
430
|
lgeos.GEOSHausdorffDistance.restype = c_int
|
|
406
|
-
lgeos.GEOSHausdorffDistance.argtypes = [
|
|
431
|
+
lgeos.GEOSHausdorffDistance.argtypes = [c_geom_p, c_geom_p, POINTER(c_double)]
|
|
407
432
|
|
|
408
433
|
# Reader and Writer APIs
|
|
409
434
|
|
|
@@ -521,8 +546,8 @@ def prototype(lgeos, geos_version):
|
|
|
521
546
|
c_void_p, py_object, c_void_p, lgeos.GEOSDistanceCallback, py_object]
|
|
522
547
|
lgeos.GEOSSTRtree_nearest_generic.restype = c_void_p
|
|
523
548
|
|
|
524
|
-
lgeos.GEOSMinimumClearance.argtypes = [
|
|
525
|
-
lgeos.GEOSMinimumClearance.restype =
|
|
549
|
+
lgeos.GEOSMinimumClearance.argtypes = [c_geom_p, POINTER(c_double)]
|
|
550
|
+
lgeos.GEOSMinimumClearance.restype = c_int
|
|
526
551
|
|
|
527
552
|
if geos_version >= (3, 8, 0):
|
|
528
553
|
lgeos.GEOSMakeValid.restype = c_void_p
|
|
@@ -7,7 +7,7 @@ different z values may intersect or be equal.
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
from binascii import a2b_hex
|
|
10
|
-
from ctypes import pointer, c_size_t, c_char_p, c_void_p
|
|
10
|
+
from ctypes import cast, pointer, c_size_t, c_char_p, c_void_p
|
|
11
11
|
from itertools import islice
|
|
12
12
|
import logging
|
|
13
13
|
import math
|
|
@@ -18,6 +18,7 @@ import warnings
|
|
|
18
18
|
|
|
19
19
|
from shapely.affinity import affine_transform
|
|
20
20
|
from shapely.coords import CoordinateSequence
|
|
21
|
+
from shapely.ctypes_declarations import c_geom_p
|
|
21
22
|
from shapely.errors import GeometryTypeError, WKBReadingError, WKTReadingError
|
|
22
23
|
from shapely.errors import ShapelyDeprecationWarning
|
|
23
24
|
from shapely.geos import WKBWriter, WKTWriter
|
|
@@ -107,10 +108,11 @@ def geos_geom_from_py(ob, create_func=None):
|
|
|
107
108
|
This behaviour is useful for converting between LineString and LinearRing
|
|
108
109
|
objects.
|
|
109
110
|
"""
|
|
111
|
+
geom_ptr = cast(ob._geom, c_geom_p)
|
|
110
112
|
if create_func is None:
|
|
111
|
-
geom = lgeos.GEOSGeom_clone(
|
|
113
|
+
geom = lgeos.GEOSGeom_clone(geom_ptr)
|
|
112
114
|
else:
|
|
113
|
-
cs = lgeos.GEOSGeom_getCoordSeq(
|
|
115
|
+
cs = lgeos.GEOSGeom_getCoordSeq(geom_ptr)
|
|
114
116
|
cs = lgeos.GEOSCoordSeq_clone(cs)
|
|
115
117
|
geom = create_func(cs)
|
|
116
118
|
|
|
@@ -625,12 +627,16 @@ class BaseGeometry:
|
|
|
625
627
|
|
|
626
628
|
if 'buffer_with_params' in self.impl:
|
|
627
629
|
params = self._lgeos.GEOSBufferParams_create()
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
630
|
+
try:
|
|
631
|
+
self._lgeos.GEOSBufferParams_setEndCapStyle(params, cap_style)
|
|
632
|
+
self._lgeos.GEOSBufferParams_setJoinStyle(params, join_style)
|
|
633
|
+
self._lgeos.GEOSBufferParams_setMitreLimit(params, mitre_limit)
|
|
634
|
+
self._lgeos.GEOSBufferParams_setQuadrantSegments(params, res)
|
|
635
|
+
self._lgeos.GEOSBufferParams_setSingleSided(params, single_sided)
|
|
636
|
+
return geom_factory(self.impl['buffer_with_params'](self, params, distance))
|
|
637
|
+
finally:
|
|
638
|
+
if params:
|
|
639
|
+
self._lgeos.GEOSBufferParams_destroy(params)
|
|
634
640
|
|
|
635
641
|
if cap_style == CAP_STYLE.round and join_style == JOIN_STYLE.round:
|
|
636
642
|
return geom_factory(self.impl['buffer'](self, distance, res))
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
from ctypes import c_void_p
|
|
5
5
|
|
|
6
|
+
from shapely.ctypes_declarations import c_geom_p
|
|
6
7
|
from shapely.geos import lgeos
|
|
7
8
|
from shapely.geometry.base import BaseGeometry
|
|
8
9
|
from shapely.geometry.base import BaseMultipartGeometry
|
|
@@ -63,7 +64,7 @@ def geos_geometrycollection_from_py(ob):
|
|
|
63
64
|
ob = ob.geoms
|
|
64
65
|
L = len(ob)
|
|
65
66
|
N = 2
|
|
66
|
-
subs = (
|
|
67
|
+
subs = (c_geom_p * L)()
|
|
67
68
|
for l in range(L):
|
|
68
69
|
assert(isinstance(ob[l], BaseGeometry))
|
|
69
70
|
if ob[l].has_z:
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
from ctypes import c_void_p, cast
|
|
5
5
|
import warnings
|
|
6
6
|
|
|
7
|
+
from shapely.ctypes_declarations import c_geom_p
|
|
7
8
|
from shapely.errors import EmptyPartError, ShapelyDeprecationWarning
|
|
8
9
|
from shapely.geos import lgeos
|
|
9
10
|
from shapely.geometry.base import BaseMultipartGeometry, geos_geom_from_py
|
|
@@ -116,9 +117,9 @@ def asMultiLineString(context):
|
|
|
116
117
|
|
|
117
118
|
|
|
118
119
|
def geos_multilinestring_from_py(ob):
|
|
119
|
-
# ob must be either a MultiLineString, a sequence, or
|
|
120
|
+
# ob must be either a MultiLineString, a sequence, or
|
|
120
121
|
# array of sequences or arrays
|
|
121
|
-
|
|
122
|
+
|
|
122
123
|
if isinstance(ob, MultiLineString):
|
|
123
124
|
return geos_geom_from_py(ob)
|
|
124
125
|
|
|
@@ -134,8 +135,8 @@ def geos_multilinestring_from_py(ob):
|
|
|
134
135
|
raise ValueError("Invalid coordinate dimensionality")
|
|
135
136
|
|
|
136
137
|
# Array of pointers to point geometries
|
|
137
|
-
subs = (
|
|
138
|
-
|
|
138
|
+
subs = (c_geom_p * L)()
|
|
139
|
+
|
|
139
140
|
# add to coordinate sequence
|
|
140
141
|
for l in range(L):
|
|
141
142
|
geom, ndims = linestring.geos_linestring_from_py(obs[l])
|
|
@@ -143,6 +144,6 @@ def geos_multilinestring_from_py(ob):
|
|
|
143
144
|
if lgeos.GEOSisEmpty(geom):
|
|
144
145
|
raise EmptyPartError("Can't create MultiLineString with empty component")
|
|
145
146
|
|
|
146
|
-
subs[l] = cast(geom,
|
|
147
|
-
|
|
147
|
+
subs[l] = cast(geom, c_geom_p)
|
|
148
|
+
|
|
148
149
|
return (lgeos.GEOSGeom_createCollection(5, subs, L), N)
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
from ctypes import byref, c_double, c_void_p, cast
|
|
5
5
|
import warnings
|
|
6
6
|
|
|
7
|
+
from shapely.ctypes_declarations import c_geom_p
|
|
7
8
|
from shapely.errors import EmptyPartError, ShapelyDeprecationWarning
|
|
8
9
|
from shapely.geos import lgeos
|
|
9
10
|
from shapely.geometry.base import (
|
|
@@ -194,7 +195,7 @@ def geos_multipoint_from_py(ob):
|
|
|
194
195
|
assert n == 2 or n == 3
|
|
195
196
|
|
|
196
197
|
# Array of pointers to point geometries
|
|
197
|
-
subs = (
|
|
198
|
+
subs = (c_geom_p * m)()
|
|
198
199
|
|
|
199
200
|
# add to coordinate sequence
|
|
200
201
|
for i in range(m):
|
|
@@ -204,6 +205,6 @@ def geos_multipoint_from_py(ob):
|
|
|
204
205
|
if lgeos.GEOSisEmpty(geom):
|
|
205
206
|
raise EmptyPartError("Can't create MultiPoint with empty component")
|
|
206
207
|
|
|
207
|
-
subs[i] = cast(geom,
|
|
208
|
+
subs[i] = cast(geom, c_geom_p)
|
|
208
209
|
|
|
209
210
|
return lgeos.GEOSGeom_createCollection(4, subs, m), n
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
from ctypes import c_void_p, cast
|
|
5
5
|
import warnings
|
|
6
6
|
|
|
7
|
+
from shapely.ctypes_declarations import c_geom_p
|
|
7
8
|
from shapely.errors import ShapelyDeprecationWarning
|
|
8
9
|
from shapely.geos import lgeos
|
|
9
10
|
from shapely.geometry.base import BaseMultipartGeometry, geos_geom_from_py
|
|
@@ -146,10 +147,10 @@ def geos_multipolygon_from_py(ob):
|
|
|
146
147
|
N = len(ob[0][0][0])
|
|
147
148
|
assert N == 2 or N == 3
|
|
148
149
|
|
|
149
|
-
subs = (
|
|
150
|
+
subs = (c_geom_p * L)()
|
|
150
151
|
for l in range(L):
|
|
151
152
|
geom, ndims = polygon.geos_polygon_from_py(ob[l][0], ob[l][1:])
|
|
152
|
-
subs[l] = cast(geom,
|
|
153
|
+
subs[l] = cast(geom, c_geom_p)
|
|
153
154
|
|
|
154
155
|
return (lgeos.GEOSGeom_createCollection(6, subs, L), N)
|
|
155
156
|
|
|
@@ -192,7 +193,7 @@ def geos_multipolygon_from_polygons(arg):
|
|
|
192
193
|
|
|
193
194
|
assert N == 2 or N == 3
|
|
194
195
|
|
|
195
|
-
subs = (
|
|
196
|
+
subs = (c_geom_p * L)()
|
|
196
197
|
|
|
197
198
|
for i, ob in enumerate(obs):
|
|
198
199
|
if isinstance(ob, polygon.Polygon):
|
|
@@ -203,6 +204,6 @@ def geos_multipolygon_from_polygons(arg):
|
|
|
203
204
|
holes = ob[1]
|
|
204
205
|
|
|
205
206
|
geom, ndims = polygon.geos_polygon_from_py(shell, holes)
|
|
206
|
-
subs[i] = cast(geom,
|
|
207
|
+
subs[i] = cast(geom, c_geom_p)
|
|
207
208
|
|
|
208
209
|
return (lgeos.GEOSGeom_createCollection(6, subs, L), N)
|
|
@@ -9,6 +9,7 @@ import weakref
|
|
|
9
9
|
|
|
10
10
|
from shapely.algorithms.cga import signed_area
|
|
11
11
|
from shapely.coords import CoordinateSequence
|
|
12
|
+
from shapely.ctypes_declarations import c_geom_p
|
|
12
13
|
from shapely.geos import lgeos
|
|
13
14
|
from shapely.geometry.base import BaseGeometry, geos_geom_from_py
|
|
14
15
|
from shapely.geometry.linestring import LineString, LineStringAdapter
|
|
@@ -555,16 +556,17 @@ def geos_polygon_from_py(shell, holes=None):
|
|
|
555
556
|
raise ValueError("insufficiant coordinate dimension")
|
|
556
557
|
|
|
557
558
|
# Array of pointers to ring geometries
|
|
558
|
-
geos_holes = (
|
|
559
|
+
geos_holes = (c_geom_p * L)()
|
|
559
560
|
|
|
560
561
|
# add to coordinate sequence
|
|
561
562
|
for l in range(L):
|
|
562
563
|
geom, ndim = geos_linearring_from_py(ob[l])
|
|
563
|
-
geos_holes[l] = cast(geom,
|
|
564
|
+
geos_holes[l] = cast(geom, c_geom_p)
|
|
564
565
|
else:
|
|
565
|
-
geos_holes = POINTER(
|
|
566
|
+
geos_holes = POINTER(c_geom_p)()
|
|
566
567
|
L = 0
|
|
567
568
|
|
|
568
569
|
return (
|
|
569
|
-
lgeos.GEOSGeom_createPolygon(
|
|
570
|
-
|
|
570
|
+
lgeos.GEOSGeom_createPolygon(cast(geos_shell, c_geom_p), geos_holes, L),
|
|
571
|
+
ndim,
|
|
572
|
+
)
|
|
@@ -34,14 +34,17 @@ class CachingGeometryProxy:
|
|
|
34
34
|
self.__geom__, n = self.factory(self.context)
|
|
35
35
|
self._gtag = gtag
|
|
36
36
|
return self.__geom__
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
def gtag(self):
|
|
39
39
|
return hash(repr(self.context))
|
|
40
40
|
|
|
41
41
|
def __setattr__(self, name, value):
|
|
42
42
|
# to override the custom one in BaseGeometry, so we don't warn
|
|
43
43
|
# for the proxy classes, which are already deprecated itself
|
|
44
|
-
|
|
44
|
+
try:
|
|
45
|
+
object.__setattr__(self, name, value)
|
|
46
|
+
except AttributeError:
|
|
47
|
+
pass
|
|
45
48
|
|
|
46
49
|
|
|
47
50
|
class PolygonProxy(CachingGeometryProxy):
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"""Support for various GEOS geometry operations
|
|
2
2
|
"""
|
|
3
3
|
|
|
4
|
-
from ctypes import byref, c_void_p, c_double
|
|
4
|
+
from ctypes import byref, cast, c_void_p, c_double
|
|
5
5
|
from warnings import warn
|
|
6
6
|
|
|
7
|
+
from shapely.ctypes_declarations import c_geom_p
|
|
7
8
|
from shapely.errors import GeometryTypeError, ShapelyDeprecationWarning
|
|
8
9
|
from shapely.prepared import prep
|
|
9
10
|
from shapely.geos import lgeos
|
|
@@ -44,12 +45,16 @@ class CollectionOperator:
|
|
|
44
45
|
source = [source]
|
|
45
46
|
finally:
|
|
46
47
|
obs = [self.shapeup(l) for l in source]
|
|
47
|
-
|
|
48
|
+
|
|
49
|
+
geom_array_type = c_geom_p * len(obs)
|
|
48
50
|
geom_array = geom_array_type()
|
|
51
|
+
|
|
49
52
|
for i, line in enumerate(obs):
|
|
50
|
-
geom_array[i] = line._geom
|
|
53
|
+
geom_array[i] = cast(line._geom, c_geom_p)
|
|
54
|
+
|
|
51
55
|
product = lgeos.GEOSPolygonize(byref(geom_array), len(obs))
|
|
52
56
|
collection = geom_factory(product)
|
|
57
|
+
|
|
53
58
|
for g in collection.geoms:
|
|
54
59
|
clone = lgeos.GEOSGeom_clone(g._geom)
|
|
55
60
|
g = geom_factory(clone)
|
|
@@ -78,16 +83,21 @@ class CollectionOperator:
|
|
|
78
83
|
source = [source]
|
|
79
84
|
finally:
|
|
80
85
|
obs = [self.shapeup(l) for l in source]
|
|
86
|
+
|
|
81
87
|
L = len(obs)
|
|
82
|
-
subs = (
|
|
88
|
+
subs = (c_geom_p * L)()
|
|
89
|
+
|
|
83
90
|
for i, g in enumerate(obs):
|
|
84
|
-
subs[i] = g._geom
|
|
91
|
+
subs[i] = cast(g._geom, c_geom_p)
|
|
92
|
+
|
|
85
93
|
collection = lgeos.GEOSGeom_createCollection(5, subs, L)
|
|
86
|
-
dangles =
|
|
87
|
-
cuts =
|
|
88
|
-
invalids =
|
|
94
|
+
dangles = c_geom_p()
|
|
95
|
+
cuts = c_geom_p()
|
|
96
|
+
invalids = c_geom_p()
|
|
89
97
|
product = lgeos.GEOSPolygonize_full(
|
|
90
|
-
collection, byref(dangles), byref(cuts), byref(invalids)
|
|
98
|
+
collection, byref(dangles), byref(cuts), byref(invalids)
|
|
99
|
+
)
|
|
100
|
+
|
|
91
101
|
return (
|
|
92
102
|
geom_factory(product),
|
|
93
103
|
geom_factory(dangles),
|
|
@@ -135,9 +145,12 @@ class CollectionOperator:
|
|
|
135
145
|
except TypeError:
|
|
136
146
|
geoms = [geoms]
|
|
137
147
|
L = 1
|
|
138
|
-
|
|
148
|
+
|
|
149
|
+
subs = (c_geom_p * L)()
|
|
150
|
+
|
|
139
151
|
for i, g in enumerate(geoms):
|
|
140
|
-
subs[i] = g._geom
|
|
152
|
+
subs[i] = cast(g._geom, c_geom_p)
|
|
153
|
+
|
|
141
154
|
collection = lgeos.GEOSGeom_createCollection(6, subs, L)
|
|
142
155
|
return geom_factory(lgeos.methods['cascaded_union'](collection))
|
|
143
156
|
|
|
@@ -154,9 +167,12 @@ class CollectionOperator:
|
|
|
154
167
|
except TypeError:
|
|
155
168
|
geoms = [geoms]
|
|
156
169
|
L = 1
|
|
157
|
-
|
|
170
|
+
|
|
171
|
+
subs = (c_geom_p * L)()
|
|
172
|
+
|
|
158
173
|
for i, g in enumerate(geoms):
|
|
159
|
-
subs[i] = g._geom
|
|
174
|
+
subs[i] = cast(g._geom, c_geom_p)
|
|
175
|
+
|
|
160
176
|
collection = lgeos.GEOSGeom_createCollection(6, subs, L)
|
|
161
177
|
return geom_factory(lgeos.methods['unary_union'](collection))
|
|
162
178
|
|
|
@@ -22,7 +22,10 @@ import ctypes
|
|
|
22
22
|
import logging
|
|
23
23
|
from typing import Any, ItemsView, Iterable, Iterator, Optional, Sequence, Tuple, Union
|
|
24
24
|
import sys
|
|
25
|
+
from warnings import warn
|
|
25
26
|
|
|
27
|
+
from shapely.ctypes_declarations import c_geom_p
|
|
28
|
+
from shapely.errors import ShapelyDeprecationWarning
|
|
26
29
|
from shapely.geometry.base import BaseGeometry
|
|
27
30
|
from shapely.geos import lgeos
|
|
28
31
|
|
|
@@ -97,6 +100,19 @@ class STRtree:
|
|
|
97
100
|
items: Iterable[Any] = None,
|
|
98
101
|
node_capacity: int = 10,
|
|
99
102
|
):
|
|
103
|
+
if items is not None:
|
|
104
|
+
warn(
|
|
105
|
+
"STRtree will be changed in 2.0.0 and will not be compatible with versions < 2. "
|
|
106
|
+
"Specifically: the items keyword argument will be removed.",
|
|
107
|
+
ShapelyDeprecationWarning,
|
|
108
|
+
stacklevel=2,
|
|
109
|
+
)
|
|
110
|
+
else:
|
|
111
|
+
warn(
|
|
112
|
+
"STRtree will be changed in 2.0.0 and will not be compatible with versions < 2.",
|
|
113
|
+
ShapelyDeprecationWarning,
|
|
114
|
+
stacklevel=2,
|
|
115
|
+
)
|
|
100
116
|
self.node_capacity = node_capacity
|
|
101
117
|
|
|
102
118
|
# Keep references to geoms
|
|
@@ -247,8 +263,11 @@ class STRtree:
|
|
|
247
263
|
if callback_userdata["exclusive"] and self._geoms[idx].equals(geom2):
|
|
248
264
|
dist[0] = sys.float_info.max
|
|
249
265
|
else:
|
|
250
|
-
lgeos.GEOSDistance(
|
|
251
|
-
|
|
266
|
+
lgeos.GEOSDistance(
|
|
267
|
+
ctypes.cast(self._geoms[idx]._geom, c_geom_p),
|
|
268
|
+
ctypes.cast(geom2._geom, c_geom_p),
|
|
269
|
+
dist,
|
|
270
|
+
)
|
|
252
271
|
return 1
|
|
253
272
|
except Exception:
|
|
254
273
|
log.exception("Caught exception")
|