[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jts-dev] Visual Center of Polygon
|
Good question. Perhaps test that every interior angle is convex?
I had a follow up question. Is there a better way to determine if a Polygon is convex than checking polygon.equals(polygon.convexHull()) ?
Thank you,
Eric Angle
I'm interested in calculating the visual center of a JTS Polygon. If the Polygon is convex, then the getCentroid() method works great. However, if the Polygon is non-convex, getCentroid() can return a Point outside the Polygon. Polygon does have a getInteriorPoint() method, however it doesn't always return what I would consider the visual center.
Is there any capability within JTS to calculate the visual center of a Polygon?
Some Googling suggests that I could triangulate the polygon (which JTS can definitely do) and then somehow use that to calculate the visual center (pole of inaccessibility and skeleton algorithms are terms that pop up).
Thank you for any input you can provide.
Eric Angle
_______________________________________________
jts-dev mailing list
jts-dev@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.locationtech.org/mailman/listinfo/jts-dev