Boost logo

Geometry :

Subject: Re: [geometry] Why closure?
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2013-06-20 07:42:16


On 20 June 2013 10:26, TONGARI <tongari95_at_[hidden]> wrote:
>
> I'm not quite understand why we need traits::closure for Ring & Polygon,
> aren't these always closed?

You can define open polygon or ring, means

typedef bg::model::polygon<point, false, false> polygon; // open polygon
typedef bg::model::ring<point, false, false> ring; // open ring

where the following condition does not hold

last point == first point

It is specification of the fact if first point is assumed as repeated or not
at last position.

> What should I expect if the closure is open?

Algorithms won't expect physical presence of the repeated first point.

> Should I see Ring as Linestring

Ring is also known as linear ring, in case you know OGC geometry model.
IOW, (linear) ring is a specialisation of the linestring kind.

Best regards,

-- 
Mateusz Loskot, http://mateusz.loskot.net

Geometry list run by mateusz at loskot.net