Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

let COINS run even if there's overlapping geometry #652

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading