Skip to content

Commit

Permalink
_weld_MultiLineString edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jGaboardi committed Dec 4, 2020
1 parent 160da22 commit 016b775
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 8 additions & 0 deletions tigernet/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ def test__weld_MultiLineString_2(self):
observed_weld_wkt = utils._weld_MultiLineString(mls).wkt
self.assertEqual(observed_weld_wkt, known_weld_wkt)

def test__weld_MultiLineString_3(self):
known_weld_wkt = "LINESTRING (1 0, 1 1, 0 1, 0 0)"
mls = MultiLineString(
(((0, 1.00000001), (0, 0)), ((1, 1), (0, 1)), ((1, 0), (1, 1)))
)
observed_weld_wkt = utils._weld_MultiLineString(mls).wkt
self.assertEqual(observed_weld_wkt, known_weld_wkt)


if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions tigernet/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,10 +1037,6 @@ def _weld_MultiLineString(multilinestring, weld_multi=True, skip_restr=True):
sp1, ep1 = L1.boundary[0], L1.boundary[1]
sp2, ep2 = L2.boundary[0], L2.boundary[1]

# if equal move along
if ep1.equals(sp2) or sp1.equals(ep2):
continue

# if either sets are almost equal pass along the
# altered first line and the original second line
if ep1.almost_equals(sp2) or sp1.almost_equals(ep2):
Expand Down

0 comments on commit 016b775

Please sign in to comment.