Skip to content

Commit

Permalink
let COINS run even if there's overlapping geometry (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfleis authored Aug 22, 2024
1 parent 800868c commit f89f787
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions momepy/coins.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import collections
import math
import warnings

import geopandas as gpd
import numpy as np
Expand Down Expand Up @@ -435,11 +436,15 @@ def _angle_between_two_lines(line1, line2):

# make sure lines are not identical
if len(points) == 2:
raise ValueError(
"Lines are identical. Please revise input data "
"to ensure no lines are identical or overlapping. "
"You can check for duplicates using `gdf.geometry.duplicated()`."
warnings.warn(
f"Lines are between points {points.keys()} identical. Please revise input "
"data to ensure no lines are identical or overlapping. "
"You can check for duplicates using `gdf.geometry.duplicated()`. Assuming"
"an angle of 0 degrees.",
UserWarning,
stacklevel=3,
)
return 0

# make sure lines do touch
if len(points) == 4:
Expand Down

0 comments on commit f89f787

Please sign in to comment.