[geos-devel] Is empty LinearRing closed?
Martin Davis
mbdavis at VividSolutions.com
Thu Mar 30 11:52:06 EST 2006
But the definition of LinearRing is that the start point equals the end point. This makes the test unnecessary for a valid LinearRing. However, maybe it's more general to use the explicit test.
As for an empty LinearRing, well, I don't know of any semantics which covers this. This might be an angels-on-the-head-of-a-pin kind of thing. If you don't like the JTS semantics for your particular use-case, you should just implement your own test.
Martin Davis, Senior Technical Architect
Vivid Solutions Inc. www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046
> -----Original Message-----
> From: geos-devel-bounces at geos.refractions.net
> [mailto:geos-devel-bounces at geos.refractions.net] On Behalf Of
> Mateusz Loskot
> Sent: March 30, 2006 6:25 AM
> To: GEOS Development List
> Subject: [geos-devel] Is empty LinearRing closed?
>
>
> 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
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net
> http://geos.refractions.net/mailman/listinfo/geos-devel
>
More information about the geos-devel
mailing list