File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ gdal>=3.6.2
22numpy
33scipy
44geopandas
5- shapely>=2.0.2
5+ shapely>=2
66networkx
77owslib
88loopprojectfile==0.2.2
Original file line number Diff line number Diff line change 2323import geopandas
2424import shapely
2525import math
26-
26+ from shapely . errors import UnsupportedGEOSVersionError
2727
2828class ThicknessCalculator (ABC ):
2929 """
@@ -365,7 +365,11 @@ def compute(
365365 # calculate the length of the shortest line
366366 line_length = scipy .spatial .distance .euclidean (p1 , p2 )
367367 # find the indices of the points that are within 5% of the length of the shortest line
368- indices = shapely .dwithin (short_line , interp_points , line_length * 0.25 )
368+ try :
369+ # GEOS 3.10.0+
370+ indices = shapely .dwithin (short_line , interp_points , line_length * 0.25 )
371+ except UnsupportedGEOSVersionError :
372+ indices = numpy .array ([shapely .distance (short_line [0 ],point )<= (line_length * 0.25 ) for point in interp_points ])
369373 # get the dip of the points that are within
370374 _dip = numpy .deg2rad (dip [indices ])
371375 _dips .append (_dip )
You can’t perform that action at this time.
0 commit comments