[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jts-dev] Visual Center of Polygon
|
Yes,
polygon.equals(polygon.convexHull()) should work for checking convexity, but testing interior angles should be a lot faster.
Thank you Martin, this is very helpful. At first glance PolyLabeller.getPolyLabel() appears to be exactly what I'm looking for.
Your suggestion of checking that all interior angles are less than 180 makes sense to me.
I assume you agree polygon.equals(polygon.convexHull()) should work, and your suggestion to check the interior angles just might be faster?
Eric Angle
if there is agreement that it is correct that convex == all interior angles convex, it would be nice to add that as an isConvex method to the ConvexHull class.
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
_______________________________________________
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
_______________________________________________
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