[geos-devel] Is empty LinearRing closed?

Mateusz Łoskot mateusz at loskot.net
Thu Mar 30 09:24:49 EST 2006


Hi,

As I see, LinearRing is always closed:

bool LinearRing::isClosed() const {
	return true;
}

GeometryFactory ::createLinearRing() call creates empty LinerRing.
So, should it be considered as closed by default?

IMO empty LinearRing should not be considered as closed. OGC Simple
Feature Spec. says about IsClosed for Curve type (base of LinearRing):

IsClosed( ):
(TRUE) if this Curve is closed (StartPoint ( ) = EndPoint ( )).


So, according to OGC SF Spec. LinearRing::isClosed() should be
implemented as follows;

bool LinearRing::isClosed() const {
	return (getStartPoint() == getEndPoint());
}

Am I correct?

Cheers
-- 
Mateusz Łoskot
http://mateusz.loskot.net



More information about the geos-devel mailing list