shapely 1.6.1__tar.gz → 1.6.2.post1__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.6.1 → Shapely-1.6.2.post1}/CHANGES.txt +16 -0
- {Shapely-1.6.1/Shapely.egg-info → Shapely-1.6.2.post1}/PKG-INFO +18 -1
- {Shapely-1.6.1 → Shapely-1.6.2.post1/Shapely.egg-info}/PKG-INFO +18 -1
- Shapely-1.6.2.post1/VERSION.txt +1 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/docs/manual.rst +6 -1
- Shapely-1.6.2.post1/shapely/__init__.py +1 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/geometry/base.py +15 -3
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/ops.py +13 -10
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/speedups/_speedups.c +760 -339
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_split.py +18 -10
- Shapely-1.6.1/VERSION.txt +0 -1
- Shapely-1.6.1/shapely/__init__.py +0 -1
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/CREDITS.txt +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/LICENSE.txt +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/README.rst +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/Shapely.egg-info/SOURCES.txt +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/Shapely.egg-info/dependency_links.txt +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/Shapely.egg-info/requires.txt +1 -1
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/Shapely.egg-info/top_level.txt +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/_vendor/__init__.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/_vendor/packaging/__about__.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/_vendor/packaging/__init__.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/_vendor/packaging/_compat.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/_vendor/packaging/_structures.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/_vendor/packaging/markers.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/_vendor/packaging/requirements.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/_vendor/packaging/specifiers.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/_vendor/packaging/utils.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/_vendor/packaging/version.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/docs/design.rst +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/docs/index.rst +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/docs/project.rst +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/setup.cfg +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/setup.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/_buildcfg.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/_geos.pxi +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/affinity.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/algorithms/__init__.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/algorithms/cga.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/algorithms/polylabel.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/coords.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/ctypes_declarations.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/errors.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/examples/__init__.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/examples/dissolve.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/examples/geoms.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/examples/intersect.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/ftools.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/geometry/__init__.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/geometry/collection.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/geometry/geo.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/geometry/linestring.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/geometry/multilinestring.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/geometry/multipoint.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/geometry/multipolygon.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/geometry/point.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/geometry/polygon.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/geometry/proxy.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/geos.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/impl.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/iterops.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/linref.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/predicates.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/prepared.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/speedups/__init__.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/speedups/_speedups.pyx +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/strtree.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/topology.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/validation.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/vectorized/__init__.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/vectorized/_vectorized.pyx +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/wkb.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/shapely/wkt.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/__init__.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/binascii_hex.txt +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/conftest.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_affinity.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_box.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_cga.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_collection.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_coords.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_default_impl.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_delaunay.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_delegated.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_dlls.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_doctests.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_emptiness.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_empty_polygons.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_equality.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_geointerface.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_geomseq.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_geos_err_handler.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_getitem.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_hash.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_invalid_geometries.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_iterops.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_linear_referencing.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_linemerge.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_linestring.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_locale.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_mapping.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_minimum_rotated_rectangle.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_multi.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_multilinestring.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_multipoint.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_multipolygon.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_ndarrays.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_nearest.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_operations.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_operators.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_parallel_offset.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_persist.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_pickle.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_point.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_polygon.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_polygonize.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_polylabel.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_predicates.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_prepared.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_products_z.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_shared_paths.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_singularity.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_snap.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_strtree.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_styles.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_svg.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_transform.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_union.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_validation.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_vectorized.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_wkt.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/test_xy.py +0 -0
- {Shapely-1.6.1 → Shapely-1.6.2.post1}/tests/threading_test.py +0 -0
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
Changes
|
|
2
2
|
=======
|
|
3
3
|
|
|
4
|
+
1.6.2 (2017-10-30)
|
|
5
|
+
------------------
|
|
6
|
+
|
|
7
|
+
- A 1.6.2.post1 release has been made to fix a problem with macosx wheels
|
|
8
|
+
uploaded to PyPI.
|
|
9
|
+
|
|
10
|
+
1.6.2 (2017-10-26)
|
|
11
|
+
------------------
|
|
12
|
+
|
|
13
|
+
- Handle a ``TypeError`` that can occur when geometries are torn down (#473,
|
|
14
|
+
#528).
|
|
15
|
+
- Splitting a linestring by one of its end points will now succeed instead of
|
|
16
|
+
failing with a ``ValueError`` (#524, #533).
|
|
17
|
+
- Missing documentation of a geometry's ``overlaps`` predicate has been added
|
|
18
|
+
(#522).
|
|
19
|
+
|
|
4
20
|
1.6.1 (2017-09-01)
|
|
5
21
|
------------------
|
|
6
22
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 1.1
|
|
2
2
|
Name: Shapely
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.2.post1
|
|
4
4
|
Summary: Geometric objects, predicates, and operations
|
|
5
5
|
Home-page: https://github.com/Toblerity/Shapely
|
|
6
6
|
Author: Sean Gillies
|
|
7
7
|
Author-email: sean.gillies@gmail.com
|
|
8
8
|
License: BSD
|
|
9
|
+
Description-Content-Type: UNKNOWN
|
|
9
10
|
Description: =======
|
|
10
11
|
Shapely
|
|
11
12
|
=======
|
|
@@ -241,6 +242,22 @@ Description: =======
|
|
|
241
242
|
Changes
|
|
242
243
|
=======
|
|
243
244
|
|
|
245
|
+
1.6.2 (2017-10-30)
|
|
246
|
+
------------------
|
|
247
|
+
|
|
248
|
+
- A 1.6.2.post1 release has been made to fix a problem with macosx wheels
|
|
249
|
+
uploaded to PyPI.
|
|
250
|
+
|
|
251
|
+
1.6.2 (2017-10-26)
|
|
252
|
+
------------------
|
|
253
|
+
|
|
254
|
+
- Handle a ``TypeError`` that can occur when geometries are torn down (#473,
|
|
255
|
+
#528).
|
|
256
|
+
- Splitting a linestring by one of its end points will now succeed instead of
|
|
257
|
+
failing with a ``ValueError`` (#524, #533).
|
|
258
|
+
- Missing documentation of a geometry's ``overlaps`` predicate has been added
|
|
259
|
+
(#522).
|
|
260
|
+
|
|
244
261
|
1.6.1 (2017-09-01)
|
|
245
262
|
------------------
|
|
246
263
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 1.1
|
|
2
2
|
Name: Shapely
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.2.post1
|
|
4
4
|
Summary: Geometric objects, predicates, and operations
|
|
5
5
|
Home-page: https://github.com/Toblerity/Shapely
|
|
6
6
|
Author: Sean Gillies
|
|
7
7
|
Author-email: sean.gillies@gmail.com
|
|
8
8
|
License: BSD
|
|
9
|
+
Description-Content-Type: UNKNOWN
|
|
9
10
|
Description: =======
|
|
10
11
|
Shapely
|
|
11
12
|
=======
|
|
@@ -241,6 +242,22 @@ Description: =======
|
|
|
241
242
|
Changes
|
|
242
243
|
=======
|
|
243
244
|
|
|
245
|
+
1.6.2 (2017-10-30)
|
|
246
|
+
------------------
|
|
247
|
+
|
|
248
|
+
- A 1.6.2.post1 release has been made to fix a problem with macosx wheels
|
|
249
|
+
uploaded to PyPI.
|
|
250
|
+
|
|
251
|
+
1.6.2 (2017-10-26)
|
|
252
|
+
------------------
|
|
253
|
+
|
|
254
|
+
- Handle a ``TypeError`` that can occur when geometries are torn down (#473,
|
|
255
|
+
#528).
|
|
256
|
+
- Splitting a linestring by one of its end points will now succeed instead of
|
|
257
|
+
failing with a ``ValueError`` (#524, #533).
|
|
258
|
+
- Missing documentation of a geometry's ``overlaps`` predicate has been added
|
|
259
|
+
(#522).
|
|
260
|
+
|
|
244
261
|
1.6.1 (2017-09-01)
|
|
245
262
|
------------------
|
|
246
263
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.6.2.post1
|
|
@@ -442,7 +442,7 @@ constructor parameter.
|
|
|
442
442
|
Polygons
|
|
443
443
|
--------
|
|
444
444
|
|
|
445
|
-
.. class:: Polygon(
|
|
445
|
+
.. class:: Polygon(shell [,holes=None])
|
|
446
446
|
|
|
447
447
|
The `Polygon` constructor takes two positional parameters. The first is an
|
|
448
448
|
ordered sequence of ``(x, y[, z])`` point tuples and is treated exactly as in
|
|
@@ -1145,6 +1145,11 @@ This predicate applies to all types and is the inverse of :meth:`intersects`.
|
|
|
1145
1145
|
In other words, geometric objects intersect if they have any boundary or
|
|
1146
1146
|
interior point in common.
|
|
1147
1147
|
|
|
1148
|
+
.. method:: object.overlaps(other)
|
|
1149
|
+
|
|
1150
|
+
Returns ``True`` if the objects intersect (see above) but neither contains
|
|
1151
|
+
the other.
|
|
1152
|
+
|
|
1148
1153
|
.. method:: object.touches(other)
|
|
1149
1154
|
|
|
1150
1155
|
Returns ``True`` if the objects have at least one point in common and their
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.6.2.post1"
|
|
@@ -699,7 +699,11 @@ class BaseGeometry(object):
|
|
|
699
699
|
return bool(self.impl['disjoint'](self, other))
|
|
700
700
|
|
|
701
701
|
def equals(self, other):
|
|
702
|
-
"""Returns True if geometries are equal, else False
|
|
702
|
+
"""Returns True if geometries are equal, else False
|
|
703
|
+
|
|
704
|
+
Refers to point-set equality (or topological equality), and is equivalent to
|
|
705
|
+
(self.within(other) & self.contains(other))
|
|
706
|
+
"""
|
|
703
707
|
return bool(self.impl['equals'](self, other))
|
|
704
708
|
|
|
705
709
|
def intersects(self, other):
|
|
@@ -720,12 +724,20 @@ class BaseGeometry(object):
|
|
|
720
724
|
|
|
721
725
|
def equals_exact(self, other, tolerance):
|
|
722
726
|
"""Returns True if geometries are equal to within a specified
|
|
723
|
-
tolerance
|
|
727
|
+
tolerance
|
|
728
|
+
|
|
729
|
+
Refers to coordinate equality, which requires coordinates to be equal
|
|
730
|
+
and in the same order for all components of a geometry
|
|
731
|
+
"""
|
|
724
732
|
return bool(self.impl['equals_exact'](self, other, tolerance))
|
|
725
733
|
|
|
726
734
|
def almost_equals(self, other, decimal=6):
|
|
727
735
|
"""Returns True if geometries are equal at all coordinates to a
|
|
728
|
-
specified decimal place
|
|
736
|
+
specified decimal place
|
|
737
|
+
|
|
738
|
+
Refers to approximate coordinate equality, which requires coordinates be
|
|
739
|
+
approximately equal and in the same order for all components of a geometry.
|
|
740
|
+
"""
|
|
729
741
|
return self.equals_exact(other, 0.5 * 10**(-decimal))
|
|
730
742
|
|
|
731
743
|
def relate_pattern(self, other, pattern):
|
|
@@ -257,7 +257,7 @@ def transform(func, geom):
|
|
|
257
257
|
|
|
258
258
|
def nearest_points(g1, g2):
|
|
259
259
|
"""Returns the calculated nearest points in the input geometries
|
|
260
|
-
|
|
260
|
+
|
|
261
261
|
The points are returned in the same order as the input geometries.
|
|
262
262
|
"""
|
|
263
263
|
seq = lgeos.methods['nearest_points'](g1._geom, g2._geom)
|
|
@@ -339,21 +339,21 @@ class SplitOp(object):
|
|
|
339
339
|
union = poly.boundary.union(splitter)
|
|
340
340
|
|
|
341
341
|
# some polygonized geometries may be holes, we do not want them
|
|
342
|
-
# that's why we test if the original polygon (poly) contains
|
|
342
|
+
# that's why we test if the original polygon (poly) contains
|
|
343
343
|
# an inner point of polygonized geometry (pg)
|
|
344
344
|
return [pg for pg in polygonize(union) if poly.contains(pg.representative_point())]
|
|
345
345
|
|
|
346
346
|
@staticmethod
|
|
347
347
|
def _split_line_with_line(line, splitter):
|
|
348
348
|
"""Split a LineString with another (Multi)LineString or (Multi)Polygon"""
|
|
349
|
-
|
|
349
|
+
|
|
350
350
|
# if splitter is a polygon, pick it's boundary
|
|
351
351
|
if splitter.type in ('Polygon', 'MultiPolygon'):
|
|
352
352
|
splitter = splitter.boundary
|
|
353
353
|
|
|
354
354
|
assert(isinstance(line, LineString))
|
|
355
355
|
assert(isinstance(splitter, LineString) or isinstance(splitter, MultiLineString))
|
|
356
|
-
|
|
356
|
+
|
|
357
357
|
if splitter.crosses(line):
|
|
358
358
|
# The lines cross --> return multilinestring from the split
|
|
359
359
|
return line.difference(splitter)
|
|
@@ -364,7 +364,7 @@ class SplitOp(object):
|
|
|
364
364
|
# The lines do not cross --> return collection with identity line
|
|
365
365
|
return [line]
|
|
366
366
|
|
|
367
|
-
@staticmethod
|
|
367
|
+
@staticmethod
|
|
368
368
|
def _split_line_with_point(line, splitter):
|
|
369
369
|
"""Split a LineString with a Point"""
|
|
370
370
|
|
|
@@ -374,10 +374,13 @@ class SplitOp(object):
|
|
|
374
374
|
# check if point is in the interior of the line
|
|
375
375
|
if not line.relate_pattern(splitter, '0********'):
|
|
376
376
|
# point not on line interior --> return collection with single identity line
|
|
377
|
-
# (REASONING: Returning a list with the input line reference and creating a
|
|
378
|
-
# GeometryCollection at the general split function prevents unnecessary copying
|
|
377
|
+
# (REASONING: Returning a list with the input line reference and creating a
|
|
378
|
+
# GeometryCollection at the general split function prevents unnecessary copying
|
|
379
379
|
# of linestrings in multipoint splitting function)
|
|
380
380
|
return [line]
|
|
381
|
+
elif line.coords[0] == splitter.coords[0]:
|
|
382
|
+
# if line is a closed ring the previous test doesn't behave as desired
|
|
383
|
+
return [line]
|
|
381
384
|
|
|
382
385
|
# point is on line, get the distance from the first point on line
|
|
383
386
|
distance_on_line = line.project(splitter)
|
|
@@ -388,7 +391,7 @@ class SplitOp(object):
|
|
|
388
391
|
pd = line.project(Point(p))
|
|
389
392
|
if pd == distance_on_line:
|
|
390
393
|
return [
|
|
391
|
-
LineString(coords[:i+1]),
|
|
394
|
+
LineString(coords[:i+1]),
|
|
392
395
|
LineString(coords[i:])
|
|
393
396
|
]
|
|
394
397
|
elif distance_on_line < pd:
|
|
@@ -414,9 +417,9 @@ class SplitOp(object):
|
|
|
414
417
|
# add the newly split 2 lines or the same line if not split
|
|
415
418
|
new_chunks.extend(SplitOp._split_line_with_point(chunk, pt))
|
|
416
419
|
chunks = new_chunks
|
|
417
|
-
|
|
420
|
+
|
|
418
421
|
return chunks
|
|
419
|
-
|
|
422
|
+
|
|
420
423
|
@staticmethod
|
|
421
424
|
def split(geom, splitter):
|
|
422
425
|
"""
|