Skip to content

Commit a9c274e

Browse files
committed
Workaround for newer GEOS versions.
See also #484
1 parent 0216074 commit a9c274e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/mpl_toolkits/basemap/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,10 @@ def _readboundarydata(self,name,as_polygons=False):
14591459
# convert polygons to line segments
14601460
poly = _geoslib.LineString(poly.boundary)
14611461
else:
1462+
# this is a workaround to avoid
1463+
# GEOS_ERROR: CGAlgorithmsDD::orientationIndex encountered NaN/Inf numbers
1464+
b[np.isposinf(b)] = 1e20
1465+
b[np.isneginf(b)] = -1e20
14621466
poly = Shape(b)
14631467
# this is a workaround to avoid
14641468
# "GEOS_ERROR: TopologyException:

0 commit comments

Comments
 (0)