After computing the polygon centroid to see an initial guess, polylabel computes an additional special case, with the comment “special case for rectangular polygons”. The comment puzzled me, because for rectangular polygons, this would simply compute the centroid through a different method, yielding a redundant candidate point.
I then realized that this computes the bounding-box center point as a legitimate candidate for any polygon. There are indeed cases where this would yield a better solution than a centroid. I'd suggest replacing this comment with something more accurate, like “test the bounding-box center as a possible better candidate”.
After computing the polygon centroid to see an initial guess, polylabel computes an additional special case, with the comment “special case for rectangular polygons”. The comment puzzled me, because for rectangular polygons, this would simply compute the centroid through a different method, yielding a redundant candidate point.
I then realized that this computes the bounding-box center point as a legitimate candidate for any polygon. There are indeed cases where this would yield a better solution than a centroid. I'd suggest replacing this comment with something more accurate, like “test the bounding-box center as a possible better candidate”.