jts icon indicating copy to clipboard operation
jts copied to clipboard

MinumumAreaRectangle with convex hint is limited because all methods are private

Open joshgold22 opened this issue 4 months ago • 1 comments

The constuctor, but not the static factory for MinimumAreaRectangle allows a hint that the input Geometry is already convex. If I use any constructor, though (with or without the hint) I don't see anything at all that I can do with the object that's created because none of the methods are public. I can't get a Geometry from it, for instance like the static factory provides. And the static factory does not support the convex hint. Fixes could include makoing the non-static getMinimumRectangle method public, as well as adding a version of the static factory method with the convex parameter.)

(My ideal use-case goes further: I'd like to be able to get the length and width, or even better, the short and long diameter without checking the other. This is related to MaximumInscribedCircle.isRadiusWithin, which isn't in a public release yet I believe. The first order fix for this class, though, seems to be tweaking what should be public or not.)

joshgold22 avatar Sep 16 '25 18:09 joshgold22

An alternative/workaround with close but not identical semantics is to use new MinimumDiameter(geom, true).getMinimumRectangle()

joshgold22 avatar Oct 28 '25 16:10 joshgold22