I am trying to calculate the compactness of (vector) polygons in using R.

My main reference to do so is this paper. There used to be an ArcGIS toolbox (Shape Metrics) to calculate these metrics. However, it is not available anymore in the website.

I would like to now if there is an open-source alternative, preferably implemented in R, to calculate these (or equivalent) compactness metrics for vector data.

The close I get until now is the landscapemetrics package. However, it seems to work only with raster data.

  • Paper is behind a paywall, ArcGIS toolbox is, as you say, absent... Can you edit the Q and fill in with some more detail about which shape metrics you want to calculate, with some formulae?
    – Spacedman
    Jan 25, 2023 at 23:26

1 Answer 1


Whereas there are a few specific landscape metrics designed for vector data most that have been implemented in add-ons such as V-LATE, PolyFrag and Shape Metrics are just modifications of the raster version. There are a few exceptions such as polygon compactness metrics associated with circular or convex geometry. I believe that the mandeR package (you may have to install from source) will provide similar results (ie., Polsby-Popper, Convex, Reock, Schwartzberg) to the compactness metrics from Shape Metrics.

Since many vector polygon landcover maps are derived from a raster landcover classification to begin with and then smoothed to remove the staircase effect, adding arbitrary spatial error, you are better off just using the raster data model and the associated, well proven, metrics in the landscapemetrics package which is a direct, and tested, translation of the Fragstats software. Please note that the Barnes & Solomon (2020) paper clearly demonstrates the effect of numeric precision and boundary complexity on compactness metrics, which is quite relevant to polygons created from raster data.

The website that you linked details work UCONN-CLEAR did quantifying fragmentation using GUIDOS which is a mathematical morphology approach applied to binary raster data. If this is what you are after then I recommend reading Vogt's work and tracking down the GuidosToolbox Workbench (Vogt et al., 2022). I do have a Python script (using ArcPy) floating around that implements the GUIODS model so, message me if you need it. However, the full workbench includes some functions that leverage the graph-theoretic model Conefor Sensinode for understanding landscape structure resulting from the fragmentation analysis.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.