Skip to content

Commit 342e028

Browse files
Remove usage of lgeos in shapely.validation
1 parent d2b3727 commit 342e028

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

shapely/validation.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# TODO: allow for implementations using other than GEOS
2-
from shapely.geometry.base import geom_factory
3-
from shapely.geos import lgeos
2+
3+
import pygeos
4+
45

56
__all__ = ['explain_validity', 'make_valid']
67

@@ -23,7 +24,7 @@ def explain_validity(ob):
2324
A string describing the reason the geometry is invalid.
2425
2526
"""
26-
return lgeos.GEOSisValidReason(ob._geom)
27+
return pygeos.is_valid_reason(ob)
2728

2829

2930
def make_valid(ob):
@@ -52,4 +53,4 @@ def make_valid(ob):
5253
"""
5354
if ob.is_valid:
5455
return ob
55-
return geom_factory(lgeos.GEOSMakeValid(ob._geom))
56+
return pygeos.make_valid(ob)

0 commit comments

Comments
 (0)