From 17cf55ab72c1cdf41e1987c594b711eb36903554 Mon Sep 17 00:00:00 2001 From: Martin Fleischmann Date: Wed, 2 Aug 2023 22:29:25 +0200 Subject: [PATCH] use radius --- esda/shape.py | 4 ++-- esda/tests/test_shape.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/esda/shape.py b/esda/shape.py index bedfdb07..82f7b664 100644 --- a/esda/shape.py +++ b/esda/shape.py @@ -181,8 +181,8 @@ def minimum_bounding_circle_ratio(collection): (1963) """ ga = _cast(collection) - mbc = shapely.minimum_bounding_circle(ga) - return shapely.area(ga) / shapely.area(mbc) + mbca = (shapely.minimum_bounding_radius(ga) ** 2) * numpy.pi + return shapely.area(ga) / mbca def radii_ratio(collection): diff --git a/esda/tests/test_shape.py b/esda/tests/test_shape.py index e5b16bf9..70baeca4 100644 --- a/esda/tests/test_shape.py +++ b/esda/tests/test_shape.py @@ -79,7 +79,7 @@ def test_nmi(): def test_mbc(): observed = esda.shape.minimum_bounding_circle_ratio(shape) - testing.assert_allclose(observed, 0.437571, atol=ATOL) + testing.assert_allclose(observed, 0.434765, atol=ATOL) def test_reflexive_angle_ratio():