Skip to content

Commit

Permalink
Merge pull request #257 from martinfleis/mbc
Browse files Browse the repository at this point in the history
  • Loading branch information
ljwolf committed Aug 2, 2023
2 parents c7f180c + 17cf55a commit 42e9663
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions esda/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion esda/tests/test_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 42e9663

Please sign in to comment.