Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jts-dev] Visual Center of Polygon

Hi Martin,
 
I was looking at the testDoubleDiamond() case here
 

Polygon p = (Polygon) reader.read("POLYGON((0 5, 5 10, 10 6, 15 10, 20 5, 15 0, 10 4, 5 0, 0 5))");

and decided to try it out with the jts-ports PolyLabeller.getPolylabel(Geometry polygon, double precision).

Should I expect to get back either (5,5) or (15,5) plus or minus (roughly) precision?

I find

PolyLabeller.getPolylabel(p, 1)     = (5,5)
PolyLabeller.getPolylabel(p, 0.1)   = (14.727,4.961)
PolyLabeller.getPolylabel(p, 0.001) = (5.276,4.999)

In other words, the answer doesn't seem to improve with decreasing precision.

Any thoughts on what could be going on?

Thanks,

Eric

On Thu, Oct 25, 2018 at 12:39 AM Martin Davis <mtnclimb@xxxxxxxxx> wrote:
Yes.  And probably best implemented using the orientationIndex predicate.

On Wed, Oct 24, 2018, 8:42 PM Sandro Santilli <strk@xxxxxx> wrote:
On Wed, Oct 24, 2018 at 10:58:08AM -0600, Eric Angle wrote:

> Your suggestion of checking that all interior angles are less than 180
> makes sense to me.

Less than or equal to 180, I guess ?

--strk;
_______________________________________________
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

Back to the top